#mike.v2

1 messages · Page 1 of 1 (latest)

fair ivyBOT
uncut moat
#

Specifically where do you need to set metadata? On the Setup Intent?

bold mango
#

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

uncut moat
#

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)

bold mango
#

But the stripe javascript library is able to do so client side

#

?

uncut moat
#

Can do what client-side?

bold mango
#

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,
                },
uncut moat
bold mango
#

metadata

uncut moat
bold mango
#

@stripe/react-stripe-js

uncut moat
#

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?

bold mango
#

seti_1MH3HVAIEGRSPHp6cf5Lqi95

uncut moat
#

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

bold mango
#

right but confirmSetupIntent on Stripe React Native has a paymentMethod object

#

and thats where I want to add metadata

#

like so

uncut moat
#

Ok, cool. That wasn't clear from your original messages

#

Let me see

bold mango
#

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?

uncut moat
#

I think updating the PM server-side after confirmation is likely the only option right now

bold mango
#

We still need to communicate the metadata to our server

#

Is the payment method ID returned from confirmSetupIntent ?

uncut moat
#

paymentMethodId

bold mango
#

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

uncut moat
#

I'd recommend bumping that issue too (if you haven't already) and I can nudge the responsible team internally

bold mango
#

The feature request as well, but I'll leave that up to you decide

#

Thanks

uncut moat
#

np