encode<V> static method

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

Implementation

static V encode<V>(
  PaymentIntentCreateOptionsPaymentMethodOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.acssDebit != null) {
    PaymentIntentCreateOptionsPaymentMethodOptionsAcssDebit.encode(
      instance.acssDebit!,
      container.nestedSingleValueContainer('acss_debit').encoder,
    );
  }
  if (instance.affirm != null) {
    PaymentIntentAffirm.encode(
      instance.affirm!,
      container.nestedSingleValueContainer('affirm').encoder,
    );
  }
  if (instance.afterpayClearpay != null) {
    PaymentIntentAfterpayClearpay.encode(
      instance.afterpayClearpay!,
      container.nestedSingleValueContainer('afterpay_clearpay').encoder,
    );
  }
  if (instance.alipay != null) {
    PaymentIntentAlipay.encode(
      instance.alipay!,
      container.nestedSingleValueContainer('alipay').encoder,
    );
  }
  if (instance.auBecsDebit != null) {
    PaymentIntentCreateOptionsPaymentMethodOptionsAuBecsDebit.encode(
      instance.auBecsDebit!,
      container.nestedSingleValueContainer('au_becs_debit').encoder,
    );
  }
  if (instance.bacsDebit != null) {
    PaymentIntentCreateOptionsPaymentMethodOptionsAuBecsDebit.encode(
      instance.bacsDebit!,
      container.nestedSingleValueContainer('bacs_debit').encoder,
    );
  }
  if (instance.bancontact != null) {
    PaymentIntentBancontact.encode(
      instance.bancontact!,
      container.nestedSingleValueContainer('bancontact').encoder,
    );
  }
  if (instance.blik != null) {
    PaymentIntentBlik.encode(
      instance.blik!,
      container.nestedSingleValueContainer('blik').encoder,
    );
  }
  if (instance.boleto != null) {
    PaymentIntentBoleto.encode(
      instance.boleto!,
      container.nestedSingleValueContainer('boleto').encoder,
    );
  }
  if (instance.card != null) {
    PaymentIntentCard.encode(
      instance.card!,
      container.nestedSingleValueContainer('card').encoder,
    );
  }
  if (instance.cardPresent != null) {
    PaymentIntentCardPresent.encode(
      instance.cardPresent!,
      container.nestedSingleValueContainer('card_present').encoder,
    );
  }
  if (instance.cashapp != null) {
    PaymentIntentCashapp.encode(
      instance.cashapp!,
      container.nestedSingleValueContainer('cashapp').encoder,
    );
  }
  if (instance.customerBalance != null) {
    SessionCustomerBalance.encode(
      instance.customerBalance!,
      container.nestedSingleValueContainer('customer_balance').encoder,
    );
  }
  if (instance.eps != null) {
    PaymentMethodOptionsZip.encode(
      instance.eps!,
      container.nestedSingleValueContainer('eps').encoder,
    );
  }
  if (instance.fpx != null) {
    PaymentMethodOptionsZip.encode(
      instance.fpx!,
      container.nestedSingleValueContainer('fpx').encoder,
    );
  }
  if (instance.giropay != null) {
    PaymentMethodOptionsZip.encode(
      instance.giropay!,
      container.nestedSingleValueContainer('giropay').encoder,
    );
  }
  if (instance.grabpay != null) {
    PaymentMethodOptionsZip.encode(
      instance.grabpay!,
      container.nestedSingleValueContainer('grabpay').encoder,
    );
  }
  if (instance.ideal != null) {
    PaymentIntentAlipay.encode(
      instance.ideal!,
      container.nestedSingleValueContainer('ideal').encoder,
    );
  }
  if (instance.interacPresent != null) {
    container.encodePrimitive(
      'interac_present',
      instance.interacPresent!,
    );
  }
  if (instance.klarna != null) {
    PaymentIntentCreateOptionsPaymentMethodOptionsKlarna.encode(
      instance.klarna!,
      container.nestedSingleValueContainer('klarna').encoder,
    );
  }
  if (instance.konbini != null) {
    PaymentIntentKonbini.encode(
      instance.konbini!,
      container.nestedSingleValueContainer('konbini').encoder,
    );
  }
  if (instance.link != null) {
    PaymentIntentLink.encode(
      instance.link!,
      container.nestedSingleValueContainer('link').encoder,
    );
  }
  if (instance.mobilepay != null) {
    PaymentIntentMobilepay.encode(
      instance.mobilepay!,
      container.nestedSingleValueContainer('mobilepay').encoder,
    );
  }
  if (instance.oxxo != null) {
    SessionKonbini.encode(
      instance.oxxo!,
      container.nestedSingleValueContainer('oxxo').encoder,
    );
  }
  if (instance.p24 != null) {
    SessionP24.encode(
      instance.p24!,
      container.nestedSingleValueContainer('p24').encoder,
    );
  }
  if (instance.paynow != null) {
    PaymentMethodOptionsZip.encode(
      instance.paynow!,
      container.nestedSingleValueContainer('paynow').encoder,
    );
  }
  if (instance.paypal != null) {
    SessionPaypal.encode(
      instance.paypal!,
      container.nestedSingleValueContainer('paypal').encoder,
    );
  }
  if (instance.pix != null) {
    PaymentIntentPix.encode(
      instance.pix!,
      container.nestedSingleValueContainer('pix').encoder,
    );
  }
  if (instance.promptpay != null) {
    PaymentMethodOptionsZip.encode(
      instance.promptpay!,
      container.nestedSingleValueContainer('promptpay').encoder,
    );
  }
  if (instance.revolutPay != null) {
    PaymentIntentAlipay.encode(
      instance.revolutPay!,
      container.nestedSingleValueContainer('revolut_pay').encoder,
    );
  }
  if (instance.sepaDebit != null) {
    PaymentIntentCreateOptionsPaymentMethodOptionsSepaDebit.encode(
      instance.sepaDebit!,
      container.nestedSingleValueContainer('sepa_debit').encoder,
    );
  }
  if (instance.sofort != null) {
    PaymentIntentCreateOptionsPaymentMethodOptionsSofort.encode(
      instance.sofort!,
      container.nestedSingleValueContainer('sofort').encoder,
    );
  }
  if (instance.swish != null) {
    PaymentIntentSwish.encode(
      instance.swish!,
      container.nestedSingleValueContainer('swish').encoder,
    );
  }
  if (instance.usBankAccount != null) {
    PaymentIntentCreateOptionsPaymentMethodOptionsUsBankAccount.encode(
      instance.usBankAccount!,
      container.nestedSingleValueContainer('us_bank_account').encoder,
    );
  }
  if (instance.wechatPay != null) {
    SessionWechatPay.encode(
      instance.wechatPay!,
      container.nestedSingleValueContainer('wechat_pay').encoder,
    );
  }
  if (instance.zip != null) {
    PaymentMethodOptionsZip.encode(
      instance.zip!,
      container.nestedSingleValueContainer('zip').encoder,
    );
  }
  return container.value;
}