You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently facing some issue on registering Apple Pay and Google Pay as payments methods. I want to know how to save a customer's payment method (in particular Apple Pay or Google Pay) for future use without making a purchase. In fact I successfully registered them and used via stripe.Stripe.instance.initPaymentSheet(), but this way I need to do a purchase, I successfully save a customer's payment method if it's a card with this codec inn front end and calling my backend in typescript:
Front END:
Future<String> createCustomerWithCard(
{required CurrentUser user, required UserData userData}) async {
try {
final UserData userDataUpdated =
await DatabaseUser(uid: userData.uid).getSingleUser;
// Call API
final HttpsCallableResult result =
await kApiStripeCreateCustomerWithCard.call(<String, dynamic>{
'customerId': userDataUpdated.billing.customerId.isNotEmpty
? userDataUpdated.billing.customerId
: 'false',
'email': userDataUpdated.profileUser.email,
'name':
'${userDataUpdated.profileUser.name} ${userDataUpdated.profileUser.surname}',
'phoneNumber': '${user.phoneNumber}',
});
final Map<String, dynamic> bodyResponse =
json.decode(json.encode(result.data));
if (kDebugMode) {
print(bodyResponse);
}
final clientSecret = bodyResponse['clientSecret'] as String;
return clientSecret;
} on FirebaseFunctionsException catch (e) {
if (kDebugMode) {
print('-----------------------------------------------');
print(e.code);
print(e.message);
print(e.details);
print('-----------------------------------------------');
}
return json.decode(json.encode(e.message!));
}
}
This discussion was converted from issue #1133 on March 04, 2023 14:12.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm currently facing some issue on registering Apple Pay and Google Pay as payments methods. I want to know how to save a customer's payment method (in particular Apple Pay or Google Pay) for future use without making a purchase. In fact I successfully registered them and used via
stripe.Stripe.instance.initPaymentSheet()
, but this way I need to do a purchase, I successfully save a customer's payment method if it's a card with this codec inn front end and calling my backend in typescript:Front END:
API EDNPOINT on backend:
Beta Was this translation helpful? Give feedback.
All reactions