Validate transaction additional response variables

Created on 13 September 2024, 3 months ago

Problem/Motivation

When processing an XML response from a cccomplete request, the elavonPost method in src\Plugin\Commerce\PaymentGateway\Onsite does not currently verify whether the ssl_result or ssl_issuer_response variables contain error codes https://www.drupal.org/files/issues/2024-09-13/elavon-transaction-respon... .

I'm wondering if the code should check for these variables to ensure the transaction is genuinely successful before concluding the process.

Additionally, I would like to understand why this $response['status'] was commented:

if (!empty($result)) {
  // Extract the result into an XML response object.
  $xml = new \SimpleXMLElement($result);
  $response['msg'] = (string) $xml->ssl_result_message;
  //$response['status'] = ((string) $xml->ssl_result_message === 'APPROVAL') ? TRUE : FALSE;
  // Request approved, Save original xml response containing all the data.
  $response['raw'] = $result;
  $response['xml'] = $xml;
}
else {
  \Drupal::logger('commerce_elavon')->error('cURL error empty result returned.');
  $response['status'] = FALSE;
  $response['msg'] = t('No answer from server');
}

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇧🇷Brazil igorbarato

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024