flutter_google_pay 0.1.3+3 copy "flutter_google_pay: ^0.1.3+3" to clipboard
flutter_google_pay: ^0.1.3+3 copied to clipboard

outdated

Porting of Google Pay (a digital wallet platform and online payment system) to Flutter.

flutter_google_pay #

pub

Accept Payments with Android Pay using the Payment Request API.

Usage #

  import 'package:flutter_google_pay/flutter_google_pay.dart';
  
  
  _makePayment() async {
    var environment = "test";  /// or production 
    
    if (!(await FlutterGooglePay.isAvailable(environment))) {
       //_showToast(context, 'Google pay not available');
    } else {
      bool customData = false;
      if (!customData) {
        PaymentItem pm = PaymentItem(
               stripeToken: 'pk_test_1IV5H8NyhgGYOeK6vYV3Qw8f',
               stripeVersion: "2018-11-08",
               currencyCode: "usd",
               amount: "0.10",
               gateway: 'stripe');
        FlutterGooglePay.makePayment(pm).then((Result result) {
          if (result.status == ResultStatus.SUCCESS) {
            //Success!
          }
        }).catchError((error) {
          //unresolved error
        });
      } 
    }
  }
  
  //or
   _makeCustomPayment() async {
     var environment = "test";  /// or production 
     
     if (!(await FlutterGooglePay.isAvailable(environment))) {
       _showToast(context, 'Google pay not available');
     } else {
         var jsonPayment = Map();
         FlutterGooglePay.makeCustomPayment(jsonPayment).then((dynamic result) {
           if (result.status == ResultStatus.SUCCESS) {
             //Success!
           }
         }).catchError((error) {
           //unresolved error
         });
     }
  }
  

Doc for creating custom payment data: #

Google Pay

7
likes
30
pub points
63%
popularity

Publisher

unverified uploader

Porting of Google Pay (a digital wallet platform and online payment system) to Flutter.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_google_pay