#jarcher

1 messages · Page 1 of 1 (latest)

magic kindleBOT
thorn coyote
#

I tried updating to React Native 0.30 and that didnt work

civic stag
#

Not sure if that answers your question though

thorn coyote
#

I know that -- but it seems like the RN showPaymentSheet is trying to modify the setup_future_usage

#

we're not intentionally changing the setup_future_usage -- maybe the RN sdk does that with existing payment methods?

civic stag
#

Hmmm, that's interesting. I'm not sure why it would do that automatically. Do you have the code you're running to make that API request?

thorn coyote
#

this is 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
}```

magic kindleBOT
unique parcel
#

Hello! I'm taking over and catching up...

thorn coyote
#

Thanks @unique parcel

unique parcel
#

Huh, interesting. Is this something you can reproduce on demand or did one of your customers hit this?

thorn coyote
#

We can reproduce it now

#

it's a payment intent created with setup_future_usage: "off_session" (we do this always by default) then we pass the customerId, ephemeralKey, and clientSecret to the payment sheet (code above) and it fails with an existing payment method

unique parcel
#

Does it happen every time or are there specific steps you need to take to make it happen?

thorn coyote
#

works just fine when you use a new payment method

#

so the "specific steps" are :

#
  1. off_session save payment 2) react native v0.30.0 3) existing payment method
unique parcel
#

Is this a new issue with v0.30.0? Did this start after you upgraded?

thorn coyote
#

it was an issue on v0.26.0 so we tried upgradeing to v0.30 (someone else at stripe suggested it [thread here #dev-help message]).

unique parcel
#

Ah, I think I found details about this internally, hang on...

#

Yep, okay, this is a known issue in the underlying iOS SDK that doesn't seem to have been addressed yet. As a workaround you can set setup_future_usage to off_session at the top level of the Payment Intent when you create it server-side instead of setting it in payment_method_options.

#

@thorn coyote Will that workaround work for you?

thorn coyote
#

sorry just seeing this

#

@unique parcel this could work. what do we do about 3DS payments?

#

This is what we use now: payment_intent_data.payment_method_options = { card: { request_three_d_secure: "automatic", setup_future_usage: "off_session", }, };

unique parcel
#

You can keep that part there, just move setup_future_usage.

thorn coyote
#

@unique parcel that worked! Thanks for your help!