save card for future use #825
Unanswered
shereefhamed
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Is it possible to save payment methods & retrieve them for future use ? I'd like to create an onboarding UI in my app where the customer payment card details are saved while not processing any payment |
Beta Was this translation helpful? Give feedback.
0 replies
-
I assume we need SetupIntent instead of PaymentIntent and initialize payment sheet with setupintent but I haven't tried it yet |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to use PaymentSheet
first I create intent payment by this code:
Map<String, dynamic> body = {
'amount': amount,
'currency': currency,
'payment_method_types[]': 'card',
'setup_future_usage': 'off_session',
};
final url = Uri.parse(StripeService.paymentApiUrl);
var response = await http.post(
url,
body: body,
headers: StripeService.headers,
);
then I use client secret to display payment sheet
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret: paymentIntent['client_secret'],
merchantDisplayName: 'My name',
applePay: true,
googlePay: true,
billingDetails: billingDetails,
merchantCountryCode: 'EG',
));
await Stripe.instance.presentPaymentSheet();
how can I save card info after payment completed
Beta Was this translation helpful? Give feedback.
All reactions