#4e656f

1 messages · Page 1 of 1 (latest)

marsh coralBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

pallid venture
#

What do you mean by retrieved payment link?

unborn thicket
pallid venture
#

PaymentLinks can't be associated to a specific customer by default.

If I remember correctly, there's a beta for passing an existing customer to a session that gets created by the payment link

Are you trying to associate the payment made using the link to a customer?

unborn thicket
#

Im trying to associate the payment with user who already paid once.

pallid venture
unborn thicket
#

No because, i have a function the retrieve the paymentLink which then redirect the user to stripe payment page. and i dont understand paymentIntent yet, does it change the paymentLink data?

all i want to do is when user goes to the stripe payment page, if they already have a customer id i want them to use that customer id and not create a new customer id.

#

there is this parameter for payment link:


Configures whether checkout sessions created by this payment link create a Customer.
Possible enum values
always

The Checkout Session will always create a Customer when a Session confirmation is attempted.
if_required

The Checkout Session will only create a Customer if it is required for Session confirmation. Currently, only subscription mode Sessions require a Customer.```
pallid venture
#

hmm I don't believe there's a way to pass in an existing customer ID to the session, let me confirm with a colleague

unborn thicket
#

or maybe if payment_intent.created
i can update the payment intent with the customer id?

pallid venture
#

yeah you should be, using the endpoint I shared above

#

confirmed with a colleague that paymnet links don't support passing existing customer ID.

unborn thicket
#

yes but my problem with that is getting my users data so i can fetch that user customer id to update the payment intent

pallid venture
#

Let's take a step back
What's your actual usecase? Can you provide the exact details as well as an example so that we're on the same page?

unborn thicket
#

So basicly i don't want to create a new customer id when my user already have a customer id. because it will create a new customer in stripe for the same user.

pallid venture
#

Gotcha. i don't see a good workaround for this unfortunately. You can file a feature request for this.

If its a hard requirement then you might want to consider moving to stripe checkout

unborn thicket
#

imma check it out

#

does the stripe checkout create a payment page?

pallid venture
#

Yes

#

PaymentLink creates a checkout page undearneath

unborn thicket
#

but this const session = await stripe.checkout.sessions.create({
success_url: 'https://example.com/success',
line_items: [
{
price: 'price_1MotwRLkdIwHu7ixYcPLm5uZ',
quantity: 2,
},
],
mode: 'payment',
});

wont create a new payment link?

pallid venture
#

When you say payment link, do you mean the URL that the customer visits?

unborn thicket
#

this one

pallid venture
#

No, PaymentLinks is a separate concept.

PaymentLink is no-code solution for stripe hosted payments. You create a payment link and share it with your customers.

When the customer visits that URL, Stripe creates a Checkout Session which allows customers to make the payment.

unborn thicket
#

does the session id expire? because i was thinking use the payment link for first time buyer then if they have existing session id use the checkout, retrieve a session const session = await stripe.checkout.sessions.retrieve( 'cs_test_a11YYufWQzNY63zpQ6QSNRQhkUpVph4WRmzW0zWJO2znZKdVujZ0N0S22u' );

pallid venture
#

Expire in what sense?

#

You can retrieve the completed sessions using the ID, yes

unborn thicket
pallid venture
#

so i need to create a new checkout page every time? and cant reuse the no code PaymentLink?
correct, but ideally you write the code that creates it for you

unborn thicket
pallid venture
#

yes, it can't be reused for subsequent payments

unborn thicket
#

so the best solution is just create a new checkout.

#

thanks imma try that!

pallid venture
#

yup

unborn thicket
#

just to confirm with checkout i will need to pass the customer id?

pallid venture
#

It is optional but if you have an existing customer that you want to associate with the session then yea