encode<V> static method

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

Implementation

static V encode<V>(
  SourceTypeCardPresent instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.applicationCryptogram != null) {
    container.encodeString(
      'application_cryptogram',
      instance.applicationCryptogram!,
    );
  }
  if (instance.applicationPreferredName != null) {
    container.encodeString(
      'application_preferred_name',
      instance.applicationPreferredName!,
    );
  }
  if (instance.authorizationCode != null) {
    container.encodeString(
      'authorization_code',
      instance.authorizationCode!,
    );
  }
  if (instance.authorizationResponseCode != null) {
    container.encodeString(
      'authorization_response_code',
      instance.authorizationResponseCode!,
    );
  }
  if (instance.brand != null) {
    container.encodeString(
      'brand',
      instance.brand!,
    );
  }
  if (instance.country != null) {
    container.encodeString(
      'country',
      instance.country!,
    );
  }
  if (instance.cvmType != null) {
    container.encodeString(
      'cvm_type',
      instance.cvmType!,
    );
  }
  if (instance.dataType != null) {
    container.encodeString(
      'data_type',
      instance.dataType!,
    );
  }
  if (instance.dedicatedFileName != null) {
    container.encodeString(
      'dedicated_file_name',
      instance.dedicatedFileName!,
    );
  }
  if (instance.description != null) {
    container.encodeString(
      'description',
      instance.description!,
    );
  }
  if (instance.emvAuthData != null) {
    container.encodeString(
      'emv_auth_data',
      instance.emvAuthData!,
    );
  }
  if (instance.evidenceCustomerSignature != null) {
    container.encodeString(
      'evidence_customer_signature',
      instance.evidenceCustomerSignature!,
    );
  }
  if (instance.evidenceTransactionCertificate != null) {
    container.encodeString(
      'evidence_transaction_certificate',
      instance.evidenceTransactionCertificate!,
    );
  }
  if (instance.expMonth != null) {
    container.encodeInt(
      'exp_month',
      instance.expMonth!,
    );
  }
  if (instance.expYear != null) {
    container.encodeInt(
      'exp_year',
      instance.expYear!,
    );
  }
  if (instance.fingerprint != null) {
    container.encodeString(
      'fingerprint',
      instance.fingerprint!,
    );
  }
  if (instance.funding != null) {
    container.encodeString(
      'funding',
      instance.funding!,
    );
  }
  if (instance.iin != null) {
    container.encodeString(
      'iin',
      instance.iin!,
    );
  }
  if (instance.issuer != null) {
    container.encodeString(
      'issuer',
      instance.issuer!,
    );
  }
  if (instance.last4 != null) {
    container.encodeString(
      'last4',
      instance.last4!,
    );
  }
  if (instance.posDeviceId != null) {
    container.encodeString(
      'pos_device_id',
      instance.posDeviceId!,
    );
  }
  if (instance.posEntryMode != null) {
    container.encodeString(
      'pos_entry_mode',
      instance.posEntryMode!,
    );
  }
  if (instance.readMethod != null) {
    container.encodeString(
      'read_method',
      instance.readMethod!,
    );
  }
  if (instance.reader != null) {
    container.encodeString(
      'reader',
      instance.reader!,
    );
  }
  if (instance.terminalVerificationResults != null) {
    container.encodeString(
      'terminal_verification_results',
      instance.terminalVerificationResults!,
    );
  }
  if (instance.transactionStatusInformation != null) {
    container.encodeString(
      'transaction_status_information',
      instance.transactionStatusInformation!,
    );
  }
  return container.value;
}