requestApplePayNonce static method

Future<BraintreePaymentMethodNonce?> requestApplePayNonce(
  1. String authorization,
  2. BraintreeApplePayRequest request, {
  3. bool collectDeviceData = false,
})

Presents the native Apple Pay sheet and requests a payment method nonce.

iOS only. authorization must be either a valid client token or a valid tokenization key. request should contain all Apple Pay information.

Returns a Future that resolves to a BraintreePaymentMethodNonce if the user authorized the payment, or null if the Apple Pay sheet was canceled.

Implementation

static Future<BraintreePaymentMethodNonce?> requestApplePayNonce(
  String authorization,
  BraintreeApplePayRequest request, {
  bool collectDeviceData = false,
}) async {
  final result = await _kChannel.invokeMethod('requestApplePayNonce', {
    'authorization': authorization,
    'request': request.toJson(),
    'collectDeviceData': collectDeviceData,
  });
  if (result == null) return null;
  return BraintreePaymentMethodNonce.fromJson(result);
}