#matrix-payment links

1 messages · Page 1 of 1 (latest)

strong mural
#

@fleet root are you aware that you can get session.url when creating the CheckoutSession?

fleet root
#

nope

strong mural
#

you don't have to use the redirectToCheckout function in Javascript if that's the issue

#

it did use to be required but it's not any more since you can just get the URL from the session object in the backend and 3xx redirect to it

fleet root
#

sorry i am not sure i understand. I have created a page in my website with a button https://substribe.co.uk/ricco-iframe.html. Is there a way to generate a link to the checkout page (rather than going in my webpage and click the button)?

#

typo in the first link

strong mural
#

Is there a way to generate a link to the checkout page
hmm isn't that what you already have?

#

like you have code there calling a function createStripeCheckout that calls your Firebase backend function to generate the CheckoutSession

#

you then have code that gets the ID of the Session returned from that and redirect to it

const sessionId = response.data.id;
stripe.redirectToCheckout({sessionId: sessionId})

looks entirely normal and good to me! what part of that flow is not what you want?

fleet root
#

i would like to have 1) user click on a link 2) user open the checkout session

#

i would like to save 1 click

strong mural
#

hmm ok. So just call your code from window.onload right, instead from a button event handler?

#

like call the backend and do that redirect as soon as the page loads, it would work fine

fleet root
#

ah ok, i need to do an automatic redirect to the backend

#

i will work on this then

#

i really like your payment links, so easy to use and i was wondering if i can simulate a similar behaviour with checkout

strong mural
#

you certainly can

#

you don't even need and of that Javascript really, in theory you can just generate the CheckoutSession when the backend server's route is hit, then 3xx redirect to session.url . But for now given what you already have, having the page just use your existing code but run it when the page loads instead of waiting for the button to be clocked is probably the easiest migration path to get you to what you're looking for

fleet root
#

sure thanks!

#

one question: does payment link works with connect direct charge?

strong mural
#

not right now no, it supports splitting funds, but that's done via a Destination charge(payment processed on your platform, then a percentage is sent to the connected account)

fleet root
#

ok cool, is direct charge with payment link in the making? will it be available in the future?

strong mural
#

not sure actually!

fleet root
#

ok thanks