#minio
1 messages ยท Page 1 of 1 (latest)
Hi there, do you mean you want to update the client_reference_id of a checkout session object?
Sorry for misunderstanding - maybe I got this wrong - my goal is to connect user from my web app to stripe customer - I was thinking that client_reference_id or metadata with myUserId will solve the issue - but it is not :/
OK, can you tell me more about the problem that you try to solve / goal that you want to achieve ?
Scenario: I have ecommerce app with a lot of users, i.e we have user Jack (his id: jackID) -> Jack buys subscription -> In my app I want to know that Jack bought has bought that subscription - how I can achieve this?
how can I check if user with id jackID has completed payment in my app?
Got it, you should create a customer object (https://stripe.com/docs/api/customers/create#create_customer), and pass the customer ID when creating a checkout session (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer), so that the checkout session and the customer are associated.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I'd also suggest you to listen to checkout.session.completed and invoice.pad events, and you'll get the customer ID from these event object to know which customer has completed the checkout/ paid the invoice.
Refer to this page https://stripe.com/docs/billing/subscriptions/webhooks for the list of subscription related webhooks
ok, so it seems I missed one step which is creating customer ๐ Thanks!
I have following question, what if user will stop subscription and after some time he wants to continue and pay again - should I create him again or it should be different flow?
Do you mean pause a subscription? https://stripe.com/docs/billing/subscriptions/pause
yea, thank you ๐ I will check these materials
One more question regarding creating new customer - can I assign the custom id for the customer? For example in http rest call I will get params from request where I store userId from my web app and I would like to set this userId into customerId - is it possible to connect it somehow?
@slate bobcat so I could do quickly
/v1/customers/:id ----> where id is my userId (from web app) === customerId (from stripe)