#david-llop-_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1334514796510314526
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- david-llop-_code, 6 days ago, 19 messages
- david-llop-_webhooks, 6 days ago, 6 messages
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
๐ Happy to help!
it seems like you need to follow this step then:
https://docs.stripe.com/payments/save-and-reuse?platform=web#charge-saved-payment-method
we have two cases,
-
off-session (hotel owner wants to charge some money to customer via our back-end)
-
and on-session (customer wants to pay some amount of their booking via the my-booking administration section)
in the first case, if the payment requires customer interaction, we will simply ignore it (or cancel it) and send the payment via mail to the customer to pay using checkout sessions.
in the second case, the customer can complete the payment if customer interaction is required, like confirming via bank app or something like that 3DS requires nowadays
Thanks for the additional details
This should be the next steps then. You fetch the customer payment method and use: either off_session or on_session..
I already have the payment method ID and the customer ID, I guess that's what I need to call paymentIntent->create() and use off_session for back-end chores and on_session when the customer clicked the button
Correct.
gonna read this docs you shared and come back in a few ๐ better than wasting your time ๐
thank you very much!
No worries, happy to help any time!
just one question, this docs shows a different way of initializing the Stripe Client, my guess is that it's not important for what I need to do, am I right?
\Stripe\Stripe::setApiKey('sk_test_CGGvfNiIPwLXiDwaOfZ3oX6Y');
try {
\Stripe\PaymentIntent::create([
โ๏ธ this would be the same as this ๐
$client = new StripeClient('sk_test_CGGvfNiIPwLXiDwaOfZ3oX6Y');
try {
$client->paymentIntents->create([
Yes both should be ok, you need can use the same client for all your API calls
perfect, I think I completely understand the off_session flow stream ๐ฌ but can't find the information for when it's on_session ๐
like
When it's on_session and payment required customer's verification, you will receive the status
requires_payment_confirmationand the link the customer should visit to confirm this transaction
the bold part is what I can't find
on_session is when a customer choose a saved payment method and choose to pay using it from the frontend.
off_session is when your backend charge the customer without his presence on a frontend.
yeah, but in our front-end there's nothing stripe related, is just a button, and that buttons makes a POST call to our server, and our server executes the stripe->paymentIntents->create(...) with the information
it's considered as an on_session payment, as the customer is on your frontend and you can ask them to complete the 3DS action if the bank issuer requested that...
yeah that's what I need ๐
inform the customer to complete the 3DS action... Oh wait, you mean Stripe only tells me like Yoh, this guy needs to complete the 3DS, tell him to open the bank account
and then I need to tell the customer Check your bank app to complete with the step and click [HERE] when done? ๐ค
sorry I'm new to this, what I did in like 10 other payment gateways usually I receive an URL that I need to redirect the customer to, and in that screen they should confirm the purchase, then they are redirected to the success url and a notification is received via webhook, pretty similar to the stripe->session->create flow but without credit card inputs
Yes you make a call using this stripe js function:
https://docs.stripe.com/js/payment_intents/handle_next_action
You show something like: you need to complete a 3DS action in order to validate this payment (as a button). When the customer clicks on that button, you call that stripe js function
But I'm not using any JS so far, only server side, there's no Stripe JS involved in all the flow I developed so far ๐ is it 100% required for this? Is there anything I can do server-side to get the link that that JS generates? ๐
If you don't want to have a frontend, then you need to handle the 3DS redirection manuallay:
https://docs.stripe.com/payments/3d-secure/authentication-flow?platform=web#when-to-use-3d-secure
And share the 3ds next_action url with the customer in order to complete it.
I see, so if the PaymentIntent contains "status": "requires_action", the property next_action will contain the url to complete the 3DS authorization
Correct