-
Notifications
You must be signed in to change notification settings - Fork 299
Description
Describe the bug
I have customer card details saved, where the card issuer is Visa. I want to restrict the payment brands to only Visa and Mastercard using the following configuration in initPaymentSheet:
cardBrandAcceptance: {
filter: CardBrandAcceptanceFilter.Allowed,
brands: [CardBrandCategory.Visa, CardBrandCategory.Mastercard],
},
With this configuration enabled, the saved Visa card no longer appears in the Payment Sheet. However, once the configuration is removed, the saved card reappears and can be used normally.
This suggests that the filter is incorrectly excluding saved cards, even when they match the allowed brand criteria.
Expected behavior
If a saved customer card matches the filter criteria (e.g., Visa or Mastercard), the Payment Sheet should still display it in the payment method selection UI.
Steps to reproduce
- Save a Visa card to a customer profile.
- Initialise the Payment Sheet with the cardBrandAcceptance filter set to allow only Visa and Mastercard.
- Open the Payment Sheet.
- Observe that the saved Visa card is ignored and payment sheet shows Add card UI
- Remove the filter configuration.
- Open the Payment Sheet again.
- Observe that the saved Visa card now appears.
Smartphone (please complete the following information):
- Device: All
- OS: All
- Version: All
Additional information
🕵🏻♂️ Although, if the cardBrandAcceptance configuration is set to disallow the listed brand categories. The flow matches the expected outcome.
cardBrandAcceptance: {
filter: CardBrandAcceptanceFilter.Disallowed,
brands: [CardBrandCategory.Amex, CardBrandCategory.Discover],
},