Skip to content
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

CustomerSheetResult has a null payment method when selecting Apple/Google Pay option #1885

Open
nayanbabariya opened this issue Aug 7, 2024 · 1 comment
Labels
needs triage Needs triage

Comments

@nayanbabariya
Copy link

nayanbabariya commented Aug 7, 2024

Describe the bug

We have the option to manage payment methods using a customer sheet. I am opening it using the below code:

Reproducible code

  • Flutter version: 3.24.0
  • flutter_stripe: ^11.0.0
// Before runApp()
Stripe.publishableKey = Environment.stripePublishableKey;
Stripe.merchantIdentifier = 'My Merchant identifier';
Stripe.urlScheme = 'flutterstripe';
await Stripe.instance.applySettings();
// I receive the `setupIntent` object from my backend API call.
await Stripe.instance.initCustomerSheet(
      customerSheetInitParams: CustomerSheetInitParams(
        merchantDisplayName: 'My App Name',
        returnURL: returnURL,
        customerId: setupIntent.customerId,
        setupIntentClientSecret: setupIntent.setupIntent,
        customerEphemeralKeySecret: setupIntent.ephemeralKey,
        defaultBillingDetails: billingDetails,
        billingDetailsCollectionConfiguration:
            billingDetailsCollectionConfiguration,
        style: themeMode,
        appearance: appearance,
        allowsRemovalOfLastSavedPaymentMethod: false,
      ),
    );

try {
      // This is the method that opens the customer sheet.
      final result = await stripe.presentCustomerSheet();
      log('Customer sheet result =====> ${result?.toJson()}');
    } on StripeException catch (e) {
      log(e.toString(), name: 'Stripe Exception');
    }

Logs

When selecting Google Pay in Android

Screenshot_20240807-113449

[log] Customer sheet result =====> 
{paymentOption: {label: Google Pay, image: byteImageString}, paymentMethod: null, error: null}

When selecting Apple Pay in iOS

Image_20240807_71710_674 a m

[log] Customer sheet result =====> 
{paymentOption: {label: Apple Pay, image: byteImageString}, paymentMethod: null, error: null}

Expected behavior

It should return the payment method object the same as when I select the other test card.

  • When I select the other test card:
[log] Customer sheet result =====> 
{paymentOption: {label: ••••1117, image: byteImageString}, 
paymentMethod: {id: pm_1PkmZYIHwnvciW2rKGGl5e9u, livemode: false, paymentMethodType: Card,
billingDetails: {email: my_email, address: Address(city: My city name, country: IN, line1: line1 address, line2: , postalCode: 992345, state: state name), phone: null, name: My name},
Card: {brand: Discover, country: US, expYear: 2026, expMonth: 9, funding: credit, last4: 1117, preferredNetwork: null, availableNetworks: [discover], threeDSecureUsage: {isSupported: true}},
SepaDebit: {country: null, bankCode: null, fingerprint: null, last4: null},
BacsDebit: {sortCode: null, fingerprint: null, last4: null},
AuBecsDebit: {fingerprint: null, last4: null, bsbNumber: null},
Sofort: {country: null}, Ideal: {bankIdentifierCode: , bank: null},
Fpx: {bank: , accountHolderType: null}, Upi: {vpa: null},
USBankAccount: {routingNumber: null, last4: null, accountHolderType: Unknown, accountType: Unknown, bankName: null, fingerprint: null, linkedAccount: null, preferredNetwork: null, supportedNetworks: null},
customerId: cus_eqw786q87eq}, error: null}

Device Information

  • OnePlus 6T - Android 11
  • iPhone 7 - iOS 15.8.2
@nayanbabariya nayanbabariya added the needs triage Needs triage label Aug 7, 2024
@mihiravdevs
Copy link

mihiravdevs commented Aug 31, 2024

@nayanbabariya
#1897
Google pay button is not visible on stripe paymentsheet.

I am facing above issue could you please help me on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Needs triage
Projects
None yet
Development

No branches or pull requests

2 participants