encode<V> static method
Implementation
static V encode<V>(
SessionMandateOptions instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.customMandateUrl != null) {
container.encodeString(
'custom_mandate_url',
instance.customMandateUrl!,
);
}
if (instance.defaultFor != null) {
container.encodeList(
'default_for',
(container) => instance.defaultFor!.forEach(
(el) => CheckoutAcssDebitMandateOptionsDefaultForItem.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
if (instance.intervalDescription != null) {
container.encodeString(
'interval_description',
instance.intervalDescription!,
);
}
if (instance.paymentSchedule != null) {
MandateAcssDebitPaymentSchedule.encode(
instance.paymentSchedule!,
container.nestedSingleValueContainer('payment_schedule').encoder,
);
}
if (instance.transactionType != null) {
MandateAcssDebitTransactionType.encode(
instance.transactionType!,
container.nestedSingleValueContainer('transaction_type').encoder,
);
}
return container.value;
}