#Jed-setupintent-RN
1 messages ยท Page 1 of 1 (latest)
hi there
Hi there!
So to rephrase, you are having a hard time collecting billing details with a SetupIntent via React Native?
Got it! Can you share your confrimSetupIntent() code snippet?
let address = {
city: "Ormond Beach",
county: "Velusia",
line1: "1167 Ocean Shore Blvd",
line2: "",
postalCode: "32176",
state: "FL",
}
let billingDetails = {
email: "test@stripe.com",
phone: "7173078094",
name: "Jared",
address: address,
}
const {setupIntent, error} = await confirmSetupIntent(responseData.client_secret, {
// billingDetails: {
// address: {
// city: userCity,
// line1: userStreet,
// // postalCode: zipCode,
// state: userState.value,
// },
// name: fullName,
// },
billingDetails,
type: 'Card',
});
I was testing with dummy data
sorry for bad formatting, I dont know how to code snippit in this
No worries! Using three backticks ` allows you to format a code snippet
cool!
Just for the future ๐
This is fine for now
I don't remember correct syntax here top of head so looking!
Give me a sec
take your time
Ah I think you need billingDetails: billingDetails.
Instead of just passing the object, you need to pass the param and the object
ahhh
let me try that
still coming back as null for address fields
I know I should be using stripe dash to check, sorry
but they havent added me to right one yet
this is our response from api that gets card data
yes
It honestly looks fine to me above... ๐ค
Also would recommend changing a few values each time just to make sure you are getting the right response back
ok
const {setupIntent, error} = await confirmSetupIntent(responseData.client_secret, {
// billingDetails: {
// address: {
// city: userCity,
// line1: userStreet,
// // postalCode: zipCode,
// state: userState.value,
// },
// name: fullName,
// },
billingDetails: {
email: "test@stripe.com",
phone: "7173078094",
name: "Jared",
address: {
city: "Ormond Beach",
county: "Velusia",
line1: "1167 Ocean Shore Blvd",
line2: "",
postalCode: "32176",
state: "FL",
},
},
type: 'Card',
});
still all nulls for address info, except Zip, it uses what I put in cardField
What version of RN SDK are you on?
I'm not seeing anything in the Changelog that it should matter, but mind updating to the most recent and testing again? I'll also set up a repro on my side to see if this is a bug.
Yep
Feel free to provide me a SetupIntent ID that you have tested with as well
Sure that works, thanks!
trying with new version, just gotta get expo app to strart
Thanks!
same thing with version 0.5.0 apparently
sure
Im noticing that the address interface asks for "county" field but in response in log section it has "country"
you see that?
Yes good catch!
We don't collect county for paymentmethods in our API so that is definitely a bug.
interesting
But I don't think that is actually the root issue here.
I think the billing details are just overwritten by your Card component
so I need to use a different stripe component or something to collect details?
Not necessarily
thanks for looking into this for me
Of course. I'm doing some testing to see if there is a good workaround here
And I'll file a ticket with feedback internally after we finish up
great, really appreciate it
Ah I think I may have figured it out
yes?
One sec let me test to confirm!
What props do you have on your Card component? Can you try setting postalCodeEnabled={false}
postalCodeEnabled={true}
placeholder={{
number: '4242 4242 4242 4242',
}}
cardStyle={{
borderWidth: 1,
borderColor: "#e4e9f2",
backgroundColor: '#f7f9fc',
textColor: '#000000',
borderRadius: 4,
placeholderColor: '#8f9bb3',
fontSize: 15,
}}
style={reduxLoader || defaultLoader ? styles.invisible : styles.stripeCard}
onCardChange={(cardDetails) => {
setCard(cardDetails);
}}
onFocus={(focusedField) => {
console.log('focusField', focusedField);
}}
/>```
sure let me try that
Hmmm my test still isn't working for that... though really that is the issue.
Let me know what happens on your end.
Okay so yeah... this is the key as it is how it works with Elements. We override your Billing Details if you are collecting Postal Code, but you can set them yourself if you disable Postal Code collection.
However, it looks like we aren't respecting this in the RN SDK
So I'll need to file a bug report to get that fixed. But really you are doing everything right and we should allow you to input those Billing Details as you desire if you disable postalCode collection
I see
okay, I understand thanks for doing that research
is there another api I could use to update the card details perhaps?
like make a second call to that one
Yep you can certainly update them from the backend via: https://stripe.com/docs/api/payment_methods/update
That will likely be the best thing to do here until this is fixed.
alrighty, thanks so much for your help bismarck, really appreciate it
Thanks for reporting this!
my pleasure. have a good one!
You too!
@junior silo are you still around?
yes
So turns out I was wrong, and this isn't a bug
The bug was in my brain
In how I was reading our SDK reference ๐
okay cool
The actual address params are here: https://github.com/stripe/stripe-react-native/blob/0dd668f/src/types/PaymentMethods.ts#L41
So you want to disable postalCode and input addressLine1 etc.
ah okay awesome
I tested and that is working fine for me. Feel free to let me know if the same doesn't hold for you when you get around to testing it out.
Wahoo
Sorry for missing that previously