#Ajay-Flutter
1 messages · Page 1 of 1 (latest)
@whole pivot
Not CheckOut just transaction
what is the "save card option" you refer to? can you explain in more detail what you expect to see and what you see instead?
@glossy moss
https://stripe.com/docs/saving-cards
ok! and what do you see in your app versus what you expected to see?
the option will be there if you're using the component with a Customer object and an ephemeral key configured.
yes i created Customer id and Ephemeral key in Nodejs and return those result to html
const appearance = { theme: 'stripe'}; //Card appearance stripe,flat,night
var elements = stripe.elements({ appearance, clientSecret: clientSecretValue});
const paymentElement = elements.create("payment");
paymentElement.mount("#payment-element"); //mount payment card
this is my HTML code where i pass customerId and ephemeral key in this HTML Code
yeah you are not using our Flutter library then.
your screenshot is not what you're actually using, it's entirely different.
you have to actually use https://pub.dev/packages/flutter_stripe , but it sounds like you just have a real web page ,using our Elements component, in a WebView. It's not the same thing at all.
Actually for Android and iOS save card feature works perfectly but for flutter web i'm using IFrame html
I'm using this package for android and ios
https://pub.dev/packages/flutter_stripe
yep! that's what I said.
the web UI is different and the saving cards feature works differently. The guide you'd want to work with to understand how it would work there, is https://stripe.com/docs/payments/save-during-payment?platform=web
i already refered this link you mentioned above but it not works
you'd need to be much more specific than "it not works" I'm afraid! What code did you use exactly, what did you expect to see on the page, what did you see instead?
for android ios I passed customer ID and ephemeral key like this
Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
customerId: paymentIntentData["stripeCustomerId"],
customerEphemeralKeySecret: paymentIntentData["ephemeralKey"],
paymentIntentClientSecret: paymentIntentData["token"],
googlePay: paymentIntentData["googlePay"],
applePay: paymentIntentData["applePay"],
merchantCountryCode: paymentIntentData["country"],
merchantDisplayName: paymentIntentData["name"],
currencyCode: paymentIntentData["currency"]));
so save card option available but for web i don't know where to pass those keys in html element
you don't, that integration doesn't use ephemeral keys, it's different.
it doesn't have a checkbox like that
instead, if you want the customer's card to be saved, you need to change the PaymentIntent you create on the backend, to set setup_future_usage on it — it's controlled by you calling the API, not by the customer like it is in iOS/Android. If you do that then the UI on the web will let the customer know their card will be saved.
https://stripe.com/docs/payments/save-during-payment?platform=web#web-create-payment-intent
so you can't have the same UI with a checkbox, sorry! But the guide I linked describes how all this works for the web.
it's something you'd have to build yourself, we don't have a component for it like we do in mobile.
you'd call https://stripe.com/docs/api/payment_methods/customer_list? on the backend to get a list of the cards, and then build your own UI on the webpage to show the details of the card, let the user pick one, and then call https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-existing with the ID of the one they picked.