#zzawaideh

1 messages · Page 1 of 1 (latest)

deep grottoBOT
muted mantle
#

Is there a way to call this right after the user submits the payment form?

#

quoting here for context

atomic crow
#

Okay!

muted mantle
#

Call what?

atomic crow
#

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?

muted mantle
#

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

atomic crow
#

Good idea, but where would I listen for checkout_session.completed?

#

Would it be in the server?

#

Or the client?

muted mantle
#

On the server. With payment links the checkout occurs on a Stripe hosted client so you have no direct connection

atomic crow
#

I will try this, thank you for the suggestion