PaymentMethod constructor

  1. @JsonSerializable(explicitToJson: true)
const PaymentMethod({
  1. required String id,
  2. required bool livemode,
  3. required String paymentMethodType,
  4. required BillingDetails billingDetails,
  5. @JsonKey(name: 'Card') required Card card,
  6. @JsonKey(name: 'SepaDebit') required SepaDebit sepaDebit,
  7. @JsonKey(name: 'BacsDebit') required BacsDebit bacsDebit,
  8. @JsonKey(name: 'AuBecsDebit') required AuBecsDebit auBecsDebit,
  9. @JsonKey(name: 'Sofort') required Sofort sofort,
  10. @JsonKey(name: 'Ideal') required Ideal ideal,
  11. @JsonKey(name: 'Fpx') required Fpx fpx,
  12. @JsonKey(name: 'Upi') required Upi upi,
  13. @JsonKey(name: 'USBankAccount') required UsBankAccount usBankAccount,
  14. String? customerId,
})

Implementation

@JsonSerializable(explicitToJson: true)
const factory PaymentMethod({
  /// Unique identifier.
  required String id,

  /// Whether or not the object exists in livemode.
  required bool livemode,

  /// The type of the paymentmethod.
  required String paymentMethodType,

  /// Billing information related to the payment method.
  required BillingDetails billingDetails,

  /// Containing additional data in case paymentmethod type is card.
  @JsonKey(name: 'Card') required Card card,

  /// Containing additional data in case paymentmethod type is sepa.

  @JsonKey(name: 'SepaDebit') required SepaDebit sepaDebit,

  /// Containing additional data in case paymentmethod type is Bacs debit.

  @JsonKey(name: 'BacsDebit') required BacsDebit bacsDebit,

  /// Containing additional data in case paymentmethod type is Aubecs debit.

  @JsonKey(name: 'AuBecsDebit') required AuBecsDebit auBecsDebit,

  /// Containing additional data in case paymentmethod type is sofort.

  @JsonKey(name: 'Sofort') required Sofort sofort,

  /// Containing additional data in case paymentmethod type is Ideal.

  @JsonKey(name: 'Ideal') required Ideal ideal,

  /// Containing additional data in case paymentmethod type is FPX.

  @JsonKey(name: 'Fpx') required Fpx fpx,

  /// Containing additional data in case paymentmethod type is UPI.

  @JsonKey(name: 'Upi') required Upi upi,

  /// Containing additional data in case paymentmethod type is Us bank account.
  @JsonKey(name: 'USBankAccount') required UsBankAccount usBankAccount,

  /// Id related to the customer to which this paymentmethod has been saved.
  String? customerId,
}) = _PaymentMethod;