encode<V> static method

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

Implementation

static V encode<V>(
  CheckoutSessionPaymentMethodOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.acssDebit != null) {
    CheckoutAcssDebitPaymentMethodOptions.encode(
      instance.acssDebit!,
      container.nestedSingleValueContainer('acss_debit').encoder,
    );
  }
  if (instance.affirm != null) {
    CheckoutAffirmPaymentMethodOptions.encode(
      instance.affirm!,
      container.nestedSingleValueContainer('affirm').encoder,
    );
  }
  if (instance.afterpayClearpay != null) {
    CheckoutAfterpayClearpayPaymentMethodOptions.encode(
      instance.afterpayClearpay!,
      container.nestedSingleValueContainer('afterpay_clearpay').encoder,
    );
  }
  if (instance.alipay != null) {
    CheckoutAlipayPaymentMethodOptions.encode(
      instance.alipay!,
      container.nestedSingleValueContainer('alipay').encoder,
    );
  }
  if (instance.auBecsDebit != null) {
    CheckoutAuBecsDebitPaymentMethodOptions.encode(
      instance.auBecsDebit!,
      container.nestedSingleValueContainer('au_becs_debit').encoder,
    );
  }
  if (instance.bacsDebit != null) {
    CheckoutBacsDebitPaymentMethodOptions.encode(
      instance.bacsDebit!,
      container.nestedSingleValueContainer('bacs_debit').encoder,
    );
  }
  if (instance.bancontact != null) {
    CheckoutBancontactPaymentMethodOptions.encode(
      instance.bancontact!,
      container.nestedSingleValueContainer('bancontact').encoder,
    );
  }
  if (instance.boleto != null) {
    CheckoutBoletoPaymentMethodOptions.encode(
      instance.boleto!,
      container.nestedSingleValueContainer('boleto').encoder,
    );
  }
  if (instance.card != null) {
    CheckoutCardPaymentMethodOptions.encode(
      instance.card!,
      container.nestedSingleValueContainer('card').encoder,
    );
  }
  if (instance.cashapp != null) {
    CheckoutCashappPaymentMethodOptions.encode(
      instance.cashapp!,
      container.nestedSingleValueContainer('cashapp').encoder,
    );
  }
  if (instance.customerBalance != null) {
    CheckoutCustomerBalancePaymentMethodOptions.encode(
      instance.customerBalance!,
      container.nestedSingleValueContainer('customer_balance').encoder,
    );
  }
  if (instance.eps != null) {
    CheckoutEpsPaymentMethodOptions.encode(
      instance.eps!,
      container.nestedSingleValueContainer('eps').encoder,
    );
  }
  if (instance.fpx != null) {
    CheckoutFpxPaymentMethodOptions.encode(
      instance.fpx!,
      container.nestedSingleValueContainer('fpx').encoder,
    );
  }
  if (instance.giropay != null) {
    CheckoutGiropayPaymentMethodOptions.encode(
      instance.giropay!,
      container.nestedSingleValueContainer('giropay').encoder,
    );
  }
  if (instance.grabpay != null) {
    CheckoutGrabPayPaymentMethodOptions.encode(
      instance.grabpay!,
      container.nestedSingleValueContainer('grabpay').encoder,
    );
  }
  if (instance.ideal != null) {
    CheckoutIdealPaymentMethodOptions.encode(
      instance.ideal!,
      container.nestedSingleValueContainer('ideal').encoder,
    );
  }
  if (instance.klarna != null) {
    CheckoutKlarnaPaymentMethodOptions.encode(
      instance.klarna!,
      container.nestedSingleValueContainer('klarna').encoder,
    );
  }
  if (instance.konbini != null) {
    CheckoutKonbiniPaymentMethodOptions.encode(
      instance.konbini!,
      container.nestedSingleValueContainer('konbini').encoder,
    );
  }
  if (instance.link != null) {
    CheckoutLinkPaymentMethodOptions.encode(
      instance.link!,
      container.nestedSingleValueContainer('link').encoder,
    );
  }
  if (instance.oxxo != null) {
    CheckoutOxxoPaymentMethodOptions.encode(
      instance.oxxo!,
      container.nestedSingleValueContainer('oxxo').encoder,
    );
  }
  if (instance.p24 != null) {
    CheckoutP24PaymentMethodOptions.encode(
      instance.p24!,
      container.nestedSingleValueContainer('p24').encoder,
    );
  }
  if (instance.paynow != null) {
    CheckoutPaynowPaymentMethodOptions.encode(
      instance.paynow!,
      container.nestedSingleValueContainer('paynow').encoder,
    );
  }
  if (instance.paypal != null) {
    CheckoutPaypalPaymentMethodOptions.encode(
      instance.paypal!,
      container.nestedSingleValueContainer('paypal').encoder,
    );
  }
  if (instance.pix != null) {
    CheckoutPixPaymentMethodOptions.encode(
      instance.pix!,
      container.nestedSingleValueContainer('pix').encoder,
    );
  }
  if (instance.revolutPay != null) {
    CheckoutRevolutPayPaymentMethodOptions.encode(
      instance.revolutPay!,
      container.nestedSingleValueContainer('revolut_pay').encoder,
    );
  }
  if (instance.sepaDebit != null) {
    CheckoutSepaDebitPaymentMethodOptions.encode(
      instance.sepaDebit!,
      container.nestedSingleValueContainer('sepa_debit').encoder,
    );
  }
  if (instance.sofort != null) {
    CheckoutSofortPaymentMethodOptions.encode(
      instance.sofort!,
      container.nestedSingleValueContainer('sofort').encoder,
    );
  }
  if (instance.swish != null) {
    CheckoutSwishPaymentMethodOptions.encode(
      instance.swish!,
      container.nestedSingleValueContainer('swish').encoder,
    );
  }
  if (instance.usBankAccount != null) {
    CheckoutUsBankAccountPaymentMethodOptions.encode(
      instance.usBankAccount!,
      container.nestedSingleValueContainer('us_bank_account').encoder,
    );
  }
  return container.value;
}