#Yahav-createToken
1 messages ยท Page 1 of 1 (latest)
Hello again
I have a question about the createToken request, what is the expected body when I'm sending additional data (data) as described here: https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement
Complete reference documentation for the Stripe JavaScript SDK.
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?
Yep, address_zip is the correct parameter
is this ok that this parameter is inside the "card" object?
in term of better authorizations on stripe side
Is this collected via an Element?
hmm what do you mean by collcted?
How are you collecting/capturing the payment data?
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
Yep, that sounds perfect then: https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement
Complete reference documentation for the Stripe JavaScript SDK.
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
Yep, Stripe.js is taking care of that
I see, it does some kind of merging between the StripeElement and the data object?