From 3ae790f322901b80a311db8444b1876c74b9d1f8 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Wed, 5 Apr 2017 11:35:54 -0400 Subject: [PATCH] CRM-20388 - ensure connection errors are properly reported to user. --- CRM/Core/Payment/PayflowPro.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Core/Payment/PayflowPro.php b/CRM/Core/Payment/PayflowPro.php index a250deb845..0a914317ba 100644 --- a/CRM/Core/Payment/PayflowPro.php +++ b/CRM/Core/Payment/PayflowPro.php @@ -268,6 +268,10 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * Payment successfully sent to gateway - process the response now */ $result = strstr($responseData, "RESULT"); + if (empty($result)) { + return self::errorExit(9016, "No RESULT code from PayPal."); + } + $nvpArray = array(); while (strlen($result)) { // name @@ -524,6 +528,9 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { break; } } + if ($responseHeaders['http_code'] != 200) { + return self::errorExit(9015, "Error connecting to the payflo API server."); + } /* * Transaction submitted - -- 2.25.1