#kekk0 - 3DS

1 messages ยท Page 1 of 1 (latest)

unkempt pollen
#

Hi ๐Ÿ‘‹
What do you need help with?

dire dagger
#

I am testing cards with 3D secure on my app and i send to the user the link to confirm payment

#

but this happens all the time but i'd like to configure the paymet to go automatically

#

i always get payment_intent.requires_action on webhhok also with cards that are configurable to use in future without the 3D secure

#

4000002500003155

#

for example this card from test should be configured to use in future payments but in my code doesn't works automatically.

#

this is the log

#

{
"id": "pi_3Koqj3A94JJJ3znb1xcIbsfl",
"object": "payment_intent",
"amount": 300,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3Koqj3A94JJJ3znb1xcIbsfl_secret_37Dirq7SZibMvyk8cy4g0V3qK",
"confirmation_method": "automatic",
"created": 1650035181,
"currency": "eur",
"description": "Subscription update",
"last_payment_error": null,
"livemode": false,
"next_action": {
"type": "use_stripe_sdk",
"use_stripe_sdk": {
"type": "three_d_secure_redirect",
"stripe_js": "https://hooks.stripe.com/redirect/authenticate/src_1Koqj4A94JJJ3znbvJml4D0U?client_secret=src_client_secret_p6g2vt7Y9e5VhivNHcW9df69&source_redirect_slug=test_YWNjdF8xS2JVR2pBOTRKSkozem5iLF9MVnNVbFFQR0RaeVEyNFpTZmpBUzN5Q2ZyenlJQmt201006Mz6B92I",
"source": "src_1Koqj4A94JJJ3znbvJml4D0U"
}
},
"payment_method": "pm_1KopvyA94JJJ3znbqfQsNh3Q",
"payment_method_types": [
"card",
"sepa_debit"
],
"processing": null,
"receipt_email": null,
"setup_future_usage": "off_session",
"shipping": null,
"source": null,
"status": "requires_action"
}

unkempt pollen
#

Yup, 3155 is intended to always require authentication

dire dagger
#

My business is in italy europe, and i use a subscription for volume of quantity

#

and i bill every 10 days

#

how can i have card configured to have billing automatically? Is there a way?

#

My process of configuration is:

#
  1. Create user and attach payment method
#
  1. Register subscription
#

I saw here that if you use payment intent you can configure for future payment am i right?

#

Because is very bad for my business if users have to authorize throw app every single transaction

unkempt pollen
#

No you should be able to charge without additional authentication

dire dagger
#

so with what card i can test if my flow of configuration works?

unkempt pollen
#

That is the right card, I'm just looking for the docs to explain how you need to configure your subscriptions for off-session billing

#

It should be the default

#

Can you share a request ID for one of your test subscription creations?

#

Actually wait. When you create your user and attach a payment method, how are you doing that?

#

I think the customer creation/payment method step is where we can be most effective so let me know when you can tell me what is going on there

dire dagger
#

So, when i create a new custumer i use a backend function this two stripe methods

#

stripe.customers.create({
email: email,
description: context.auth?.uid,
name: name,
phone: phoneNumber,
})

#

and then

#

const setupIntent = await stripe.setupIntents.create({
customer: customer.id,
payment_method_types,
});

unkempt pollen
#

Okay, there the Setup Intent is where I think we can help

dire dagger
#

ok

unkempt pollen
#

Wait so you do or do not see authentication being required when you have the user confirm the setup intent?

dire dagger
#

No i dont

#

i only see it required when i process payments

#

using paymenth sheet (for buying elements) and when the subscription is billed

unkempt pollen
#

Okay so how are you collecting payment method details with the Setup Intent?

dire dagger
#

no sorry i was wrong

#

i see 3d secure

#

because i use (on client side ) confirmSetupIntent

#

await stripe.Stripe.instance.confirmSetupIntent(
clientSecret,
stripe.PaymentMethodParams.card(
setupFutureUsage: stripe.PaymentIntentsFutureUsage.OffSession,
billingDetails: billingDetails,
),
);

unkempt pollen
#

Okay, do you have a request ID I could take a look at

dire dagger
#

req_4GnB2SEpb05VZJ

#

and this is the confirm

#

req_V2qqlUA2qv1x3t

dire dagger
unkempt pollen
#

Okay so I am seeing that this card is configured for off_session usage

dire dagger
#

yes

unkempt pollen
#

And just to make sure I have all the info I need, can you share a request ID or subscription ID where you were asked for authentication again?

dire dagger
#

req_SeCAAhIhW970gl

#

here i used the webhook to send a notification to the user with the to complete the payment

unkempt pollen
#

I'm sorry but this isn't what I need. This is a /confirm request. I am looking for a subscription that should be automatically billed but wound up requiring authentication

dire dagger
#

you need the subscription Id?

#

sub_1KorvJA94JJJ3znbdk8jc6Jm

#

when i create the subscription i am never asked for the 3D secure

unkempt pollen
#

Right, I'm thinking more about when the invoice attempts to collect payment

dire dagger
#

req_s7bYeNkyMr7AXf

#

do you need log or activity of the webhook?

unkempt pollen
#

The webhook shouldn't matter here

dire dagger
#

because i see the invoice.created in webhook

unkempt pollen
dire dagger
#

ok i have tried before but i was still having the issue.

#

but is wrong that i doesnt have the log of invoice but only the webhook?

unkempt pollen
#

but is wrong that i doesnt have the log of invoice but only the webhook?
What do you mean by that? The invoice would get automatically created so you wouldn't see it in your API logs

dire dagger
#

Ok

#

so did you understand where is the problem?

dire dagger
unkempt pollen
#

You're not wrong. It should use the default for the customer. I'm still looking at these objects.

dire dagger
#

ok thankyou so much

unkempt pollen
#

Okay this Subscription only has a 0 balance so it's never charged. Is this one of your test ones using the 3155 card?

dire dagger
#

yes

#

but i add useage

#

for example look now

#

i added one item

unkempt pollen
#

Okay this shows the amount is paid. Were you required to provide 3DS authentication again?

dire dagger
unkempt pollen
#

We started this discussion because you were saying your test invoices were not being charged automatically due to additional 3DS authentication requirements. That does not appear to be the case with this invoice

dire dagger
#

if the invoice is empty i'm not asked

#

but if there is an amount i am always asked

unkempt pollen
#

There was an amount on the invoice you just created and it appears to have charged automatically

dire dagger
#

in this subscirption?

#

sub_1KorvJA94JJJ3znbdk8jc6Jm

unkempt pollen
#

This invoice: in_1KosFTA94JJJ3znbjIgMqOoC

dire dagger
#

yes

#

in this invoice i recived the requierd action status in the webhook

#

so my code send a push notification to user to pat for it

unkempt pollen
#

But the events occurred within seconds of each other. How did you go on-session to authenticate?

dire dagger
#

i send throw the push notification the hosted_invoice_url so the user can confirm the payment

#

and this was managed using the webhook, but this happends all the times and for my business that is based on smalls charges every 10 days is very bad

#

this 3D secure process because we bill when user is not using the app

#

for example now i didn't completed the 3D secure process

odd mango
#

@dire dagger I'm sorry we're having trouble following what you're describing unfortunately

dire dagger
#

so the problem is that i want to configure card to be used for the future without 3D secure

#

i've implemented all the process but i still recieve 3D secure actions requierements

#

for cards that as documentation said culd works without 3D secure when confiugured

#

why i am facing this issue?

odd mango
#

That's too vague unfortunately. Please provide a detailed and explicit example of where this happened again

dire dagger
#

so

odd mango
#

Please try all in one unique sentence, not numerous separate messages too.

dire dagger
#

what details you need

#

?

odd mango
#

Same thing as all your conversation before with my colleague. One clear summary of what is happening with a clear example invoice id (in_123), PaymentIntent id (pi_123) where you got 3DS to happen but didn't expect it

dire dagger
#

As you can see from this invoice in_1KosmKA94JJJ3znbgSuryB6U i am required to use 3D secure every time a payment is processed for the subscription (sub_1KorvJA94JJJ3znbdk8jc6Jm). My goal is to create paymenths Methods that does not require 3D secure every time to be processed.

odd mango
#

yes but that is the same issue you had earlier today. You still aren't passing off_session: true on Subscription update

dire dagger
#

so i must pass it when i create the subsctiption?

odd mango
#

No?

#

You must pass it when you are updating the subscription, if you want that payment to be off session

#

That's what my colleague explained earlier in details to you

#

Every single time a payment is triggered if it's not off session it will require 3DS with that specific Test card

dire dagger
#

so when i create a subscription then i have to update it with off_session: true ? am i right?

odd mango
#

Those are 2 completely different things. off_session is simply a parameter for a specific request. It doesn't apply to future changes. When you create the Subscription, your customer is on session. They are on your website or app and paying. So you don't pass off_session: true and you get them to do 3D Secure.

In the future, when you change their subscription, if they are on your website or app, they are still on session and you don't pass off_session: true either and you have to make them go through 3D Secure if the bank asks.

With that out of the way, the test card you're using explicitly requires 3DS always for on session payments. So that one will never skip 3DS, while in production it might since it's not always required. So if you want to simulate an upgrade without 3DS with that test card you have to pass off_session: true.

Similarly, if you change a customer subscription while they are not on session (not on your app or website) then you pass off_session: true since they are not here to do 3DS and you're the one initiating the charge/payment.

Ultimately, no matter what you do, it's all up to the bank. Banks will or won't require 3DS depending on many factors. You always have to plan for getting your customer to go through 3DS no matter what

#

Let me know if any of this is unclear!

dire dagger
#

My customer doesn't pay when create the subscription

#

because is a subscription based on value of consumption.

odd mango
#

you still need to collect their card details at some point, whenever that happens, this will be on session

dire dagger
#

i collect them before creating the subscription

#

and i pass setupFutureUsage: stripe.PaymentIntentsFutureUsage.OffSession,

odd mango
#

Sure, then you're good. But still, the bank might want 3DS, no matter what.

#

So pass off_session: true on Subscription creation or update, and you're good

dire dagger
#

const subscription: any = await stripe.subscriptions.create({
customer: customerId,
items: [
{
price: priceId,
},
],
off_session: true,
// expand: ["latest_invoice.payment_intent"],
});

#

this should work? Witch card i shuld use to test it?

odd mango
#

I'm sorry you still seem totally lost. This is still the creation. The creation works. There's nothing to change for the creation. What you need to change is the update code

#

so when you go and update the subscription right now, also add off_session: true and see it work

dire dagger
#

thankyou for your pacience, what do you mean for right now?

#

in the webhook, when is triggered something like customer.subsctiption.updated?

odd mango
#

customer.subscription.updated will happen every time the subscription is updated. So when you call https://stripe.com/docs/api/subscriptions/update for example or when the subscription renews each cycle, or when it changes status after a failed payment, etc.

dire dagger
#

and there i shuold update using off_session:true ?

odd mango
dire dagger
#

ok thanyou

odd mango
#

sure!

dire dagger
#

I'm sorry but my system is still not working, how can i get support with my code? I need to make possibility for automatic charge works or my business will not be efficent.

idle oak
#

koopajah had to step out for a bit. I am catching up here. What is the current error that you are seeing in your code?

#

Are you passing off_session: true in the update call?

dire dagger
#

yes in my webhook i have this code case "customer.subscription.updated": {
const subscriptionUpdated: any = event.data.object;

      const subscription = await stripe.subscriptions.update(
        subscriptionUpdated.id,
        {
          off_session: true,
        }
      );
#

and also before i create the subscription when i receive the pathemnt method, i create a setup intent with const setupIntent = await stripe.setupIntents.create({
customer: customer.id,
payment_method_types,
usage: "off_session",
confirm: true,
});

#

but when it time to pay the invoice i have always to use 3Dsecure as you can see from this invoice

#

in_1KouupA94JJJ3znbifIOarE5

idle oak
#

Thanks for the additional info, trying to see why you needed 3DS auth on that update...

#

Are you sure that that is a subscription that you created with that exact code?

dire dagger
#

I rebuild my code and deploy then i will send you new ids

idle oak
#

I can see it on some of your recent calls but not those ones.

#

Can you try running your code one more time right now and we can take a look at the newest Subscription+Invoice?

dire dagger
#

ok sure

#

This is the subscription

#

sub_1KowDAA94JJJ3znbF8t6XUev

#

in_1KowGlA94JJJ3znbvdYdJvqx

#

from the dashboard it says that now is configured for future usage, but if i create new invoices i need always to confirm 3Dsecure

#

this is the payment method pm_1KowBZA94JJJ3znbrPef3U1Q

odd mango
#

@dire dagger you sadly still never changed the code

#

I'm sorry but we spent many hours with you on that one question and you still have not made the one line code change 3 of us have told you multiple times

#

We really want to help, but we're reaching the limit of what we can do.

dire dagger
#

sorry but i've changed them

#

i've added all the code you told me

odd mango
#

you haven't though

#

you're still not passing off_session: true

dire dagger
#

i'm really sorry

#

i didn't mind about the code i use to force billing

#

i'm completly sorry

#

i'm so so sorry now i've tested with the curl code and added the off_session: true also there and works perfectly

odd mango
#

yay!

dire dagger
#

can i ask one last

#

question

#

now when it will bill automatically and not forced with my curl code will works?

odd mango
#

it should, but like I said earlier: it's up to the bank to ask for 3DS and it will always ask for it sometimes so you have to plan for it

dire dagger
#

yes of perfect, thank you so much for the amazing support. You guys make the difference! Best in class ๐Ÿฅณ

odd mango
#

Glad we could help ๐Ÿ™‚

dire dagger
#

Iโ€™m sure I was the toughest of the day ๐Ÿ˜‚๐Ÿ˜…

odd mango
#

hahaha

#

3DS can be tricky to grasp especially as some cards do a specific behaviour that doesn't happen in test mode