#SusanP-checkout
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ taking a look now
how does Stripe know whether to do an authorization only, or a simultaneous authorization+capture?
You define what you want Checkout to do. If you are only using it to setup future payments (see here: https://stripe.com/docs/payments/save-and-reuse?platform=checkout) then it will only auth the card
Additionally, is there a way to make the payment conditional upon the shopper returning to the cart to complete their order?
You should make sure to listen for thecheckout.session.completedevent and fulfill your orders using it instead of relying on the cart (if you can help it)
Thanks two-shoes. I am not trying to set up future payments. I really just want to take a payment for a shopping cart and know that the payment will go through. Stripe seems to make that impossible, in an effort to be more robust. So no, I don't think it's future payments I want. It's a "now" payment, so to speak.
And when the customer returns from the stripe-hosted page to the cart, I could wait until the event is sent before showing them the order confirmation page, but if the event isn't sent within seconds, that would be a poor experience for the user.
I guess I really need to know if there is a way for Stripe to work like a normal credit card processor, where processing happens "while you wait", and the order isn't creating until/unless the payment is completely successful
sorry...that should be "al the order isn't created"
If a payment is being created through Checkout, it will error out if the payment is unsuccessful, so it should be happening "while you wait" already. The exception is for some non-card payment types that happen asynchronously, but those are the exceptions.
ok that's great. and are they always already captured, instead of just pre-authorized?
Again, that will depend on what you tell Checkout to do, but yes: if your customers are attempting to make a payment via Checkout, then the payment should either fail or succeed. If it fails, they get an error pop-up in the Checkout page that says the payment failed. If it succeeds, they get redirected to the success_url that you specify: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-success_url
perfect. and then no need for a separate capture, correct?
That is not needed unless you explicitly use parameters to set manual capture
NP!
oh one last thing. do we have to pass the shipping, charges, tax rate, etc to checkout? we can't just pass the order total?
Ah lots more options there -- you can certainly do the total if you calculate this yourself and manage all the necessary pieces, but Checkout also supports Stripe Tax calculation (in application tax jurisdictions) and has support for some shipping options:
https://stripe.com/docs/payments/checkout/taxes
https://stripe.com/docs/payments/checkout/shipping
I'd suggest taking a look through that to see if it covers what you need
I'm actually trying to avoid all of that - I've seen it already and have it working, but my client would rather just pass the total and nothing else
That's fine too then ๐
And you can manage what all that includes in your own systems
perfect, that's exactly what I want. thank you again
i'm going to try it now so I can come back if I have any trouble with the message data!
Good luck!
Thanks but...no ๐ Without passing line items I get back this: The line_items parameter is required in payment mode
i also don't see where I can pass a simple "total" or "amount"
Well yes, you'd still need to pass a line item, 1 line item wiht the total
oh!
duh ๐
last thing, I think. my success url needs to do backend processing on my side to convert the cart to an order. if that fails, the payment will still have gone through, correct? if so i just need to tell my client to watch out for it
Whoops missed this update
Sorry for the delay
Yes, but we recommend using webhooks for this, using checkout.session.completed events
i could use that to send off a message. thank you and have a great day!