#Yahav-createToken

1 messages ยท Page 1 of 1 (latest)

naive pecan
#

Hey! How can I help?

tawdry vortex
#

Hello again

#

here is a ref id for example: tok_1K1t7VCP35cg5M9Nb067KCGK
can you take a look? is this request body ok if I want to provide zip_code?

naive pecan
#

Yep, address_zip is the correct parameter

tawdry vortex
#

is this ok that this parameter is inside the "card" object?

#

in term of better authorizations on stripe side

naive pecan
#

Is this collected via an Element?

tawdry vortex
#

hmm what do you mean by collcted?

naive pecan
#

How are you collecting/capturing the payment data?

tawdry vortex
#

on my end I make the following api request:
this.stripe.createToken(elem, data);
Where elem is the StripeElement and the data is an object with address_zip attribute in it

#

the payment data is located inside the StripeElement ofc yeah but the zipCode is inside the "data" object, the optional object

naive pecan
tawdry vortex
#

so its ok that inside the request body, the card object contains the data from the optional data object?

#

"card": {
"address_zip": "64155",
"number": "*********4242",
"cvc": "
",
"exp_month": "02",
"exp_year": "42"
},
like that

naive pecan
#

Yep, Stripe.js is taking care of that

tawdry vortex
#

I see, it does some kind of merging between the StripeElement and the data object?

naive pecan
#

Yeah it's basically changing the shape of the body to what the API expects

#

But then Stripe.js has a nicer API for end users ๐Ÿ™‚

tawdry vortex
#

Thank you once again ๐Ÿ™‚

#

have a great day