-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For zero auth payments, only store the payment method if the configuration says we should #2589
Conversation
…y if the configuration says we should
🦋 Changeset detectedLatest commit: 4cf1ff5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +181 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
…d we are trying to store a card
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Summary
The fix in #2571 did not cover all use cases
For regular card, zero auth payments, we should store the payment method only if the configuration says we should:
storePaymentMethodMode: 'askForConsent'
(which will lead to aconfiguration: {enableStoreDetails: true}
object in the/sessions/setup
response)enableStoreDetails: true
What we are doing is.. if for a normal payment we would show the "Save for my next payment" checkbox, for a zero-auth payment we effectively click the checkbox on behalf of the shopper, if we are allowed to.
To this end, in the
Card
component I have created a new, separate propertyshowStoreDetailsCheckbox
which is solely concerned with the UI and whether we should show the "Save for my next payment" checkbox.The original
enableStoreDetails
property is retained to store the original value from the configuration passed to the componentTested scenarios
New unit tests
All unit tests pass
Fixed issue: COWEB-1352