Unverified Commit 707727bd authored by rubofvil's avatar rubofvil Committed by GitHub
Browse files

Update RedsysIPN.php

Replace status failed with cancelled status (to get cancelled reason avalible)
parent 09c74f9b
...@@ -72,7 +72,7 @@ class CRM_Core_Payment_RedsysIPN extends CRM_Core_Payment_BaseIPN { ...@@ -72,7 +72,7 @@ class CRM_Core_Payment_RedsysIPN extends CRM_Core_Payment_BaseIPN {
} }
CRM_Core_Error::debug_log_message("Redsys IPN Response: About to cancel contr \n input: " . print_r($input, TRUE) . "\n ids: " . print_r($ids, TRUE) . "\n objects: " . print_r($objects, TRUE)); CRM_Core_Error::debug_log_message("Redsys IPN Response: About to cancel contr \n input: " . print_r($input, TRUE) . "\n ids: " . print_r($ids, TRUE) . "\n objects: " . print_r($objects, TRUE));
try { try {
civicrm_api3('contribution', 'create', array('id' => $input['contributionID'], 'contribution_status_id' => 'Failed', 'cancel_reason' => $input['reasonCode'])); civicrm_api3('contribution', 'create', array('id' => $input['contributionID'], 'contribution_status_id' => 'Cancelled', 'cancel_reason' => $input['reasonCode'], 'cancel_date' => date('Y-m-d')));
} }
catch (CiviCRM_API3_Exception $e) { catch (CiviCRM_API3_Exception $e) {
if($e->getMessage()) { if($e->getMessage()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment