#Ring - webhooks
1 messages · Page 1 of 1 (latest)
You're looking for webhooks
Thanks, it's specifically what I've been reading. What I'm missing that this webhook contains the ID that I use in -my- system for which user has paid. I would assume this ID is something I would send along in the payment link, but I can't figure out how - that's my precise problem
A payment link generates a payment intent object (each has a unique id)
If you want to tie it to that customer, you can create a customer: https://stripe.com/docs/api/payment_links/payment_links/create#create_payment_link-customer_creation
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Or inspect their billing email on the payment intent object
Okay
This seems like a solution, but it doesn't seem like the proper solution. Perhaps it is?
Payment Links are trickier to manage because it's one link to multiple customers
In applications that use Stripe, is the email used as the key to identify paying customers to customers in the system?
With something like Checkout sessions it's a one link to one customer
And the relationship is easy to preserve
I see
That makes sense
Perhaps I'm looking to do a Checkout session instead then
I'll read into that, thank you
It sounds like it
What kind of payments are you trying to accept?
What kind of system are you building?
People sign up to become part of an student organization. When they register, they are given an entry in the database for members, with the "PAID" field set to FALSE
They receive an email to the email they registered with, containing a link to pay their membership
I want the payment to then use a webhook/event/request/whatever to an endpoint in the page containing some identifier for the member so I know which member to set PAID = TRUE
Preferably the MemberID, since it's the unique primary key in my database
Cool. If you want a Stripe-hosted solution, then I think the Checkout flow would work quite well for you: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout
You could create the customer object first: https://stripe.com/docs/api/customers/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And pass it in when creating a session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Alright
Then I would have to store MemberId -> StripeCustomerId's in the DB though, no?
To pick out the Member again when the payment returns
Checkout session looks exactly like what I need
You could use the stripe-generated customer id as a primary key, but if you must use your own primary key value, then you could do that mapping, yeah. Or you could pass in your member id as metadata so they'll be attached to certain objects: https://stripe.com/docs/api/metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.