#zzawaideh
1 messages · Page 1 of 1 (latest)
Is there a way to call this right after the user submits the payment form?
quoting here for context
Okay!
Call what?
stripe.paymentLinks.listLineItems(
'plink_1LorZqFzI7sFImrZqQBOxNcH',
{ limit: 3 },
function(err, lineItems) {
// asynchronously called
}
);
I want to use this right after the user submits the payment form
right now it is in a separate route
Is it possible to do this directly after the form is submited?
Well you don't control the code that is running when the user is interacting with the Checkout form.
We do fire off a checkout_session.completed event when they submit the form. You could try listening for that and responding with this function
Good idea, but where would I listen for checkout_session.completed?
Would it be in the server?
Or the client?
On the server. With payment links the checkout occurs on a Stripe hosted client so you have no direct connection
I will try this, thank you for the suggestion