#JCoDog - Checkout Customer Creation

1 messages ยท Page 1 of 1 (latest)

civic spruce
prisma mountain
#

Yes the issue is that I need the user's ID from their session that is only available in the checkout creation stage for obvious reasons not carried over to the webhook page as that is not configured to take log ins. So is there no way to get the customer ID from the checkout creation? Therefore do I have to keep updating the customer DB when they are sent to the success page?

civic spruce
prisma mountain
#

That is what I am doing. The issue was I need to get their user account ID from my customer database on the retrieval of that event.

#

I fixed it by adding new customers to my database from within the return page if they do not exist.

civic spruce
#

So you have your own customer ID on your end when you create the Checkout Session?

prisma mountain
#

I have their user ID when they log in, but after their first payment I link a stripe customer ID so that their payment history is logged to the same person.

#

I think I fixed the issue of the customers not existing in my webhook now however... But I am still having the issue that my customer did not get the product updated and I cannot figure out why.

civic spruce
#

Sorry, I'm not sure I follow. Can you provide more details about exactly what you need help with?

prisma mountain
#

My customer approached me because their digital currency for a game I made was not showing after a purchase. When I looked at the databse there was no customer, however I think I fixed that by just adding the addition of their stripe customer ID into my database when they are returned to my website. Now I think there is something wrong with my webhook as they still are not showing their purchase.

#

This is the code and it worked for the first price ID of my product, but this user used the second price option and it is not showing their purchase on my system at all

deep laurel
#

๐Ÿ‘‹ i'm hopping in since @civic spruce has to head out

prisma mountain
#

No worries.

deep laurel
#

Trying to think about how to approach this from another angle - do you have an example purchase that is not showing up in your system properly?

prisma mountain
#

Yes

#

it is pi_3KdLnKEOJsqRXL0R0aCkheDN

#

but when I tested it in live mode earlier in the month it worked

#

pi_3KZD8BEOJsqRXL0R1EhfDhR0 is for the working purchase

#

Everything seems to be working except when it goes to update the balance in the DB

#

it was the SQL statement causing all the issues... I have fixed the issue. Sorry for wasting time.

deep laurel
#

Was it the insert SQL statement?

prisma mountain
#

update

#

the only other issue now is I have in the place where I create the customer on them being returned to the website after payment a get statement for session ID, but I cannot see where I put that into the return URL, I am assuming that is added by stripe within the return URL?

deep laurel
prisma mountain
#

Yes, ok that's good thanks. Was confused as I copied a previous return page to make sure users are added to my customer database.

deep laurel
#

๐Ÿ‘