#Guilherme Barros - save card
1 messages · Page 1 of 1 (latest)
Howdy 👋
let me take a look at that issue.
That person is describing use of a payment intent, but you're asking about saving without a payment. Can you clarify exactly the flow you are trying to achieve?
If you want to save a card (or other payment method) without a payment, you should be using setup intents (not payment intents) as described in this guide:
https://stripe.com/docs/payments/save-and-reuse?platform=react-native&ui=payment-sheet
Note the switch to using setupIntentClientSecret:
const { error } = await initPaymentSheet({
customerId: customer,
customerEphemeralKeySecret: ephemeralKey,
setupIntentClientSecret: setupIntent,
});
If the last comment on the github issue is from you, then that also indicates you are taking a payment.
If you want to save the card for future while collecting an initial payment then you must indicate this using setup_future_usage as described here:
https://stripe.com/docs/payments/save-during-payment?platform=react-native&ui=payment-sheet
In this scenario, there is no change needed in the client application, you indicate this when creating the payment intent:
const paymentIntent = await stripe.paymentIntents.create({
amount: 1099,
currency: 'eur',
customer: customer.id,
**setup_future_usage: true,**
payment_method_types: ['card'],
});