#mike.v2
1 messages · Page 1 of 1 (latest)
Specifically where do you need to set metadata? On the Setup Intent?
correct
const cardSetupData = {
payment_method: {
card: cardNumberElement,
billing_details: {
name: cardholderName,
address: {
line1: billingAddress1,
line2: billingAddress2,
postal_code: zip,
state: state,
city: city,
country: 'US', // not accepting int'l payments yet
},
email: me?.email,
phone: me?.phoneNumber,
},
metadata: {
nickname: cardNickname,
applicant_id: me?.id,
},
},
};
const stripeResponse = await stripe.confirmCardSetup(clientSecret, cardSetupData);
This is our "web" variant
as you can see we use metadata to submit a nickname
and the applicant_id
crucial info for us
but I can't find in the Stripe React Native variant how to do this
Yeah you can't set metadata during client-side confirmation, you'd need to do that with your secret keys server-side (during creation, or a subsequent update)
Can do what client-side?
Stripe Javascript SDK, not the Stripe React Native SDK you can submit metadata client side
so why is React Native SDK not able to do so?
see the code above
metadata: {
nickname: cardNickname,
applicant_id: me?.id,
},
With Stripe.js? I don't believe you can: https://stripe.com/docs/js/setup_intents/confirm_setup
Hmm, not sure those types are being pulled from our library: https://github.com/stripe/stripe-js/blob/master/types/stripe-js/setup-intents.d.ts
Can you share a confirmation API request that includes the metadata parameter in the payload?
@stripe/react-stripe-js
There's no types for confirmation functions in the React lib, just Elements. The types for confimSetup come from Stripe.js as I shared
Please, yep! I don't think this works based on docs and our libs, yet you claim it does
I may be wrong, just trying to understand the issue so I can help
Can you paste that seti_xxx ID?
seti_1MH3HVAIEGRSPHp6cf5Lqi95
Well, that's a different param. That's metadata on the PM object, not the Setup Intent directly
Which is not what you asked for
right but confirmSetupIntent on Stripe React Native has a paymentMethod object
and thats where I want to add metadata
like so
Ok, cool. That wasn't clear from your original messages
Let me see
Yeah, I guess this isn't supported right now: https://stripe.dev/stripe-react-native/api-reference/modules/PaymentMethod.html#CardParams
Documentation for @stripe/stripe-react-native
I'd open an issue on the repo: https://github.com/stripe/stripe-react-native/issues
shit ok
cause how can we work around this for now?
this would mean we have to setup another endpoint, so our server can set the metadata?
I think updating the PM server-side after confirmation is likely the only option right now
We still need to communicate the metadata to our server
Is the payment method ID returned from confirmSetupIntent ?
Seems so, yep: https://stripe.dev/stripe-react-native/api-reference/interfaces/SetupIntent.Result.html
Documentation for @stripe/stripe-react-native
paymentMethodId
On another note, there's another breaking issue with the Stripe react native SDK, and I was wondering if we can except any dev support on it:
Thanks for your help btw, this is helpful for sure
@uncut moat any idea? Just asking because I see a bunch of issues that haven't been responded too for a while
I'd recommend bumping that issue too (if you haven't already) and I can nudge the responsible team internally
It would be great if you can nudge the team about this one: https://github.com/stripe/stripe-react-native/issues/1241
The feature request as well, but I'll leave that up to you decide
Thanks
np