#JCoDog-customer

1 messages · Page 1 of 1 (latest)

vital light
#

Hu @deep merlin! Could you clarify your question? What exactly are you trying to achieve?

deep merlin
#

I have users logged in on my website, and I have given them a client ID within my database. But when I try to find transactions based on users I cannot and one person shows 5 different payments for different things. Is there a way to use my database client ID to create a stripe customer against that all transactions can be done against? And is there a way to query stripe to see if it needs to be created or just used?

vital light
#

The recommended way is to store the Stripe customer.id in your own database. This way, when a users wants to do a payment, you can check if they already have a corresponding Stripe customer. If yes, use that customer ID; if not, create a new Stripe customer and store that ID in your database.

deep merlin
#

Ok, so when creating the session does it make the ID or is that in the response only?

#

And can I pass the name and email from my user database into the creation of the customer?

vital light
#

Ok, so when creating the session does it make the ID or is that in the response only?
Yes you can pass an existing customer ID. If you don't to the Checkout in payment or subscription mode, Checkout will create a new Customer object. https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer

And can I pass the name and email from my user database into the creation of the customer?
Yes, when creating a new customer you can pass name, address, email, etc. (though all are optional). https://stripe.com/docs/api/customers/create

deep merlin
#

ok and the customer ID, does that get sent in the response after success/fail?

vital light
deep merlin
#

I also assume that users can access their past trnasactions through the portal using their customer ID? Or is that only for subscriptions?

#

I havent been able to figure out the customer portal exactly yet... Because I think you need to call the portal URL against a customer ID

vital light
#

The customer portal is only showing subscriptions, not one time payments.

deep merlin
#

So I assume for one time I would have to keep a record myself of those for users to view

#

OK that should cover it... I will look into the portal a bit more and work on the customer ID and see where I get from there. Thanks.

vital light