encode<V> static method

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

Implementation

static V encode<V>(
  SetupIntentPaymentMethodOptionsCard instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.mandateOptions != null) {
    SetupIntentPaymentMethodOptionsCardMandateOptions.encode(
      instance.mandateOptions!,
      container.nestedSingleValueContainer('mandate_options').encoder,
    );
  }
  if (instance.network != null) {
    PaymentIntentPaymentMethodOptionsCardNetwork.encode(
      instance.network!,
      container.nestedSingleValueContainer('network').encoder,
    );
  }
  if (instance.requestThreeDSecure != null) {
    InvoicePaymentMethodOptionsCardRequestThreeDSecure.encode(
      instance.requestThreeDSecure!,
      container.nestedSingleValueContainer('request_three_d_secure').encoder,
    );
  }
  return container.value;
}