encode<V> static method

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

Implementation

static V encode<V>(
  PaymentMethodCardCardDetailsParams instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.cvc != null) {
    container.encodeString(
      'cvc',
      instance.cvc!,
    );
  }
  container.encodeInt(
    'exp_month',
    instance.expMonth,
  );
  container.encodeInt(
    'exp_year',
    instance.expYear,
  );
  if (instance.networks != null) {
    PaymentMethodNetworks.encode(
      instance.networks!,
      container.nestedSingleValueContainer('networks').encoder,
    );
  }
  container.encodeString(
    'number',
    instance.number,
  );
  return container.value;
}