Google Pay button is not displayed on the stripe's payment sheet

1,694

as @Romeo said in the comments above, Google pay button was displayed when gPay app is installed and there is at least one card available on it. I was using separate google pay button on my app using pay plugin and it was displayed along with google pay sheet so i figured it should be shown on stripe's payment sheet as well.

Share:
1,694
joe_inz
Author by

joe_inz

Updated on December 31, 2022

Comments

  • joe_inz
    joe_inz over 1 year

    Description

    Using flutter_stripe package, version ^1.2.0, to perform payment on the front end, Google pay button wasn't displayed on the paymentSheet despite setting the flag googlePay: true in SetupPaymentSheetParameters while initializing the payment sheet using Stripe.instance.initPaymentSheet().
    The examples project of the package doesn't provide information about configuring google pay in payment sheet other than setting the flag to true, so i followed these instructions form stripe's documentations to integrate google pay but the button still not displayed on the sheet.

    My Code

    • stripe initialization
        Stripe.publishableKey = dotenv.env['STRIPE_PUB_KEY'];
        Stripe.instance.applySettings();
    
    • payment sheet methods
      Future<void> initializePaymentSheet(
        PaymentCredentials credentials,
      ) async {
        Stripe.instance.initPaymentSheet(
          paymentSheetParameters: SetupPaymentSheetParameters(
            applePay: Stripe.instance.isApplePaySupported.value,
            googlePay: true,
            style: ThemeMode.dark,
            testEnv: true,
            merchantCountryCode: 'USA',
            merchantDisplayName: 'Our App. Inc.',
            customerId: credentials.clientId,
            paymentIntentClientSecret: credentials.paymentIntent,
            customerEphemeralKeySecret: credentials.eKey,
            customFlow: false,
          ),
        );
      }
    
      Future<void> presentPaymentSheet(String paymentIntent) async =>
          Stripe.instance.presentPaymentSheet(
            parameters: PresentPaymentSheetParameters(
              clientSecret: paymentIntent,
              confirmPayment: true,
            ),
          );
    
    

    What is missing to display this button on the sheet?

    • OMi Shah
      OMi Shah almost 3 years
      Read this prerequisite stripe.com/docs/google-pay
    • Romeo
      Romeo over 2 years
      It works for me with google pay installed and a credit card added to google pay.