#daniel89fg
1 messages · Page 1 of 1 (latest)
👋 Hi,
You should save the customer card in your integration, and give your customer the possibility to re-use that card later without entering its details.
You can follow this guide for further details:
https://stripe.com/docs/payments/save-during-payment?platform=web
Correct, that guide is the one I followed to achieve it, but I have the problem of duplicate cards. I'm working on localhost (not https), so I don't see the saved cards to be able to select them, I can only add new card. And then it gets duplicated as many times as you do.
Ok, so you are using Stripe Elements in you integration? are you specifying the customerId while creating the PayementIntent ?
Yes, I am specifying the client id. The payment intent is saved fine, the card is saved in the customer fine. I can make the payment successfully. But the card is always duplicated in the client.
Could you please share an example PaymentIntent Id?
$intent = PaymentIntent::create([ 'customer' => $stripeCustomer->id, 'setup_future_usage' => 'off_session', 'amount' => $invoice->total * 100, 'currency' => $invoice->coddivisa, 'automatic_payment_methods' => [ 'enabled' => 'true', ], 'statement_descriptor' => 'factura.city', 'description' => 'Factura #' . $invoice->codigo, 'metadata' => [ 'factura' => $invoice->codigo, ], ]);
Following that guide, when charging a saved PaymentMethod later, you need to specify confirm:true and off_session:true in the next PaymentIntent:
https://stripe.com/docs/payments/save-during-payment?platform=web&html-or-react=html#charge-saved-payment-method
Here you are creating a PaymentIntent like you are charging the customer the first time
When you do this, you charge the customer without asking him to enter his card details again
Right, that's what I want. The client pays the 1st time and I save their data. When the customer pays another bill, the card is added back to their customer account.
That is to charge the customer later. But before that, I'm in the 1st payment. 1º pay once and we save your data, then I charge you automatically. The problem is when the customer comes to pay manually again, puts his existing card in his account and adds the card again. I have a client with the same card 6 times.
I give an example:
- Invoice 1: The customer pays it manually, the payment is made correctly and we save the card in the customer's account.
- Invoice 2: Now the customer returns to pay another invoice manually, he puts the same card that he already has in his account. The charge is made correctly and the card is added back to the customer's account.
That is to charge the customer later.
The goal of the guide is that in fact, to charge the customer when he comes back for the second time.
The problem is when the customer comes to pay manually again
If the customer paid already once, in the UI you need to display to him and choose to pay with the last payment method or to enter a new one. If he choose to pay with the previous used card so you charge it directly. If not, you ask him to enter his new card
Correct. If the customer chooses to choose a new card, and puts the same card that is already saved, what Stripe does is add the repeated card back to the customer's account.
In that case, its expected yes, if the user choose to enter again the same card details and not using the option to pay with their saved and previously used card (which is the same)
I understand. It would be nice if the development team took this into account for an improvement. If the customer adds a card that he already has in his account, he does not add the card again.
Thank you very much for your feedback, we'll see what we can do internally about that. Could you please share you accountId to keep you posted if there will be any update ?