#sweetpotato8776
1 messages · Page 1 of 1 (latest)
Actually, you called 4 times.
hello! what do you mean by Stripe called return 4 times?
We specified "/callback/stripe" as the return uri, you called it like this.
it is Klarna payment service.
gimme a while to see what I can find
yes , thank you.
Well, you make an API request to create Payment Intent here: https://dashboard.stripe.com/logs/req_sevrrIPJNqsJLA
We return a response with status: 'requires_action'. At some point you need to call confirmation on that PI to send the user to Klarna to pay. How are you doing that?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
} else if (response.status === "requires_action") {
// Use Stripe.js to handle the required next action
const {error, paymentIntent} = await stripe.handleNextAction({
clientSecret: response.clientSecret
});
I don't think we're calling confirmation.
We just created payment-intent and set the parameter confirm:true.
Ok, got it. We're looking into this now
hi! I'm taking over this thread.
your payment flow looks like this, correct:
- you create the PaymentMethod first
- then you create the PaymentIntent with
confirm: true - finally you call
handleNextAction
can you clarify how do you create the PaymentMethod exactly? and why do you create it in advance?
i use payment-element.
When the customers select a payment method and presses the pay button, a payment-method is created.
I don't make anything in advance.
create payment methods , next create payment-intent and then
if response.status === "requires_action", i call stripe.handleNextAction
i think handleNextAction is "/callback/stripe"
right??
the "classic" flow is to first create the PaymentIntent first, and then use the Payment element to collect the payment method and confirm the PaymentIntent.
this is covered here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
any reason why you are not using this?
I will handle payment-intent creation on the server side. It's in your guide too.
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Yes, you can only create the PI on the backend.
Same question as my colleague.
what's mean!?
this is covered here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
any reason why you are not using this?
Because I want to do it.
So, why can't I do that?
Does that have something to do with why callback was called four times?
That's fine too.
But why you don't allow Stripe to handle the nextActions? Are you required to handle it yourself?
Could you explain how Stripe's handling of nextActions is implemented?
I didn't think I would handle it myself
Is your requirement to collect card info before creating a PaymentIntent?
Because you might be then better off following this guide: https://stripe.com/docs/payments/accept-a-payment-deferred?platform=web&type=payment
Here you will just call stripe.confirmPayment() and next actions will be handled for you.
you said that handleNextAction was called 4 times?
I thought you said that ☝️
That's not what I'm saying...
Then, /create/payment-intent should have been called 4 times, but why does the payment-intent in the callback come in on the same PI?
I don't understand exactly what part of your code was called 4 times. Could you please elaborate?
It's difficult because the person in charge keeps changing...
Have you seen the log I captured?
yep
I mean sometimes something might happen and we call a URL twice(we have dug into some cases of similar things happening before), I don't think it should be a problem; remember anyone can access that URL at any time so you would be handling hits to it in an idempotent way
What I mean is, I don’t think I developed something wrong and it came out 4 times.
Are you saying there is a possibility that you called me 4 times?
yep