encode<V> static method

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

Implementation

static V encode<V>(
  SetupIntentThreeDSecure instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.aresTransStatus != null) {
    PaymentIntentAresTransStatus.encode(
      instance.aresTransStatus!,
      container.nestedSingleValueContainer('ares_trans_status').encoder,
    );
  }
  if (instance.cryptogram != null) {
    container.encodeString(
      'cryptogram',
      instance.cryptogram!,
    );
  }
  if (instance.electronicCommerceIndicator != null) {
    PaymentIntentElectronicCommerceIndicator.encode(
      instance.electronicCommerceIndicator!,
      container
          .nestedSingleValueContainer('electronic_commerce_indicator')
          .encoder,
    );
  }
  if (instance.networkOptions != null) {
    PaymentIntentNetworkOptions.encode(
      instance.networkOptions!,
      container.nestedSingleValueContainer('network_options').encoder,
    );
  }
  if (instance.requestorChallengeIndicator != null) {
    container.encodeString(
      'requestor_challenge_indicator',
      instance.requestorChallengeIndicator!,
    );
  }
  if (instance.transactionId != null) {
    container.encodeString(
      'transaction_id',
      instance.transactionId!,
    );
  }
  if (instance.version != null) {
    PaymentIntentVersion.encode(
      instance.version!,
      container.nestedSingleValueContainer('version').encoder,
    );
  }
  return container.value;
}