encode<V> static method
Implementation
static V encode<V>(
ConfirmationTokenCreateOptions instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.expand != null) {
container.encodeList(
'expand',
(container) =>
instance.expand!.forEach((el) => container.encodeString(el)),
);
}
if (instance.paymentMethod != null) {
container.encodeString(
'payment_method',
instance.paymentMethod!,
);
}
if (instance.paymentMethodData != null) {
PaymentIntentPaymentMethodData.encode(
instance.paymentMethodData!,
container.nestedSingleValueContainer('payment_method_data').encoder,
);
}
if (instance.returnUrl != null) {
container.encodeString(
'return_url',
instance.returnUrl!,
);
}
if (instance.setupFutureUsage != null) {
SessionSetupFutureUsage.encode(
instance.setupFutureUsage!,
container.nestedSingleValueContainer('setup_future_usage').encoder,
);
}
if (instance.shipping != null) {
InvoiceShippingDetails.encode(
instance.shipping!,
container.nestedSingleValueContainer('shipping').encoder,
);
}
return container.value;
}