encode<V> static method

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

Implementation

static V encode<V>(
  CheckoutCardPaymentMethodOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.installments != null) {
    CheckoutCardInstallmentsOptions.encode(
      instance.installments!,
      container.nestedSingleValueContainer('installments').encoder,
    );
  }
  container.encodeString(
    'request_three_d_secure',
    instance.requestThreeDSecure,
  );
  if (instance.setupFutureUsage != null) {
    CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage.encode(
      instance.setupFutureUsage!,
      container.nestedSingleValueContainer('setup_future_usage').encoder,
    );
  }
  if (instance.statementDescriptorSuffixKana != null) {
    container.encodeString(
      'statement_descriptor_suffix_kana',
      instance.statementDescriptorSuffixKana!,
    );
  }
  if (instance.statementDescriptorSuffixKanji != null) {
    container.encodeString(
      'statement_descriptor_suffix_kanji',
      instance.statementDescriptorSuffixKanji!,
    );
  }
  return container.value;
}