#4e656f
1 messages · Page 1 of 1 (latest)
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.
- neo-subscriptions, 19 hours ago, 18 messages
- 4e656f, 2 days ago, 15 messages
What do you mean by retrieved payment link?
this line:
const paymentLink = await stripe.paymentLinks.retrieve(
'plink_1MoC3ULkdIwHu7ixZjtGpVl2'
);
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?
Im trying to associate the payment with user who already paid once.
Have you tried updating the customer param on the PaymentIntent directly?
https://stripe.com/docs/api/payment_intents/update#update_payment_intent-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.
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.```
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
or maybe if payment_intent.created
i can update the payment intent with the customer id?
yeah you should be, using the endpoint I shared above
confirmed with a colleague that paymnet links don't support passing existing customer ID.
yes but my problem with that is getting my users data so i can fetch that user customer id to update the payment intent
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?
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.
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
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?
When you say payment link, do you mean the URL that the customer visits?
this one
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.
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' );
so i need to create a new checkout page every time? and cant reuse the no code PaymentLink?
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
if i understand well when session is completed it cant be reused?
yes, it can't be reused for subsequent payments
yup
just to confirm with checkout i will need to pass the customer id?
It is optional but if you have an existing customer that you want to associate with the session then yea