toJson method

Map<String, dynamic> toJson()

Converts this request object into a JSON-encodable format.

Implementation

Map<String, dynamic> toJson() => {
      if (clientToken != null) 'clientToken': clientToken,
      if (tokenizationKey != null) 'tokenizationKey': tokenizationKey,
      if (email != null) 'email': email,
      if (billingAddress != null) 'billingAddress': billingAddress!.toJson(),
      if (amount != null) 'amount': amount,
      'collectDeviceData': collectDeviceData,
      'requestThreeDSecureVerification': requestThreeDSecureVerification,
      if (googlePaymentRequest != null) 'googlePaymentRequest': googlePaymentRequest!.toJson(),
      if (paypalRequest != null) 'paypalRequest': paypalRequest!.toJson(),
      if (applePayRequest != null) 'applePayRequest': applePayRequest!.toJson(),
      'venmoEnabled': venmoEnabled,
      'cardEnabled': cardEnabled,
      'paypalEnabled': cardEnabled,
      'maskCardNumber': maskCardNumber,
      'maskSecurityCode': maskSecurityCode,
      'vaultManagerEnabled': vaultManagerEnabled,
    };