#AustinL
1 messages · Page 1 of 1 (latest)
You should still be able to use the stripe.js SDK with Angular. I don't see why these would be incompatible. The only thing is you wouldn't be able to copy/paste a lot of our snippets, since they're in Node and/or React
Checkout is really easy to use, as it's considered a "low-code" integration path. Basically you just need to build a system that can create Checkout Sessions via the Stripe API and redirect your customers to the Stripe-hosted Checkout page (the URL for it is contained on the Checkout Session object)
I'd recommend looking through this to get an idea of how this might be done: https://stripe.com/docs/checkout/quickstart
My biggest challenge with the stripe prebuilt is timing out. Our platform books appointments and we give clients some time to complete the process of booking or we release the appointment back into the system. If we use the re-direct page we lose control of the session timing and things can get complicated. Any ideas with this in mind?
You can use the expires_at attribute on the Checkout Session object in this case: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-expires_at
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
That's assuming your expiration is less than 24 hours from creation. If it's longer than that, then you would need to create your own system that waits for the customer to approve the appointment before creating the Checkout Session
We just give them like 4 minutes to complete the check out, So we can set the clock on this session and when they hit the stripe page we can initiate the expires at function for 4 minutes and after that it can refer them back to our site and release the appointment back into the mix. I think this would work. Am I understanding this function correctly??
Sort of. You specify 2 different URLs that redirect: either (a) when the payment is successful, or (b) when the payment is canceled. If the Checkout Session expires, I don't think the page auto-redirects until after the customer tries to submit payment. But let me check for sure and circle back in a few minutes
That would be great. I will wait for your response.
Q: is using the expires at feature, does that become a visible element on the checkout page tot he customer, or can I make that visible so they know they have a time limit?
Unfortunately you have to set it for 30 minutes ahead of creation or more. Is that a blocking factor for you?
Q: is using the expires at feature, does that become a visible element on the checkout page tot he customer, or can I make that visible so they know they have a time limit?
You would have to create your own system to make this visible to them
If it has to be 30 minutes minimum then that is a blocking factor for us. Almost a great solution.
Is there any way that I can add a banner across the top of the stripe checkout page where I can place the timer to let them know how much time they have left?
Stripe doesn't offer a banner, but a custom banner should be relatively simple to implement
You can manually expire a Checkout Session at any time, so if you had your own timer set up, you could expire the Checkout Session at any point that the time reaches 0
So you are saying that the pre-built stripe checkout page would allow me to add my own banner for the timer? If it does than yes I can handle implementation of that. I was not sure it would allow me to alter it.
No, you would have to build that yourself and it would have to occur before you redirect to the Checkout Session
Yes we already have a timer on our page. So what you are saying is possibly the following...
Someone starts booking on our system and we create a timer for them to finish the whole process.
When we re-direct them to the stripe checkout page, we continue the timer on our site for their session.
When their timer runs out we can send that info to the stripe page and "manually" expire their payment session.
Then can we pull them back from the stripe page to our site as part of that session expiration?
When their timer runs out we can send that info to the stripe page and "manually" expire their payment session.
Then can we pull them back from the stripe page to our site as part of that session expiration?
You can manually expire the Checkout Session, but the Checkout page will not reflect this unless they refresh or attempt to make a payment (which will fail). If you wanted a more responsive system, you'd likely have to use the Payment Element
ok, great. And the payment elements are built through the stripe.js package correct.
Previoulsy you said the snippets could not be used in Angular, does that mean we have to built our own elements if choosing to use this method?
ok, great. And the payment elements are built through the stripe.js package correct.
Correct
Previoulsy you said the snippets could not be used in Angular, does that mean we have to built our own elements if choosing to use this method?
No, you could adapt each of the snippets to be "Angular-flavored", but you couldn't just copy/paste everything verbatim and have it work out of the box, you would have to recognize what stuff is Node/React, then modify it to be Angular instead.
Got it - Hearing the basics of what I am trying to do - would you recommend sticking with the pre-built or diving in and using stripe.js
What provides the best user experience IYO
Best user-experience would be stripe.js, but that is a more complex integration
Thanks two-shoes