Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions custom/php/CRM/Core/Payment/Sagepay.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function doTransferCheckout(&$params, $component = 'contribute') {
if ($address['values'])
$address = reset($address['values']);
} catch (CiviCRM_API3_Exception $e) {
CRM_Core_Error::fatal('Unable to get billing address for the current contact: ' . $e->getMessage());
CRM_Core_Error::statusBounce('Unable to get billing address for the current contact: ' . $e->getMessage(), NULL, 'Sagepay');
}
}

Expand All @@ -213,7 +213,7 @@ public function doTransferCheckout(&$params, $component = 'contribute') {
'VendorTxCode' => $params['invoiceID'],
'Amount' => sprintf("%.2f", $params['amount']),
'Currency' => $params['currencyID'],
'Description' => substr($params['item_name'], 0, 100),
'Description' => 'Payment from CiviCRM',
'NotificationURL' => $notifyURL,
'FailureURL' => $notifyURL,
'BillingFirstnames' => $contact['first_name'],
Expand All @@ -237,6 +237,13 @@ public function doTransferCheckout(&$params, $component = 'contribute') {

];

if (isset($params['item_name'])) {
$registrationParams['Description'] = substr($params['item_name'], 0, 100);
}
elseif (isset($params['description'])) {
$registrationParams['Description'] = substr($params['description'], 0, 100);
}

// Require additional state params where country is US
if ($country_iso_code == 'US')
$registrationParams['DeliveryState'] =
Expand Down Expand Up @@ -300,7 +307,7 @@ public function doTransferCheckout(&$params, $component = 'contribute') {
$errmsg . "<br />Please contact the site administrator.";

// Display error(s)
CRM_Core_Error::fatal($errmsg);
CRM_Core_Error::statusBounce($errmsg, NULL, 'Sagepay');

}

Expand Down Expand Up @@ -512,7 +519,7 @@ protected function requestPost($url, $data){
]);

// Send request and split response into name/value pairs
$response = split(chr(10), curl_exec($session));
$response = explode(chr(10), curl_exec($session));

// Check that a connection was made
if (curl_error($session)){
Expand Down
17 changes: 6 additions & 11 deletions info.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<extension key="uk.co.circleinteractive.payment.sagepay" type="module">
<downloadUrl>http://extensions.circle-interactive.co.uk/uk.co.circleinteractive.payment.sagepay-v4.0.0.zip</downloadUrl>
<file>sagepay</file>
<name>Sagepay</name>
<description>Sagepay Payment Processor</description>
<description>Sagepay Payment Processor - Supports online payments only</description>
<urls>
<url desc="Main Extension Page">http://www.circle-interactive.co.uk</url>
<url desc="Main Extension Page">https://github.com/circleinteractive/uk.co.circleinteractive.payment.sagepay</url>
<url desc="Support">https://www.circle-interactive.co.uk</url>
</urls>
<license>GPL2</license>
<maintainer>
<author>Andrew Walker - Circle Interactive</author>
<email>andyw (at) circle-interactive (dot) co (dot) uk</email>
</maintainer>
<releaseDate>2016-08-01</releaseDate>
<version>4.0.0</version>
<releaseDate>2017-08-11</releaseDate>
<version>4.1</version>
<develStage>stable</develStage>
<compatibility>
<ver>4.2</ver>
<ver>4.3</ver>
<ver>4.4</ver>
<ver>4.5</ver>
<ver>4.6</ver>
<ver>4.7</ver>
</compatibility>
<comments>For support, please contact project team on the forums.</comments>
<comments></comments>
</extension>