#haktar
1 messages ยท Page 1 of 1 (latest)
Hi ๐ if you already have customer details available when creating the Payment Element, you can provide those in defaultValues.billingDetails:
https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-defaultValues
Hey Toby, thank you for that, we do have the details, I've tried the below but didn't have any joy, I guess I'm missing something
You're trying to pass postal_code as a base level option, which isn't the right structure. It's nested in billingDetails.defaultValues.address
Also pulling your other question into the thread:
Also curious how to pass the order ID, haven't seen that in the documentation
Can you elaborate on what you mean there?
Ahh I see I'll look into that further thank you
We're switching form a worldpay gateway which we could pass the order ID that would be returned on the webhook
The order ID being the ID our system applies to the basket
Hm, if you need to pass data along with Stripe objects, that isn't directly related to Stripe processing payments, that's typically best achieved by using metadata. Most of our objects support it, and within it you can provide string key/value pairs to hold data that is important to your flows.
https://stripe.com/docs/api/metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ideal thank you for your help I'll look into both of these
Have sorted pre-filling the email/address thank you for your help Tom
Would there be a recommended way to tie a transaction to an order rather than passing the order ID through?
Not that I'm aware of, but I'm happy to help think through that more if you have concerns or additional context around the question.
Our system is set up for the old gateway so we create an order and when we receive the webhook it contains the order ID which we then mark as successful, send out the emails etc
Not seeing an obvious way to do that here
I'm sorry, but that's pretty vague, which makes it hard to map that to a recommendation. In general, it sounds like you want to provide a non-Stripe ID along with a Stripe object so it makes it to your webhook endpoints. Using metadata is going to be the best way to do that.
That is how we normally do it. I'm just wondering if there is a way to tie them together before that point, when we create the payment intent and receive the client secret, can we receive anything at that point that we can log that will later be received in the webhook?
We just have to be able to map the order to the transaction either before it's placed or after, I hope that makes sense
Depends on the type of Events your webhook endpoint is listening for. If you're listening for payment intent related Events, then those will contain the Payment Intent object in them, so you could reference its ID.
Just the success payment intent so far, I think that will do the trick, thanks again for your advice, I apprecaite it
Have a good weekend