Home > Software engineering >  In Stripe Payment Gateway integration, when implementing SetupPaymentSheetParameters(), googlePay an
In Stripe Payment Gateway integration, when implementing SetupPaymentSheetParameters(), googlePay an

Time:01-11

I am trying to integrate Stipe Payment Gateway and when I am using SetupPaymentSheetParameters() for card payment then GooglePay and ApplePay is not taking the boolean value, Showing error 'The argument type 'bool' can't be assigned to the parameter type 'PaymentSheetApplePay?'.

void makePayment() async{
    //create payment intent
    //init payment Sheet
    //display payment sheet
    paymentIntentData=await createPaymentIntent();
    await Stripe.instance.initPaymentSheet(
      paymentSheetParameters:SetupPaymentSheetParameters(
        paymentIntentClientSecret:paymentIntentData!['client_secret'],
        applePay: true,
        googlePay: true;
        testEnv: true;
        merchantDisplayName: 'ANNIE';
      )
    );
  }

CodePudding user response:

These two params are not of boolean value.

You can refer to the example code and see how to configure applePay and googlePay params.

CodePudding user response:

applePay accepts PaymentSheetApplePay type whereas googlePay accepts PaymentSheetGooglePay type.

You may refer to the example code for applePay and googlePay to initPaymentSheet here.

  • Related