#kamon000
1 messages ยท Page 1 of 1 (latest)
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.
- kamon000, 6 days ago, 26 messages
handCardAction is depcrecated, you should use confirmCardPayment()
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?
Can you share with me the paymentIntent ID? and the code you wrote to handle 3DS?
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.
Do you have the full error message of stripe.handleCardAction ?
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.
OK, have you tried confirmCardPayment ?
Will that confirm/auth the PI, or does it only do 3DS?
I only want to handle the next PI action.
It will confirm the PI, but you can still capture it later if you set the PI's capture_method to manual
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.
Even if handleNextAction is executed successfully, it will also move the PI status to processing, and eventually succeeded if the payment is successful.
if the purpose is to hold the payment, you should use manual capture https://stripe.com/docs/payments/place-a-hold-on-a-payment-method
That's what I'm doing
I don't need it in processing, rather requires_capture
My normal flow is:
- User checks out (no PI is created)
- 5 days before fulfillment date, the PI is created and authed.
- 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.
You just need to handle 3DS in step 2, once the PI is in require_capture, no 3DS is needed anymore.
That's what I'm doing here and I'm getting this error.
https://stripe.com/docs/payments/paymentintents/lifecycle you can learn more about the PI lifecycle here.
I know how PIs flow, but that doesn't resolve this problem.
How can I just handle 3DS for a PI without confirming?
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.
Ok, I get it now
Sorry, it's a bit abnormal of a flow ๐
Then you should set confirmation_method to manual when creating a PaymentIntent.
I am already doing that.
So that you can call handleCardAction
No you didn't, You only set capture_method to manual
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?
No you can't
Weird, now it goes into a requires_payment_method state, instead of requires_action
and the PI is failed
PI ID: pi_3OequaKq0PhFh4nt1S3KJnHo
Which test card are you using?
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?
Can you remove the beta header and try agian?
Yes
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:
- Create PI
- Attempt to confirm PI off session
- PI confirmation is declined and is moved to the
requires_payment_methodstate - Notify user about auth failure
- When user is client-side, attempt to reconfirm the PI, this time on session and the PI is moved to
requires_action - Utilize
handleCardActionclient side for the user to go through the 3DS check and the PI is moved torequires_confirmation - Reconfirm payment, this time off session again, but the 3DS has been confirmed
- Capture payment
Does that make sense?
Any potential problems you see?
๐
Look good to me
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?
You mean what's the difference between manual confimraiotn vs auto confirmation?
Yeah, the Stripe docs outline it a bit, but the nitty gritty of it would be great
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)