encode<V> static method
Implementation
static V encode<V>(
PaymentIntentPaymentMethodOptionsCardInstallments instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.availablePlans != null) {
container.encodeList(
'available_plans',
(container) => instance.availablePlans!
.forEach((el) => PaymentMethodDetailsCardInstallmentsPlan.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
container.encodeBool(
'enabled',
instance.enabled,
);
if (instance.plan != null) {
PaymentIntentPaymentMethodOptionsCardInstallmentsPlan.encode(
instance.plan!,
container.nestedSingleValueContainer('plan').encoder,
);
}
return container.value;
}