#sweetpotato8776

1 messages · Page 1 of 1 (latest)

balmy juniperBOT
fading tusk
#

Actually, you called 4 times.

swift zodiac
#

hello! what do you mean by Stripe called return 4 times?

fading tusk
#

We specified "/callback/stripe" as the return uri, you called it like this.

#

it is Klarna payment service.

swift zodiac
#

gimme a while to see what I can find

fading tusk
#

yes , thank you.

balmy juniperBOT
visual scarab
#

Still looking at this!

#

How are you confirming the PI, by the way?

fading tusk
#

what do you mean ...?

#

It's captured in our server logs.

visual scarab
fading tusk
#

} 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.

visual scarab
#

Ok, got it. We're looking into this now

hallow sentinel
#

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?

fading tusk
#

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??

hallow sentinel
#

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.

#

any reason why you are not using this?

fading tusk
#

I will handle payment-intent creation on the server side. It's in your guide too.

hasty mason
#

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.

hasty mason
fading tusk
#

what's mean!?

hasty mason
fading tusk
#

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?

hasty mason
#

But why you don't allow Stripe to handle the nextActions? Are you required to handle it yourself?

fading tusk
#

Could you explain how Stripe's handling of nextActions is implemented?

#

I didn't think I would handle it myself

hasty mason
#

Here you will just call stripe.confirmPayment() and next actions will be handled for you.

fading tusk
#

you said that handleNextAction was called 4 times?

hasty mason
fading tusk
#

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?

hasty mason
#

I don't understand exactly what part of your code was called 4 times. Could you please elaborate?

balmy juniperBOT
fading tusk
#

It's difficult because the person in charge keeps changing...

#

Have you seen the log I captured?

versed token
#

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

fading tusk
#

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?

versed token
#

yep