encode<V> static method
V
encode<V>(
- TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails instance,
- Encoder<
V> encoder
Implementation
static V encode<V>(
TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails
instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.balance != null) {
container.encodeString(
'balance',
'payments',
);
}
TreasurySharedResourceBillingDetails.encode(
instance.billingDetails,
container.nestedSingleValueContainer('billing_details').encoder,
);
if (instance.financialAccount != null) {
ReceivedPaymentMethodDetailsFinancialAccount.encode(
instance.financialAccount!,
container.nestedSingleValueContainer('financial_account').encoder,
);
}
if (instance.issuingCard != null) {
container.encodeString(
'issuing_card',
instance.issuingCard!,
);
}
container.encodeString(
'type',
instance.type,
);
if (instance.usBankAccount != null) {
TreasurySharedResourceInitiatingPaymentMethodDetailsUsBankAccount.encode(
instance.usBankAccount!,
container.nestedSingleValueContainer('us_bank_account').encoder,
);
}
return container.value;
}