apple_pay_flutter 0.0.6
apple_pay_flutter: ^0.0.6 copied to clipboard

Apple Pay (payment and digital wallet service by Apple Inc) to Flutter.

apple_pay_flutter #

Accept Payments with Apple Pay.

Usage #

  import 'package:apple_pay_flutter/apple_pay_flutter.dart';

  Future<void> makePayment() async {

    // To store apple payment data
    dynamic applePaymentData;

    // List of items with label & price
    List<PaymentItem> paymentItems = [
      PaymentItem(label: 'Label', amount: 1.00,shippingcharge: 2.00)
    ];

    try {
        // initiate payment
        applePaymentData = await ApplePayFlutter.makePayment(
            countryCode: "US",
            currencyCode: "SAR",
            paymentNetworks: [
                PaymentNetwork.visa,
                PaymentNetwork.mastercard,
                PaymentNetwork.amex,
                PaymentNetwork.mada
            ],
            merchantIdentifier: "merchant.demo.tech.demoApplePayId",
            paymentItems: paymentItems,
            customerEmail: "demo.user@business.com",
            customerName: "Demo User",
            companyName: "Demo Company",
        
        );

        // This logs the Apple Pay response data
        print(applePaymentData.toString());

        } on PlatformException {
            print('Failed payment');
        }
     }

1
likes
80
pub points
45%
popularity

Apple Pay (payment and digital wallet service by Apple Inc) to Flutter.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on apple_pay_flutter