Skip to content

Commit

Permalink
Merge pull request #13 from RichardCardGate/master
Browse files Browse the repository at this point in the history
Fix: Callback email for latest version.
  • Loading branch information
cardgate authored May 8, 2023
2 parents 7587a77 + 2786c27 commit 8fa1167
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cardgate/classes/cardgate-clientlib-php/src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class Client {
/**
* Client version.
*/
const CLIENT_VERSION = "1.1.16";
const CLIENT_VERSION = "1.1.18";

/**
* Url to use for production.
Expand Down
10 changes: 3 additions & 7 deletions cardgate/classes/cardgate.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class cardgate {
*/
var $demoMode = false;
var $initParams = array ();
var $version = '1.5.7';
var $version = '1.5.8';
var $paymentTypes = array (
'CARDGATE_AFTERPAY' => 'afterpay',
'CARDGATE_BANCONTACT' => 'bancontact',
Expand Down Expand Up @@ -115,11 +115,7 @@ function pspRedirect($aOrderData = null) {
$sMerchantApiKey = CARDGATE_MERCHANT_API_KEY;
$bIsTest = (CARDGATE_TEST_MODE == 'true' ? true : false);
$sLanguage = $aOrderData ['language_code'];
if ($this->getMajorVersion () <= 4) {
$sPlatformVersion = 'xtCommerce4';
} else {
$sPlatformVersion = 'xtCommerce5';
}

$iSiteId = ( int ) CARDGATE_SITE_ID;
$iAmount = ( int ) round ( $order->order_total ['total'] ['plain'] * 100 );
$sCurrency = $aOrderData ['currency_code'];
Expand All @@ -142,7 +138,7 @@ function pspRedirect($aOrderData = null) {
$oCardGate->setIp ( $_SERVER ['REMOTE_ADDR'] );
$oCardGate->setLanguage ( $sLanguage );
$oCardGate->version ()->setPlatformName ( 'xtCommerce' );
$oCardGate->version ()->setPlatformVersion ( $sPlatformVersion );
$oCardGate->version ()->setPlatformVersion ( _SYSTEM_VERSION );
$oCardGate->version ()->setPluginName ( 'CardGate' );
$oCardGate->version ()->setPluginVersion ( $this->version );

Expand Down
9 changes: 2 additions & 7 deletions plugins/cardgate/classes/class.cardgate.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class cardgate {
*/
var $demoMode = false;
var $initParams = array ();
var $version = '1.5.7';
var $version = '1.5.8';
var $paymentTypes = array (
'CARDGATE_AFTERPAY' => 'afterpay',
'CARDGATE_BANCONTACT' => 'bancontact',
Expand Down Expand Up @@ -120,11 +120,6 @@ function pspRedirect($aOrderData = null) {
$sMerchantApiKey = CARDGATE_MERCHANT_API_KEY;
$bIsTest = (CARDGATE_TEST_MODE == 'true' ? true : false);
$sLanguage = $aOrderData ['language_code'];
if ($this->getMajorVersion () <= 4) {
$sPlatformVersion = 'xtCommerce4';
} else {
$sPlatformVersion = 'xtCommerce5';
}
$iSiteId = ( int ) CARDGATE_SITE_ID;
$iAmount = ( int ) round ( $order->order_total ['total'] ['plain'] * 100 );
$sCurrency = $aOrderData ['currency_code'];
Expand All @@ -146,7 +141,7 @@ function pspRedirect($aOrderData = null) {
$oCardGate->setIp ( $_SERVER ['REMOTE_ADDR'] );
$oCardGate->setLanguage ( $sLanguage );
$oCardGate->version ()->setPlatformName ( 'xtCommerce' );
$oCardGate->version ()->setPlatformVersion ( $sPlatformVersion );
$oCardGate->version ()->setPlatformVersion (_SYSTEM_VERSION );
$oCardGate->version ()->setPluginName ( 'CardGate' );
$oCardGate->version ()->setPluginVersion ( $this->version );

Expand Down
Empty file modified plugins/cardgate/images/cg_logo.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified plugins/cardgate/installer/cardgate.xml
100755 → 100644
Empty file.
Empty file modified plugins/cardgate/installer/install.php
100755 → 100644
Empty file.
15 changes: 7 additions & 8 deletions plugins/cardgate/pages/cardgate_checkout.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
die ( 'Hashcheck failed!' );
}
} catch ( cardgate\api\Exception $oException_ ) {
die ( 'Hashckeck failed!' );
die ( 'Hashcheck failed!' );
}
}

// hashcheck has passed
// process order

$result = $db->Execute ( "SELECT ORDERID FROM " . TABLE_CARDGATE_TRANSACTION . " WHERE TRID = '" . $data ['reference'] . "' LIMIT 1" );
$fields = $result->fields;
$iOrderId = ( int ) $fields ['ORDERID'];
Expand All @@ -72,7 +72,7 @@
if (checkPaid ( $order )) {
die ( 'Payment already processed!' );
}

if ($data ['code'] == '0') {
$paymentState = 'PENDING';
}
Expand All @@ -97,12 +97,11 @@
), 'UPDATE', 'TRID="' . $data ['reference'] . '"' );
updateOrderPayment ( $iOrderId, $paymentState );
}

$strMsg = TEXT_CARDGATE_PAYMENT_COMMENT . ' ' . constant ( "TEXT_PAYMENT_CARDGATE_" . strtoupper ( $data ['pt'] ) );
;

$order->_sendOrderMail ();
$order->_updateOrderStatus ( CARDGATE_ORDER_STATUS_COMPLETED, $strMsg, 'true', 'true', 'user', $data ['transaction'] );
$order->_sendOrderMail ();

}

if ($paymentState == 'PENDING') {
Expand Down Expand Up @@ -196,7 +195,7 @@
function checkPaid($order) {
return ( bool ) ($order->order_data ['orders_status_id'] == CARDGATE_ORDER_STATUS_COMPLETED);
}
function updateOrderPayment($oid, $strOrderStatus, $callback_id='',$callback_messge='') {
function updateOrderPayment($oid, $strOrderStatus, $callback_id='',$callback_message='') {
$parts = explode ( '.', _SYSTEM_VERSION );
$iVersion = ( int ) $parts [0];

Expand Down
Empty file modified plugins/cardgate/templates/cardgate.html
100755 → 100644
Empty file.

0 comments on commit 8fa1167

Please sign in to comment.