#tonz18
1 messages · Page 1 of 1 (latest)
👋 happy to help
have you used this https://stripe.com/docs/stripe-js/elements/payment-request-button?client=react#react-collecting-shipping-info to collect shipping?
yes i have requestShipping: true but on server-side what is best way to get the shipping address?
or can we only collect via client-side?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Shipping returns null even though I can see shipping in dashboard.
would you mind sharing the PaymentIntent ID?
pi_3MZBWLE6MnzWAfRF1X1Lk7Uo
taking a look
thanks
sorry for keeping you waiting
all good, any results?
I was mistaken to assume that the shipping info would be automatically updated
haha same here
you would have to collect that info on the front-end by listening to the shippingaddresschange event
ohh, what about via webhook would shipping details come through there?
no not even
ohh very stange as the payment intent is already created before it pops up and my server doesnt do anything until payment is successful
Thanks for your help tho
yes you have a way of adding the shipping address on the front-end side
before the PI is confirmed
with the paymentmethod event
yeah will work something out but a extra call to the server tho
something like
...
let shipping = paymentResponse.shippingAddress
stripe.confirmCardPayment(secret, {shipping: {.... /* pull fields from `shipping` and pass into this hash */}})
...
})```
no, no need
this all happens on the front-end side
paymentRequest.on('paymentmethod'
does that include the shipping?
yes paymentResponse does have the shippingAddress
ohh yes I see it now
let me know if you need any more help
can that shipping address ever change after paymentResponse
eg if requiring 3d
or paymentIntent.status === "requires_action" can user return and change address
we're speaking about PRB here so Google/Apple Pay and Link
yeah
the paymentmethod event happens after the customer is done interacting with the browser’s payment interface.
the paymentmethod happens before stripe.confirmCardPayment correct?
yes
so it would be safe to assume that paymentIntent.status === "requires_action" would only happen when there is a failed payment then as it PRB