#Guss Rw-payment-links
1 messages ยท Page 1 of 1 (latest)
I want to generate a payment link for the subscription to a plan of my platform, I did it with payment links without sessions but I could not obtain the customer that is generated when paying in the payment link, then I created a session object but the payment_link field is empty, how can I generate it?
I still don't understand. A Payment Link results in a completed Checkout Session. So if someone pays via a Payment Link, then the result is a succeeded Checkout Session
OK, and if I have the id of the payment link, could I get the session or sessions?
Not as far as I know, but you could get the Payment Link from the Checkout Session. What are you trying to do? What problem are you wanting to solve?
I want to get the customer in the after_completion
Do you mean you want to get the customer's data? When during the lifecycle of the Payment Link are you hoping to get it? What do you want to use it for?
Yes, after complete a payment, I need the customer id to know if he have a subscription active
I think I need to use the checkout.session.completed event
HI ๐ I'm stepping in for @celest haven as they needed to step away. Gimme a sec to catch up
Okay so after your customer completes the Checkout Session you wish to collect the Customer information from that session. Do you have a payment link ID I can reivew?
plink_1LIKRwG6xy23C2xGjygeTQ6B
The Checkout Session id only can retrieve on checkout.session.completed event?
Or is there a way to find payment sessions by payment link ID?
The Payment LInk does not have a direct connection in itself to the Checkout Session, since Payment Links are intended for general use. A checkout session is unique to a single customer/purchase interaction.
You can listen for the checkout.succeeded event and then match the payment_link property so you know which Customers are associated with which Payment Links.
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_link
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, thanks, I'll implement the event.