encode<V> static method

V encode<V>(
  1. CheckoutCustomerBalancePaymentMethodOptions instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  CheckoutCustomerBalancePaymentMethodOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.bankTransfer != null) {
    CheckoutCustomerBalanceBankTransferPaymentMethodOptions.encode(
      instance.bankTransfer!,
      container.nestedSingleValueContainer('bank_transfer').encoder,
    );
  }
  container.encodeString(
    'funding_type',
    'bank_transfer',
  );
  if (instance.setupFutureUsage != null) {
    container.encodeString(
      'setup_future_usage',
      'none',
    );
  }
  return container.value;
}