PaymentMethod constructor

  1. @JsonSerializable(explicitToJson: true)
const PaymentMethod({
  1. required String id,
  2. @Default("payment_method") String object,
  3. BillingDetails? billingDetails,
  4. String? customer,
  5. @Default({}) Map<String, dynamic> metadata,
  6. @Default(true) bool livemode,
  7. int? created,
  8. CardPaymentMethod? card,
  9. SepaDebit? sepaDebit,
  10. BacsDebit? bacsDebit,
  11. AuBecsDebit? auBecsDebit,
  12. Sofort? sofort,
  13. Ideal? ideal,
  14. Fpx? fpx,
  15. Upi? upi,
  16. UsBankAccount? usBankAccount,
  17. required PaymentMethodType type,
})

Implementation

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

  /// String representing the object’s type.
  /// Objects of the same type share the same value.
  @Default("payment_method") String object,

  /// Billing information associated with the PaymentMethod that may be used
  /// or required by particular types of payment methods.
  BillingDetails? billingDetails,

  /// The ID of the Customer to which this PaymentMethod is saved.
  /// This will not be set when the PaymentMethod has not been saved to a
  /// Customer.
  String? customer,

  /// Set of key-value pairs that you can attach to an object.
  /// This can be useful for storing additional information about the object
  /// in a structured format.
  @Default({}) Map<String, dynamic> metadata,

  /// Has the value true if the object exists in live mode or the value false
  /// if the object exists in test mode.
  @Default(true) bool livemode,

  /// Time at which the object was created.
  /// Measured in seconds since the Unix epoch.
  int? created,

  /// Containing additional data in case paymentmethod type is card.
  CardPaymentMethod? card,

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

  SepaDebit? sepaDebit,

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

  BacsDebit? bacsDebit,

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

  AuBecsDebit? auBecsDebit,

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

  Sofort? sofort,

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

  Ideal? ideal,

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

  Fpx? fpx,

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

  Upi? upi,
  UsBankAccount? usBankAccount,

  /// The type of the PaymentMethod.
  /// An additional hash is included on the PaymentMethod with a name
  /// matching this value.
  /// It contains additional information specific to the PaymentMethod type.
  required PaymentMethodType type,
}) = _PaymentMethod;