encode<V> static method
Implementation
static V encode<V>(
PaymentMethodConfiguration instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.acssDebit != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.acssDebit!,
container.nestedSingleValueContainer('acss_debit').encoder,
);
}
container.encodeBool(
'active',
instance.active,
);
if (instance.affirm != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.affirm!,
container.nestedSingleValueContainer('affirm').encoder,
);
}
if (instance.afterpayClearpay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.afterpayClearpay!,
container.nestedSingleValueContainer('afterpay_clearpay').encoder,
);
}
if (instance.alipay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.alipay!,
container.nestedSingleValueContainer('alipay').encoder,
);
}
if (instance.applePay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.applePay!,
container.nestedSingleValueContainer('apple_pay').encoder,
);
}
if (instance.application != null) {
container.encodeString(
'application',
instance.application!,
);
}
if (instance.auBecsDebit != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.auBecsDebit!,
container.nestedSingleValueContainer('au_becs_debit').encoder,
);
}
if (instance.bacsDebit != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.bacsDebit!,
container.nestedSingleValueContainer('bacs_debit').encoder,
);
}
if (instance.bancontact != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.bancontact!,
container.nestedSingleValueContainer('bancontact').encoder,
);
}
if (instance.blik != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.blik!,
container.nestedSingleValueContainer('blik').encoder,
);
}
if (instance.boleto != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.boleto!,
container.nestedSingleValueContainer('boleto').encoder,
);
}
if (instance.card != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.card!,
container.nestedSingleValueContainer('card').encoder,
);
}
if (instance.cartesBancaires != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.cartesBancaires!,
container.nestedSingleValueContainer('cartes_bancaires').encoder,
);
}
if (instance.cashapp != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.cashapp!,
container.nestedSingleValueContainer('cashapp').encoder,
);
}
if (instance.customerBalance != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.customerBalance!,
container.nestedSingleValueContainer('customer_balance').encoder,
);
}
if (instance.eps != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.eps!,
container.nestedSingleValueContainer('eps').encoder,
);
}
if (instance.fpx != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.fpx!,
container.nestedSingleValueContainer('fpx').encoder,
);
}
if (instance.giropay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.giropay!,
container.nestedSingleValueContainer('giropay').encoder,
);
}
if (instance.googlePay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.googlePay!,
container.nestedSingleValueContainer('google_pay').encoder,
);
}
if (instance.grabpay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.grabpay!,
container.nestedSingleValueContainer('grabpay').encoder,
);
}
container.encodeString(
'id',
instance.id,
);
if (instance.ideal != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.ideal!,
container.nestedSingleValueContainer('ideal').encoder,
);
}
container.encodeBool(
'is_default',
instance.isDefault,
);
if (instance.jcb != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.jcb!,
container.nestedSingleValueContainer('jcb').encoder,
);
}
if (instance.klarna != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.klarna!,
container.nestedSingleValueContainer('klarna').encoder,
);
}
if (instance.konbini != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.konbini!,
container.nestedSingleValueContainer('konbini').encoder,
);
}
if (instance.link != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.link!,
container.nestedSingleValueContainer('link').encoder,
);
}
container.encodeBool(
'livemode',
instance.livemode,
);
container.encodeString(
'name',
instance.name,
);
container.encodeString(
'object',
'payment_method_configuration',
);
if (instance.oxxo != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.oxxo!,
container.nestedSingleValueContainer('oxxo').encoder,
);
}
if (instance.p24 != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.p24!,
container.nestedSingleValueContainer('p24').encoder,
);
}
if (instance.parent != null) {
container.encodeString(
'parent',
instance.parent!,
);
}
if (instance.paynow != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.paynow!,
container.nestedSingleValueContainer('paynow').encoder,
);
}
if (instance.paypal != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.paypal!,
container.nestedSingleValueContainer('paypal').encoder,
);
}
if (instance.promptpay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.promptpay!,
container.nestedSingleValueContainer('promptpay').encoder,
);
}
if (instance.revolutPay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.revolutPay!,
container.nestedSingleValueContainer('revolut_pay').encoder,
);
}
if (instance.sepaDebit != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.sepaDebit!,
container.nestedSingleValueContainer('sepa_debit').encoder,
);
}
if (instance.sofort != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.sofort!,
container.nestedSingleValueContainer('sofort').encoder,
);
}
if (instance.usBankAccount != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.usBankAccount!,
container.nestedSingleValueContainer('us_bank_account').encoder,
);
}
if (instance.wechatPay != null) {
PaymentMethodConfigResourcePaymentMethodProperties.encode(
instance.wechatPay!,
container.nestedSingleValueContainer('wechat_pay').encoder,
);
}
return container.value;
}