#__rob1986__

1 messages · Page 1 of 1 (latest)

past anvilBOT
#

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.

unique tree
toxic pawn
#

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?

unique tree
toxic pawn
#

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

unique tree
#

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?

toxic pawn
#

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

unique tree
#

Do you have the ID of an Event (evt_) from a first payment from your testing that you can share here?

toxic pawn
#

evt_3Ohvil2irv3PMEuH0pT6L4d6

unique tree
#

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

toxic pawn
#

aaaahhh!! i see...

#

thanks so much toby!