From 563f9ed510db719b68e721e711353c48ca620336 Mon Sep 17 00:00:00 2001 From: Al Twohill Date: Tue, 17 Jan 2012 13:46:22 +1300 Subject: [PATCH] Changed behaviour to not delete transactions that failed, but mark them as cancelled --- code/EWayPaymentController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/EWayPaymentController.php b/code/EWayPaymentController.php index cab8e1f..d02324d 100644 --- a/code/EWayPaymentController.php +++ b/code/EWayPaymentController.php @@ -43,7 +43,7 @@ public function submit($request) { //Allow for lax SSL (the library on the web server seems a bit iffy) curl_setopt( $ch , CURLOPT_SSL_VERIFYPEER , false ); curl_setopt( $ch , CURLOPT_SSL_VERIFYHOST , false ); - + $rawResponse = curl_exec($ch); $response = simplexml_load_string($rawResponse); @@ -95,7 +95,8 @@ public function handle_response($request) { $this->redirect($config->EWay_ReturnPage()->Link($config->EWay_ReturnAction)); } else { - $this->payment->delete(); + $this->payment->Status = "Cancelled"; + $this->payment->write(); $this->redirect($config->EWay_CancelPage()->Link($config->EWay_CancelAction)); } } else {