#kamon000

1 messages ยท Page 1 of 1 (latest)

shut sphinxBOT
#

Hello! We'll be with you shortly. 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.

hushed radish
#

handCardAction is depcrecated, you should use confirmCardPayment()

gritty rampart
#

I'm handling PI confirmation server-side and would prefer to keep it that way. I only want to handle 3DS here, client-side, then confirm the PI server-side.

#

Is that possible?

#

It also doesn't show that method as depecrecated for my API version, it should still work, right?

hushed radish
#

Can you share with me the paymentIntent ID? and the code you wrote to handle 3DS?

gritty rampart
#

PI: pi_3OeNAmKq0PhFh4nt0ednsjZu

As far as handling 3DS, it's just basically running the handleCardAction method:

const { error, paymentIntent: stripePaymentIntent } =
        await stripe.handleCardAction(paymentIntent.clientSecret)
#

This is after creating the PI:

const stripePaymentIntent = await stripe.paymentIntents.create({
    customer: user.stripeId,
    currency: 'usd',
    payment_method: paymentMethod.stripePaymentMethodId,
    payment_method_types: ['card'],
    payment_method_options: {
      card: {
        capture_method: 'manual',
      },
    },
    transfer_data: {
      destination: stripeConnectAccountId,
    },
    amount: convertAmountToInteger(order.total),
    application_fee_amount: convertAmountToInteger(applicationFee),
    metadata: {
      orderId: order.id,
    },
  })
#

and confirming the PI off session:

const updatedPaymentIntent = await stripe.paymentIntents.confirm(
    stripePaymentIntent.id,
    {
      off_session: offSession,
    }
  )
#

Note: this PI was then moved to off session for me testing, but it was erroring out both ways.

hushed radish
#

Do you have the full error message of stripe.handleCardAction ?

gritty rampart
#

Oh, my bad, I thought this was the message from Stripe! Been a long day, here's the full Stripe error:
error IntegrationError: handleCardAction: The PaymentIntent supplied does not require manual server-side confirmation. Please use confirmCardPayment instead to complete the payment.

hushed radish
#

OK, have you tried confirmCardPayment ?

gritty rampart
#

Will that confirm/auth the PI, or does it only do 3DS?

#

I only want to handle the next PI action.

hushed radish
#

It will confirm the PI, but you can still capture it later if you set the PI's capture_method to manual

gritty rampart
#

That's the issue. I only want to handle 3DS if I can help it. My normal payment flow confirms the PI server-side, so doing it client side isn't ideal.

I was hoping to utilize handleNextAction but I don't know if it's available on my SDK version.

hushed radish
#

Even if handleNextAction is executed successfully, it will also move the PI status to processing, and eventually succeeded if the payment is successful.

gritty rampart
#

That's what I'm doing

#

I don't need it in processing, rather requires_capture

#

My normal flow is:

  1. User checks out (no PI is created)
  2. 5 days before fulfillment date, the PI is created and authed.
  3. On fulfillment date, the PI is captured, barring the user has completed the necessary requirements to get paid.

Things get thrown for a loop when we need to handle 3DS.

I know it needs 3DS handling at step #2 as it gets put into the requires_action state.

My hope is to notify the user, send them to a client-side page on my site, and have them do the 3DS check.

Then, step #2 runs again, auths them, and it follows the normal payment flow.

hushed radish
#

You just need to handle 3DS in step 2, once the PI is in require_capture, no 3DS is needed anymore.

gritty rampart
#

That's what I'm doing here and I'm getting this error.

hushed radish
gritty rampart
#

I know how PIs flow, but that doesn't resolve this problem.

#

How can I just handle 3DS for a PI without confirming?

hushed radish
#

No

#

Maybe I'm missing something, what's your concern on confirming a PI?

gritty rampart
#

I've already expressed it, sorry if I'm not being clear.

I currently confirm PIs server-side. Tied in with that is business specific processes and flows that takes place when that happens.

It'd be a massive refactor to confirm client-side and I'm not even entirely sure if it'd work for our flow.

I just need user to do 3DS auth so the PI can flow from the requires_action state to requires_confirmation, then the app will handle things normally from there.

#

Previous discussions here lead me to believe that was possible.

#

Basically, my app normally flows requires_confirmation->requires_capture, but 3DS put a kink in that, so handling just 3DS and handling things normal after that point will dovetail the best.

hushed radish
#

Ok, I get it now

gritty rampart
#

Sorry, it's a bit abnormal of a flow ๐Ÿ˜…

hushed radish
#

Then you should set confirmation_method to manual when creating a PaymentIntent.

gritty rampart
#

I am already doing that.

hushed radish
#

So that you can call handleCardAction

#

No you didn't, You only set capture_method to manual

gritty rampart
#

OH

#

Sorry, I misread.

#

Let me give that a try.

#

While I'm trying that, is it possible to update existing PIs from automatic->manual?

hushed radish
#

No you can't

gritty rampart
#

Weird, now it goes into a requires_payment_method state, instead of requires_action

#

and the PI is failed

#

PI ID: pi_3OequaKq0PhFh4nt1S3KJnHo

hushed radish
#

Which test card are you using?

gritty rampart
#

4000000000003220

#

So, it should let me do 3DS

#

But now that the conf method is manual, it just immediately declines

#

Oh wait

#

It's probably because this is off_session, right?

hushed radish
#

Can you remove the beta header and try agian?

gritty rampart
#

I need to move it to being on session

#

the orders_beta?

hushed radish
#

Yes

gritty rampart
#

Okay, sec

#

Yeah, still doing it

#

I believe it's because I'm off session

#

Testing that now

#

Yeah, I had to reconfirm the PI on session

#

Still testing the manual change...

#

sec

#

THERE WE GO

#

Think the manual thing was it

#
  • needing to confirm on session
#

Okay, so my flow for 3DS is basically this now:

  1. Create PI
  2. Attempt to confirm PI off session
  3. PI confirmation is declined and is moved to the requires_payment_method state
  4. Notify user about auth failure
  5. When user is client-side, attempt to reconfirm the PI, this time on session and the PI is moved to requires_action
  6. Utilize handleCardAction client side for the user to go through the 3DS check and the PI is moved to requires_confirmation
  7. Reconfirm payment, this time off session again, but the 3DS has been confirmed
  8. Capture payment
#

Does that make sense?

#

Any potential problems you see?

gritty rampart
#

๐Ÿ‘€

hushed radish
#

Look good to me

gritty rampart
#

Sweet, just testing a few other payment flows after moving confirmation_method to manual and all seems fine.

I don't seem to notice any changes since it seems like we were already doing things manually, but do you know of any major differences we should be aware making that switch?

hushed radish
#

You mean what's the difference between manual confimraiotn vs auto confirmation?

gritty rampart
#

Yeah, the Stripe docs outline it a bit, but the nitty gritty of it would be great

hushed radish
#

The key difference is that a PI with confirmation_method=automatic can be confirmed with a publishable key (i.e., from frontend), whereas a a PI with confirmation_method=manual can only be confirmed with a secret key (i.e., from backend)

gritty rampart
#

SICK

#

That's actually even better for me

#

as I only confirm server-side

#

Yay!

#

Thank you so much for your help!

#

I know it was a bit confusing, but appreciate you sitting through it with me to get it figured out!

#

You rock!