#__rob1986__
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- rob-products, 6 days ago, 4 messages
Hi 👋 if that value was set for the intent, it will be in the customer field within the Payment Intent object included in data.object within the Event you receive:
https://stripe.com/docs/api/events/object#event_object-data-object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
this is a result of a stripe checkout page payment
ah wait, i can tell the api call where i pass the product ids to pay for to set it to include the customer id?
When you say "checkout page" is that a Checkout Session that you had created? If so, yes, you can provide the ID of an existing Customer when creating that session:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Correct, checkout session. Thats the issue, i want to do that, but i am struggling to find the customer id within the data sent in the payment.intent_succeeded event webhook.
i plan on saving the customer id against the user in my database
so for the first transaction, the customer id is created, but subsequent ones are to include the customer id
Can you elaborate? Do you already have a Customer ID that you're trying to use for the Checkout Session, or are you expecting the Checkout Session to create a Customer for you?
So a new user adds a product to my cart, they then go to a stripe checkout session, they pay and stripe creates the customer id, i want to save this against the user.
They then make a second purchase, i pass the customer id as i now have it available to use
i am struggling to find the customer id in order to save it in that first purchase
Do you have the ID of an Event (evt_) from a first payment from your testing that you can share here?
evt_3Ohvil2irv3PMEuH0pT6L4d6
Thank you, taking a look
You're using Checkout Sessions with a mode of payment, those don't create Customers by default. You'll want to set customer_creation to always for Checkout Sessions where you aren't providing the ID of an existing Customer:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer_creation
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.