#Guss Rw-payment-links

1 messages ยท Page 1 of 1 (latest)

celest haven
#

Can you elaborate? What do you mean?

primal ravine
#

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?

celest haven
#

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

primal ravine
#

OK, and if I have the id of the payment link, could I get the session or sessions?

celest haven
#

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?

primal ravine
#

I want to get the customer in the after_completion

celest haven
#

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?

primal ravine
#

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

twin hamlet
#

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?

primal ravine
#

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?

twin hamlet
#

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.

primal ravine
#

Ok, thanks, I'll implement the event.