mapToPayWithToken method

Map<String, dynamic> mapToPayWithToken()

Implementation

Map<String, dynamic> mapToPayWithToken() {
  final Map<String, dynamic> data = {
    'amount': amount,
    'terminalId': terminalId,
    'merchantId': merchantId,
    'currencyCode': currencyCode,
    'transactionId': transactionId,
    'clientMail': clientMail,
    'customerId': customerId,
    'customerTokenId': customerTokenId,
  };
  // Only include CVV if it's not empty (when ignoreCVV is false)
  if (cvV2.isNotEmpty) {
    data['cvV2'] = cvV2;
  }
  if (merchantReference != null) {
    data['merchantReference'] = merchantReference;
  }
  return data;
}