#minio

1 messages ยท Page 1 of 1 (latest)

spice compassBOT
slate bobcat
#

Hi there, do you mean you want to update the client_reference_id of a checkout session object?

mortal comet
#

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 :/

slate bobcat
#

OK, can you tell me more about the problem that you try to solve / goal that you want to achieve ?

mortal comet
#

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?

slate bobcat
#

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.

#

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.

mortal comet
#

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?

slate bobcat
mortal comet
#

yea, thank you ๐Ÿ™‚ I will check these materials

mortal comet
#

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)