flutter_flexible_pay

Last updated:

0 purchases

flutter_flexible_pay Image
flutter_flexible_pay Images
Add to Cart

Description:

flutter flexible pay

flutter_flexible_pay #

Make Stripe payments via Google pay & Apple Pay across the globe with ease Supports IOS & Android Payment Request API.
Personally, I love simplicity!



 
 
 










Usage #
AndroidManifest #
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true" />
copied to clipboard
Load the payment configurations like so; #

import 'package:flutter_flexible_pay/flutter_flexible_pay.dart';

/// This example file was used to implement stripe payment
/// For other payment, remove "stripe:*" key occurrences and replace with "gatewayMerchantId"
/// See project example to see the contents of payment_profile_google_pay.json &
/// payment_profile_apple_pay.json in the example assets' folder
Future<void> loadConfiguration() async {
Map<String, dynamic> profiles = {
'google': 'assets/configurations/payment_profile_google_pay.json',
'apple': 'assets/configurations/payment_profile_apple_pay.json',
};
FlutterFlexiblePay.setPaymentConfig(profiles);
}

@override
void initState() {
super.initState();
loadConfiguration();
}
copied to clipboard
Make Payments like so; #

_makePayment(dynamic product) async {
var environment = 'test'; // or 'production'
if (!(await FlutterFlexiblePay.isAvailable(environment))) {
_showToast(scaffoldContext, "Google or Apple Pay Not Available on this device!");
} else {

PaymentItem product = PaymentItem(
countryCode: "US",
currencyCode: "USD",
amount: product["amount"], // string
label: product["name"], // the product name or label
);

FlutterFlexiblePay.makePayment(product).then((Result result) {
if (result.status == ResultStatus.SUCCESS) {
_showToast(scaffoldContext, result.description);
}

if(result.status == ResultStatus.RESULT_CANCELED) {
_showToast(scaffoldContext, result.error);
}

if(result.status == ResultStatus.ERROR) {
_showToast(scaffoldContext, result.error);
}

if(result.status == ResultStatus.UNKNOWN) {
_showToast(scaffoldContext, 'Unknown Error');
}
}).catchError((dynamic error) {
_showToast(scaffoldContext, error.toString());
});
}
}

copied to clipboard
Doc for creating custom payment data: #
This goes into your .json file
Google Pay

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.