stripe_apple_pay

Creator: coderz1093

Last updated:

0 purchases

stripe_apple_pay Image
stripe_apple_pay Images

Languages

Categories

Add to Cart

Description:

stripe apple pay

Stripe Apple Pay #
Create chargeable stripe tokens using Apple Pay.
This plugin allows you to easily charge a user using Apple Pay and get a token that can be sent to Stripe to complete the purchase.
Setup #
iOS Merchant Identifier #
On the Apple Developer portal, create a merchant identifier. This identifier will need to be associated with
your Stripe project and added to your projects capabilities in Xcode. Check out Stripe's documentation
for detailed instructions.
Set Publishable Key #
Setting your project's publishable key is required before calling any of the plugin's methods.
StripeApplePay.instance.setPublishableKey("YOUR_STRIPE_PUBLISHABLE_KEY");
copied to clipboard
Set Merchant Identifier #
Setting your merchant identifier is required before calling any of the plugin's methods.
StripeApplePay.instance.setMerchantIdentifier("YOUR_MERCHANT_IDENTIFIER");
copied to clipboard
Set Currency Key (optional) #
You can change the currency used in the payment sheet by calling the following methods and passing a ISO currency and country code
StripeApplePay.instance.setCurrencyKey("MXN");
StripeApplePay.instance.setCountryKey("MX");
copied to clipboard
Collect payments #
To collect a payment create an order containing the order items, merchant name, and optionally a tax or tip. Call presentApplePay to present the payment sheet to the user.
This function will return a token, which can be sent to Stripe to complete the purchase. Once the purchase has been completed call confirmPayment to let the user know wether the
purchase was successful.
import 'package:stripe_apple_pay/stripe_apple_pay.dart';

// ...
@override
Widget build(context) {
// ApplePayButton is optional
return ApplePayButton(
onPressed: () async {
final order = ApplePayOrder(merchantName: 'Hat Store', items: [ApplePayItem(label: 'Top Hat', amount: 5.00)]);
final token = await StripeNative.useNativePay(order);
// Send token to stripe to complete the purchase
StripeApplePay.instance.confirmPayment(true);
}
);
}

copied to clipboard
Google Pay #
I suggest using the pay package to use Google Pay with Stripe.
Acknowledgments #
This plugin uses code from the following packages:

pay
stripe_native

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.