Skip to content

cardBrandAcceptance with Allowed filter, bypasses 'Select payment method' within the payment sheet #2093

@realkrutosh

Description

@realkrutosh

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

  1. Save a Visa card to a customer profile.
  2. Initialise the Payment Sheet with the cardBrandAcceptance filter set to allow only Visa and Mastercard.
  3. Open the Payment Sheet.
  4. Observe that the saved Visa card is ignored and payment sheet shows Add card UI
  5. Remove the filter configuration.
  6. Open the Payment Sheet again.
  7. 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],
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions