PaymentParameters constructor

PaymentParameters(
  1. {@required Amount amount,
  2. @required String purchaseName,
  3. @required String purchaseDescription,
  4. @required String clientApplicationKey,
  5. SavePaymentMethodMode savePaymentMethodMode = SavePaymentMethodMode.userSelects,
  6. List<PaymentMethod> paymentMethods = const [PaymentMethod.bankCard],
  7. String gatewayId,
  8. String returnUrl,
  9. String userPhoneNumber,
  10. IosTestModeSettings iosTestModeSettings,
  11. bool isLoggingEnabled,
  12. IosColorScheme iosColorScheme,
  13. String applePayMerchantIdentifier,
  14. AndroidTestModeSettings androidTestModeSettings,
  15. AndroidColorScheme androidColorScheme,
  16. String shopId,
  17. List<GooglePayCardNetwork> googlePayParameters}
)

Implementation

PaymentParameters({
  @required this.amount,
  @required this.purchaseName,
  @required this.purchaseDescription,
  @required this.clientApplicationKey,
  this.savePaymentMethodMode = SavePaymentMethodMode.userSelects,
  this.paymentMethods = const [PaymentMethod.bankCard],
  this.showYandexCheckoutLogo,
  this.gatewayId,
  this.returnUrl,
  this.userPhoneNumber,
  this.iosTestModeSettings,
  this.isLoggingEnabled,
  this.iosColorScheme,
  this.applePayMerchantIdentifier,
  this.androidTestModeSettings,
  this.androidColorScheme,
  this.shopId,
  this.googlePayParameters,
}) {
  assert(amount != null);
  assert(purchaseName != null);
  assert(purchaseDescription != null);
  assert(clientApplicationKey != null);
  if (Platform.isAndroid) {
    assert(shopId != null);
    if (paymentMethods.contains(PaymentMethod.googlePay)) {
      assert(googlePayParameters != null);
    }
  }
  if (Platform.isIOS) {
    if (paymentMethods.contains(PaymentMethod.applePay)) {
      assert(applePayMerchantIdentifier != null);
    }
  }
}