SetupIntent constructor

const SetupIntent({
  1. required String id,
  2. @Default("setup_intent") String object,
  3. String? application,
  4. @JsonKey(name: "attach_to_self") String? attachToSelf,
  5. @JsonKey(name: "cancellation_reason") SetupIntentCancellationReason? cancellationReason,
  6. @JsonKey(name: "client_secret") required String clientSecret,
  7. int? created,
  8. String? customer,
  9. String? description,
  10. @JsonKey(name: "flow_directions") List<SetupIntentFlowDirections>? flowDirections,
  11. @JsonKey(name: "last_setup_error") dynamic lastSetupError,
  12. @JsonKey(name: "latest_attempt") String? latestAttempt,
  13. @Default(true) bool livemode,
  14. String? mandate,
  15. @Default({}) Map<String, dynamic> metadata,
  16. @JsonKey(name: "next_action") dynamic nextAction,
  17. @JsonKey(name: "on_behalf_of") String? onBehalfOf,
  18. @JsonKey(name: "payment_method") String? paymentMethod,
  19. @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions,
  20. @JsonKey(name: "payment_method_types") @Default([]) List<PaymentMethodType> paymentMethodTypes,
  21. @JsonKey(name: "single_use_mandate") String? singleUseMandate,
  22. required SetupIntentsStatus status,
  23. @Default(SetupIntentUsage.offSession) SetupIntentUsage usage,
})

Implementation

const factory SetupIntent({
  /// Unique identifier for the object.
  required String id,

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

  /// CONNECT ONLY
  /// ID of the Connect application that created the SetupIntent.
  String? application,

  /// If present, the SetupIntent’s payment method will be attached to
  /// the in-context Stripe Account.
  /// It can only be used for this Stripe Account’s own money movement
  /// flows like InboundTransfer and OutboundTransfers.
  /// It cannot be set to true when setting up a PaymentMethod for a Customer,
  /// and defaults to false when attaching a PaymentMethod to a Customer.
  @JsonKey(name: "attach_to_self") String? attachToSelf,

  /// Reason for cancellation of this SetupIntent,
  /// one of abandoned, requested_by_customer, or duplicate.
  @JsonKey(name: "cancellation_reason")
  SetupIntentCancellationReason? cancellationReason,

  /// The client secret of this SetupIntent.
  /// Used for client-side retrieval using a publishable key.
  /// The client secret can be used to complete payment setup from your frontend.
  /// It should not be stored, logged, or exposed to anyone other than the
  /// customer. Make sure that you have TLS enabled on any page that includes
  /// the client secret.
  @JsonKey(name: "client_secret") required String clientSecret,

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

  /// The ID of the Customer this SetupIntent belongs to.
  String? customer,

  /// An arbitrary string attached to the object.
  /// Often useful for displaying to users.
  String? description,

  /// Indicates the directions of money movement for which this payment
  /// method is intended to be used.
  /// Include inbound if you intend to use the payment method as
  /// the origin to pull funds from.
  /// Include outbound if you intend to use the payment method as
  /// the destination to send funds to.
  /// You can include both if you intend to use the payment
  ///  method for both purposes
  @JsonKey(name: "flow_directions")
  List<SetupIntentFlowDirections>? flowDirections,

  /// The error encountered in the previous SetupIntent confirmation.
  @JsonKey(name: "last_setup_error") dynamic lastSetupError,

  /// The most recent SetupAttempt for this SetupIntent.
  @JsonKey(name: "latest_attempt") String? latestAttempt,

  /// 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,

  /// ID of the multi use Mandate generated by the SetupIntent.
  String? mandate,

  /// 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,

  /// If present, this property tells you what actions you need to
  /// take in order for your customer to continue payment setup.
  @JsonKey(name: "next_action") dynamic nextAction,

  /// CONNECT ONLY
  /// The account (if any) for which the setup is intended.
  @JsonKey(name: "on_behalf_of") String? onBehalfOf,

  /// ID of the payment method used in this SetupIntent.
  @JsonKey(name: "payment_method") String? paymentMethod,

  /// Payment-method-specific configuration for this SetupIntent.
  @JsonKey(name: "payment_method_options") dynamic paymentMethodOptions,

  /// The list of payment method types (e.g. card) that this SetupIntent
  /// is allowed to set up.
  @JsonKey(name: "payment_method_types")
  @Default([])
  List<PaymentMethodType> paymentMethodTypes,

  /// ID of the single_use Mandate generated by the SetupIntent.
  @JsonKey(name: "single_use_mandate") String? singleUseMandate,

  /// Status of this SetupIntent, one of requires_payment_method,
  /// requires_confirmation, requires_action, processing, canceled, or
  /// succeeded.
  required SetupIntentsStatus status,

  /// Indicates how the payment method is intended to be used in the future.
  /// Use on_session if you intend to only reuse the payment method when
  /// the customer is in your checkout flow.
  ///  Use off_session if your customer may or may not be in your checkout flow.
  ///  If not provided, this value defaults to off_session.
  @Default(SetupIntentUsage.offSession) SetupIntentUsage usage,
}) = _SetupIntent;