#chimpTerminal

1 messages ยท Page 1 of 1 (latest)

bitter kiteBOT
eager reef
#

hello two shoes

#

i got it working kind og

#

of'

sullen jacinth
#

Sure, what's going on?

eager reef
#

quick question. right now im applying the cus_id to my database using the user email as a common data point between stripe and my app. however, if the user enters an email different to their email on my apps database the cus_id does not get linked to their account.

#

is there another way i should match the users between stripe and my app

#

i did shed a tear when it worked btw

#

is it best practice to do this with a session id?

sullen jacinth
#

You can have multiple Customers with the same email, so you may want to find a new way of associating Customers.

#

Not sure if that's a helpful answer or not though

eager reef
#

i think i store my user id's in a session session['user_id'] = user.id when the user logs in?

then match the stripe customer to the user id thats in the session? so the users will be locked?

sullen jacinth
#

Ah, it might be worth storing the Customer ID as well, so you can do an easy lookup of their Stripe stuff (e.g. subscriptions, payment methods, etc.)

bitter kiteBOT
eager reef
#

do you have any docs on usings session with stripe to capture customer id

sullen jacinth
#

When you say "sessions" what are you referring to?

#

Like a login session?

eager reef
#

like a checkout session to store my app user db id

formal arrow
#

You determine whether to provide an existing customer ID when you create the session

eager reef
#

I dont have a session setup yet. I struggling to link the stripe customer to my app db user. i have managed to do this by matching my user email to the stripe customer email. but this wont work if the user uses a different email when paying with stripe.

#

i need an alterative method. and i have no idea how to do sessions with the stripe price table.

#

i think i can hold the user id as meta data in the session but is there any documentation on how to get this to work with the stripe price tables

formal arrow
#

Pricing Table does not currently support providing an existing customer ID, but its something we are looking at

eager reef
#

yes but when the user pays for a product on the price table. a customer is created with a customer id

#

does this look correct for creating a session?

formal arrow
#

Wait, you're creating your own checkout sessions, that's different that pricing table, so i'm confused what you're doing here

#

You can pass a client_reference_id in both cases that would let you tie things together:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-client_reference_id
https://stripe.com/docs/no-code/pricing-table#handle-fulfillment-with-the-stripe-api

The <stripe-pricing-table> web component supports setting the client-reference-id property

Display a pricing table on your website and take customers directly to Stripe Checkout.

eager reef
#

ah ok i think that track subscriptions is what im looking for thank you

bitter kiteBOT
eager reef
#

can i chat to synthrider please

formal arrow
#

hey, do you have more questions about this?

eager reef
#

hey mate i just want to say thank you i got it working

formal arrow
#

great! glad to hear it ๐Ÿ™‚

eager reef
#

ive been struggling for 3 days and im a complete moron. i didnt have the correct event turned on

#

that link really helped thank you so much made my day! ill let you get back to work now ๐Ÿ˜„

formal arrow
#

Happy that it was useful and let you get things working ๐ŸŽ‰

#

Good luck as you keep building ๐Ÿป

eager reef
#

cheers!