#development

1 messages · Page 1 of 1 (latest)

bright roverBOT
ruby plover
#

hello! i don't understand the question - based on your previous thread - The Stripe PaymentSheet isn't opening. We pointed out that the error code you shared comes usually when the presentPaymentSheet is called before initPaymentSheet - have you tried adding logs to check if this is this case?

fast steeple
#

yes

#

initpayementsheet is inisialized before calling presentpayment sheet

#

{id: pi_3MirOGKo2grgSU3G1H7a4iuV, object: payment_intent, amount: 4000, amount_capturable: 0, amount_details: {tip: {}}, amount_received: 0, application: null, application_fee_amount: 120, automatic_payment_methods: null, canceled_at: null, cancellation_reason: null, capture_method: automatic, charges: {object: list, data: [], has_more: false, total_count: 0, url: /v1/charges?payment_intent=pi_3MirOGKo2grgSU3G1H7a4iuV}, client_secret: pi_3MirOGKo2grgSU3G1H7a4iuV_secret_2sonYAtQKZqoWWPojX7sOwZBN, confirmation_method: automatic, created: 1678160440, currency: aud, customer: cus_NTp2boB7aYotgR, description: null, invoice: null, last_payment_error: null, latest_charge: null, livemode: true, metadata: {}, next_action: null, on_behalf_of: null, payment_method: null, payment_method_options: {card: {installments: null, mandate_options: null, network: null, request_three_d_secure: automatic}}, payment_method_types: [card], processing: null, receipt_email: test@yopmail.com, review: null, setup_future_usage: null, shipping: null, source: null, statement_descriptor: null, statement_descriptor_suffix: null, status: requires_payment_method, transfer_data: {destination: acct_1LluMl4IlGGPnC5Q}, transfer_group: null}

#

this is the payment intent response

ruby plover
#

did you change your code since you last discussed it with us?

await Stripe.instance.initPaymentSheet(
        paymentSheetParameters: SetupPaymentSheetParameters(
            //client_secret
            paymentIntentClientSecret: paymentIntentData!['client_secret'],
            merchantDisplayName: UserDetails.userName == ''
                ? bookingUserName
                : UserDetails.userName,
            customerId: paymentIntentData!['customer'],
            customerEphemeralKeySecret: paymentIntentData!['ephemeralKey'],
            customFlow: true,
            style: ThemeMode.light,
            testEnv: true,
            applePay: true,
            googlePay: true),
      );

      await Stripe.instance.presentPaymentSheet();
      await Stripe.instance.confirmPaymentSheetPayment();
#

and you're still receiving this error message right?

fast steeple
#

yes

worn ocean
#

Hi @fast steeple did you get any error after running initPaymentSheet ?

fast steeple
#

no

#

it ran perfectly

worn ocean
#

Can you check if you are returning the ephemeralKey secret instead of the ephemeralKey ID ?

fast steeple
#

@worn ocean in paymentintent ?

#

i didn't get ephemeralKey secret and ephemeralKey id in payment intent

worn ocean
#

But you are passing one in your code customerEphemeralKeySecret: paymentIntentData!['ephemeralKey'],

fast steeple
#

yes

#

but i didn't saw any ephemeralKey

how can i get it

worn ocean
fast steeple
#

i was created by my self

worn ocean
#

If you are not using ephemeralKey, you can just remove customerEphemeralKeySecret from your code.

fast steeple
#

still didnt get the payment sheet

worn ocean
#

I'd suggest to double check and sure all the params that you pass to initPaymentSheet are valid before calling it.

fast steeple
#

yes i check 5 times

#

becuase if i didnt put apple pay true its totally working fine

#

and payment also got successfully done

worn ocean
fast steeple
#

Can you have any other solution