fix: userCanPay without existing payment methods - #306
Conversation
|
Hi @josh-burton, thank you for your contributions. Thank you again. |
Thank you for the review. I have made those changes |
| await throwIfProviderIsNotDefined(provider); | ||
| if (supportedProviders[defaultTargetPlatform]!.contains(provider)) { | ||
| return _payPlatform.userCanPay(_configurations[provider]!); | ||
| return _payPlatform.userCanPay(_configurations[provider]!, existingPaymentMethodAvailable: existingPaymentMethodAvailable); |
There was a problem hiding this comment.
If this field is already part of the configuration, does it need to be also passed a method parameter here?
There was a problem hiding this comment.
We need this as a method parameter to allow some call sites only check whether Google Pay is supported, while others also need to check that the user has a card available (while using a single JSON config)
…out requiring cards to be added Adds a new existingPaymentMethodRequired parameter to the userCanPay method, so the developer can determine if Apple/Google pay is available without requiring cards to be added
…ailable, sets default values to false
- align the availability flag with existingPaymentMethodRequired - map the requirement when building Android payment profiles - avoid parsing Apple Pay networks for device-support-only checks - improve availability documentation and update channel tests
075d06a to
371da49
Compare
|
@JlUgia thank you for the review. I have addressed your comments and would appreciate another review. Very keen to get this merged. |
Fixes #305
Describe the changes proposed
Adds a new
existingPaymentMethodRequiredparameter to theuserCanPaymethod, so the developer can determine if Apple/Google pay is available without requiring cards to be addedScreenshots / Videos
If useful, include any screeshots or screencasts to better explain the change.
Additional context
Add any other context about the change here.