Stripe 3D Secure when Saving Cards for future payments
Asked Answered
O

4

7

Is it possible to use 3D Secure when saving cards for future payments?

From Stripe's docs, https://stripe.com/docs/sources/three-d-secure. This seems to be the way to do it.

However according to the documentation, it's no longer recommended and to use PaymentIntents instead:

Use of this API is no longer recommended. If you wish to use 3D Secure we strongly encourage you to adopt PaymentIntents, our new payments API.

So with that, is there a way to use PaymentIntents (to utilize 3D secure) to just save a card without making a payment immediately?

Ottoottoman answered 12/2, 2019 at 9:1 Comment(3)
I'm not sure your question makes sense. A Payment Intent is explicitly an attempt to collect payment, and 3D Secure only happens when you make a payment. If you're just saving the card without making a payment, you would create a source using stripe.js's stripe.createSource like in Step 1 of your link, and save it to a customer object. Then, later, if you want to charge the card you can create a Payment Intent. stripe.com/docs/payments/payment-intents/…Isostasy
Our use case is that we want to save the customer's cards for future charges and these future charges will be done automatically in our server's background so we can't get 3d secure info from our customers at that future time. So we want to utilize 3D secure authentication during saving of cards. I've asked stripe support about this and they said 3D secure for saving cards without making a payment is currently not supported.Ottoottoman
Hi @Ottoottoman I'm trying to achieve the same thing, have you find a way to do this with payment intent?Redmon
B
1

Use the SetupIntent API, which are basically PaymentIntent with a null amount (same workflow).

Brotherton answered 22/8, 2019 at 13:30 Comment(0)
R
5

just to let you know, I have contacted the Stripe support as I get the same concern as you, here the answer:

[...] PaymentIntents currently does not support creating sources without also creating a charge thereafter. It's also not possible to integrate 3DSecure with the current method of saving credit cards unfortunately.

PaymentIntents is a fairly new Stripe product and we're still working out the kinks and deciding what functionality we'll support down the line. Saving sources is definitely high on our priority list and there'll be more information on this update in the future.

I tried to get more info about their roadmap to know if the feature will be released by september, but the support could not give me the info.

Edit: stripe has improve its documentation and now explaining how to implement what you want while respecting the SCA https://stripe.com/docs/payments/cards/saving-cards#saving-card-without-payment and https://stripe.com/docs/payments/cards/charging-saved-cards

Redmon answered 26/3, 2019 at 7:27 Comment(1)
Please have a look at the other answer here.. I'm also trying to figure out the same thing.. :/Fowl
C
2

Is it possible to use 3D Secure when saving cards for future payments?

What I do using PaymentIntents is to create a customer and then make the payment:

customer = stripe.Customer.create(

payment = stripe.PaymentIntent.create(customer=customer_id, ....

In payment you have the card type payment['charges']['data'][0]['payment_method_details']['card']['brand'] and the last 4 digits of the card payment['charges']['data'][0]['payment_method_details']['card']['last4']

You can store locally the customer_id, the card type and the last 4 digits to show them to that customer next time. To make another payment you only need to use stripe.PaymentIntent.create() with the customer.id you saved the first time. If the customer wants to use another card just do

customer = stripe.Customer.modify(
                customer_id,
                source=token_id
           )

token_id comes from stripe.js in your frontend

Cotsen answered 1/4, 2019 at 14:52 Comment(4)
From what I understood, this answer contradicts the other one which just got a reply from Stripe's support that this was not possible :) It seems logical that you should be able to store a card's "metadata" with the Customer, and the PaymentIntent can be created later from this and only then it triggers the 3D-Secure 2.0 step. But does it actually work? :)Fowl
I think you didn't get the use case: what author (and everyone involved in this topic) wants to achieve is: Saving a customer card with 3D secure enabled one day, then charge the card later. This is the case when you want to build a custom subscription system and because the provided subscription system does not fit your needs. Currently it seems PaymentIntents does not support this use case. We are all aware that you can create a PaymentIntents, that will charge "immediately" the card, and save this card for other later paymentsRedmon
When you create the customer you are sending a token_id from stripe.js after the user write his card number, so the customer you create in Stripe has the card information. After this you have the ID of the customer so you are able to create a PaymentIntent with the charge you want to make. For me is working in test mode, the only problem I have now is that I don't receive the message from the iframe when 3DSecure is needed, but the payments are in the stripe dashboard :)Cotsen
What I don't know if author is talking about saving cards locally or in stripe. I think at the beginning applications saved cards locally and from time ago, we dont save and don't want to save cards locally. I think that the answer from support is talking about saving cards locally, PaymentIntents is intended to not save cards locally but on their systems.Cotsen
B
1

Use the SetupIntent API, which are basically PaymentIntent with a null amount (same workflow).

Brotherton answered 22/8, 2019 at 13:30 Comment(0)
X
0

Set setup_future_usage='off_session' when creating a payment intent.

stripe.PaymentIntent.create(
  amount=1099,
  currency='usd',
  setup_future_usage='off_session',
)

These stripe docs show how to save a card in a way that should allow future "off_session" payments for cards which use 3D Secure.

https://stripe.com/docs/payments/payment-intents#future-usage

enter image description here

Xanthine answered 6/5, 2022 at 0:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.