#carson - PRB with Shipping
1 messages · Page 1 of 1 (latest)
Hi 👋
Can you share a payment intent ID for a payment where the user provided shipping info?
right now im just creating a setup intent that will get captured shortly after
but here's the customer with the payment method captured cus_MET2FzTm6v8d01
basically for our use case, im creating a setup intent on the front end, and then the backend makes the payment intent
right now im just testing the front end piece
In the doc on requestShipping we point out that the address will appear in the PaymentReponse. So this is only going to be available in JavaScript and likely only with Payments.
https://stripe.com/docs/js/payment_request/create#stripe_payment_request-options-requestShipping
ah, i see
so setupintents cant capture this type of data?
and i can't send through shipping options as a key in a language like php? only on the front end in JS?
This feature of the payment request button returns the shipping address info back to the client because it isn't passed to Stripe by the digital wallets AFAIK. So Stripe doesn't have access to it on our servers. You need to capture it on the client. You can pass it back to your server and make the API calls to Stripe to update the customer from there.
ok cool, so i should listen for that shippingaddresschange to capture? or is it part of the success response?
Nope. Returning the shipping info as part of the Payment Response is necessary because, once the digital wallet modal loads, Stripe.JS has no access to what the user enters there.
so you're saying i should listen to shippingaddresschange? because if im creating a setupintent, i don't get any of that info as the response
What shippingaddresschange? Is this a JS event? A Stripe event?
scroll down a little bit on that section
Okay, JS event. yes that is how you should approach collecting this information. Then you can pass it back to your server and associate it with the user.
awesome, thanks so much for your fast responses and help!