#jarcher

1 messages · Page 1 of 1 (latest)

frosty waspBOT
sudden knot
#

Can you share the code you used here?

potent crane
#

yeah but is that the SDK that's doing that? cuz we're not updating it

sudden knot
#

You still confirm the PI in your code

#

Can you share that code

potent crane
#

Yeah here's the code on the frontend:

#
const { initPaymentSheet, presentPaymentSheet } = useStripe();


const onSubmit = () => {
               const { customerId, ephemeralKey, clientSecret } = await getCheckout(stuff);

                const initResp = await initPaymentSheet({
                    customerId,
                    ephemeralKey,
                    clientSecret,
                });

                if (initResp.error) {
                    console.error(initResp.error);
                    return;
                }

                const presentResp = await presentPaymentSheet();

                if (presentResp.error) {
                    setReserveInProgress(false);
                    if (presentResp.error.code === "Canceled") return;
                    Alert.alert(
                        presentResp.error.localizedMessage ||
                            presentResp.error.message
                    );
                    return;
                }

// stuff
}```
sudden knot
#

Gotcha so you're confirming directly in the payment sheet

#

ie you enver call await confirmPaymentSheetPayment(); ?

potent crane
#

it's from my understanding that presentPaymentSheet does the confirmation

#

and if there's an error in presentPaymentSheet then we display the error (Alert.alert)

#

the error from presentPaymentSheet is the When setup_future_usage is set to off_session with a secret key, you can only update setup_future_usage to off_session using a publishable key.

sudden knot
#

Got it cool

#

Ok looking into the error

potent crane
#

thank you!

sudden knot
#

What version of the react native sdk are you using?

potent crane
#

"@stripe/stripe-react-native": "^0.26.0", 😬

#

would 0.30 fix this ?

sudden knot
#

Hm that's not too old

#

There've been some bug fixes since then. Recommend trying latest version though

#

let me know if that doesn't fix the issue though

potent crane
#

okay will try it out