#Jed-setupintent-RN

1 messages ยท Page 1 of 1 (latest)

fallen oracle
junior silo
#

hi there

fallen oracle
#

Hi there!

junior silo
#

ditto

#

or jynx lol

#

sry, go ahead

fallen oracle
#

So to rephrase, you are having a hard time collecting billing details with a SetupIntent via React Native?

junior silo
#

correct

#

just the address part though

fallen oracle
#

Got it! Can you share your confrimSetupIntent() code snippet?

junior silo
#

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

fallen oracle
#

No worries! Using three backticks ` allows you to format a code snippet

junior silo
#

cool!

fallen oracle
#

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

junior silo
#

take your time

fallen oracle
#

Ah I think you need billingDetails: billingDetails.

#

Instead of just passing the object, you need to pass the param and the object

junior silo
#

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

fallen oracle
#

Hrmm

#

Can you hard code the address within the address param and try that?

junior silo
#

yes

fallen oracle
#

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

junior silo
#

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

fallen oracle
#

What version of RN SDK are you on?

junior silo
fallen oracle
#

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.

junior silo
#

sure

#

0.5 right?

fallen oracle
#

Yep

junior silo
#

ok

#

looks like I just got access to our dashboard, so that's good

fallen oracle
#

Feel free to provide me a SetupIntent ID that you have tested with as well

junior silo
#

okay

#

pm_1KlLiJHbycqDImnMzhvO29Qu

#

like that?

fallen oracle
#

Sure that works, thanks!

junior silo
#

trying with new version, just gotta get expo app to strart

fallen oracle
#

Thanks!

junior silo
#

same thing with version 0.5.0 apparently

fallen oracle
#

Thanks for testing.

#

Give me a few minutes to do some digging

junior silo
#

sure

#

Im noticing that the address interface asks for "county" field but in response in log section it has "country"

#

you see that?

fallen oracle
#

Yes good catch!

#

We don't collect county for paymentmethods in our API so that is definitely a bug.

junior silo
#

interesting

fallen oracle
#

But I don't think that is actually the root issue here.

#

I think the billing details are just overwritten by your Card component

junior silo
#

so I need to use a different stripe component or something to collect details?

fallen oracle
#

Not necessarily

junior silo
#

thanks for looking into this for me

fallen oracle
#

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

junior silo
#

great, really appreciate it

fallen oracle
#

Ah I think I may have figured it out

junior silo
#

yes?

fallen oracle
#

One sec let me test to confirm!

#

What props do you have on your Card component? Can you try setting postalCodeEnabled={false}

junior silo
#
                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

fallen oracle
#

Hmmm my test still isn't working for that... though really that is the issue.

#

Let me know what happens on your end.

junior silo
#

yeah no dice

#

now postal code is null as well

#

that's it

fallen oracle
#

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

junior silo
#

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

fallen oracle
#

That will likely be the best thing to do here until this is fixed.

junior silo
#

alrighty, thanks so much for your help bismarck, really appreciate it

fallen oracle
#

Thanks for reporting this!

junior silo
#

my pleasure. have a good one!

fallen oracle
#

You too!

fallen oracle
#

@junior silo are you still around?

junior silo
#

yes

fallen oracle
#

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 ๐Ÿ™‚

junior silo
#

okay cool

fallen oracle
#

So you want to disable postalCode and input addressLine1 etc.

junior silo
#

ah okay awesome

fallen oracle
#

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.

junior silo
#

okay, I will test rn

#

looks like that did it

#

thanks for pinging me

fallen oracle
#

Wahoo

junior silo
#

saved me a good bit of work haha

#

which I was just about to get started doing

fallen oracle
#

Sorry for missing that previously