encode<V> static method

V encode<V>(
  1. SetupIntentPaymentMethodOptions instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  SetupIntentPaymentMethodOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.acssDebit != null) {
    SetupIntentPaymentMethodOptionsAcssDebit.encode(
      instance.acssDebit!,
      container.nestedSingleValueContainer('acss_debit').encoder,
    );
  }
  if (instance.card != null) {
    SetupIntentPaymentMethodOptionsCard.encode(
      instance.card!,
      container.nestedSingleValueContainer('card').encoder,
    );
  }
  if (instance.link != null) {
    SetupIntentPaymentMethodOptionsLink.encode(
      instance.link!,
      container.nestedSingleValueContainer('link').encoder,
    );
  }
  if (instance.paypal != null) {
    SetupIntentPaymentMethodOptionsPaypal.encode(
      instance.paypal!,
      container.nestedSingleValueContainer('paypal').encoder,
    );
  }
  if (instance.sepaDebit != null) {
    SetupIntentPaymentMethodOptionsSepaDebit.encode(
      instance.sepaDebit!,
      container.nestedSingleValueContainer('sepa_debit').encoder,
    );
  }
  if (instance.usBankAccount != null) {
    SetupIntentPaymentMethodOptionsUsBankAccount.encode(
      instance.usBankAccount!,
      container.nestedSingleValueContainer('us_bank_account').encoder,
    );
  }
  return container.value;
}