#matrix-payment links
1 messages · Page 1 of 1 (latest)
@fleet root are you aware that you can get session.url when creating the CheckoutSession?
nope
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
you do have to generate a new CheckoutSession object for each customer or payment attempt to be clear, but I think maybe session.url is what you're looking for. https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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?
what I have is as follow: 1) user click on https://substribe.co.uk/ricco-iframe.html 2)user click on button 3) user open the checkout session
i would like to have 1) user click on a link 2) user open the checkout session
i would like to save 1 click
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
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
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
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)
ok cool, is direct charge with payment link in the making? will it be available in the future?
not sure actually!
ok thanks