encode<V> static method

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

Implementation

static V encode<V>(
  SetupIntentCard instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.mandateOptions != null) {
    SetupIntentMandateOptions.encode(
      instance.mandateOptions!,
      container.nestedSingleValueContainer('mandate_options').encoder,
    );
  }
  if (instance.moto != null) {
    container.encodeBool(
      'moto',
      instance.moto!,
    );
  }
  if (instance.network != null) {
    PaymentIntentNetwork.encode(
      instance.network!,
      container.nestedSingleValueContainer('network').encoder,
    );
  }
  if (instance.requestThreeDSecure != null) {
    CheckoutCardPaymentMethodOptionsRequestThreeDSecure.encode(
      instance.requestThreeDSecure!,
      container.nestedSingleValueContainer('request_three_d_secure').encoder,
    );
  }
  if (instance.threeDSecure != null) {
    SetupIntentThreeDSecure.encode(
      instance.threeDSecure!,
      container.nestedSingleValueContainer('three_d_secure').encoder,
    );
  }
  return container.value;
}