From db1fb99b5234b62ebca0a0bd7f90cd9952a24bbf Mon Sep 17 00:00:00 2001
From: Bruce Atkinson
Date: Mon, 27 Sep 2021 07:16:22 +0200
Subject: [PATCH] 2021-09-27: v1.0.2
- Add payment types.
- Tested with 4.13.2.
---
README.md | 4 +-
changelog.txt | 16 ++
paygate/app/addons/paygate/addon.xml | 15 +-
paygate/app/addons/paygate/func.php | 66 +++---
.../app/addons/paygate/payments/paygate.php | 196 +++++++++++-------
.../components/cc_processors/paygate.tpl | 100 ++++++++-
.../orders/components/payments/paygate.tpl | 75 +++++++
paygate/images/paygate/mastercard-visa.svg | 1 +
paygate/images/paygate/masterpass.svg | 1 +
paygate/images/paygate/mobicred.svg | 1 +
paygate/images/paygate/momopay.svg | 1 +
paygate/images/paygate/paypal.svg | 1 +
paygate/images/paygate/sid.svg | 1 +
paygate/images/paygate/snapscan.svg | 1 +
paygate/images/paygate/zapper.svg | 1 +
15 files changed, 367 insertions(+), 113 deletions(-)
create mode 100755 changelog.txt
create mode 100644 paygate/design/themes/responsive/templates/views/orders/components/payments/paygate.tpl
create mode 100644 paygate/images/paygate/mastercard-visa.svg
create mode 100644 paygate/images/paygate/masterpass.svg
create mode 100644 paygate/images/paygate/mobicred.svg
create mode 100644 paygate/images/paygate/momopay.svg
create mode 100644 paygate/images/paygate/paypal.svg
create mode 100644 paygate/images/paygate/sid.svg
create mode 100644 paygate/images/paygate/snapscan.svg
create mode 100644 paygate/images/paygate/zapper.svg
diff --git a/README.md b/README.md
index f016bd9..462173e 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
# PayWeb_CSCart
-## PayGate CS-Cart plugin v1.0.1 for CS-Cart 4.7.4
+## PayGate CS-Cart plugin v1.0.2 for CS-Cart 4.13.2
This is the PayGate PayWeb3 plugin for CS-Cart. Please feel free to contact the PayGate support team at support@paygate.co.za should you require any assistance.
## Installation
[![How To Setup PayGate PayWeb for CS-Cart](https://appinlet.com/wp-content/uploads/2021/01/How-To-Setup-PayGate-PayWeb-for-CS-Cart.jpg)](https://www.youtube.com/watch?v=9Lhvc26WKjs "How To Setup PayGate PayWeb for CS-Cart")
-Please navigate to the [releases page](https://github.com/PayGate/PayWeb_CSCart/releases), download the latest release (v1.0.1) and unzip. You will then be able to follow the integration guide PDF which is included in the zip.
+Please navigate to the [releases page](https://github.com/PayGate/PayWeb_CSCart/releases), download the latest release (v1.0.2) and unzip. You will then be able to follow the integration guide PDF which is included in the zip.
## Collaboration
diff --git a/changelog.txt b/changelog.txt
new file mode 100755
index 0000000..3028117
--- /dev/null
+++ b/changelog.txt
@@ -0,0 +1,16 @@
+=====================================
+Date : Version: Description
+=====================================
+
+2021-09-27: v1.0.2 : Add payment types.
+ Tested with 4.13.2.
+
+2021-01-03: v1.0.1 : Big fixes and improvements.
+
+2017-12-14: v1.0.0 : Initial commit.
+
+
+
+
+
+
diff --git a/paygate/app/addons/paygate/addon.xml b/paygate/app/addons/paygate/addon.xml
index bdc6b31..c184c53 100755
--- a/paygate/app/addons/paygate/addon.xml
+++ b/paygate/app/addons/paygate/addon.xml
@@ -1,9 +1,18 @@
+
paygate
- PayGate Payment Gateway
- PayGate Payment Gateway
- 1.0.1
+ PayGate Payment Gateway
+ PayGate Payment Gateway
+ 1.0.2
en
1000
active
diff --git a/paygate/app/addons/paygate/func.php b/paygate/app/addons/paygate/func.php
index cd85729..4987130 100755
--- a/paygate/app/addons/paygate/func.php
+++ b/paygate/app/addons/paygate/func.php
@@ -1,59 +1,63 @@
$form['id'],
'REFERENCE' => $form['reference'],
'AMOUNT' => $form['amount'],
'CURRENCY' => $form['currency'],
'RETURN_URL' => $return_url,
- 'TRANSACTION_DATE' => $form[date],
+ 'TRANSACTION_DATE' => $form['date'],
'LOCALE' => 'en-za',
'COUNTRY' => $country_code3,
'EMAIL' => $form['email'],
- 'NOTIFY_URL' => $notify_url,
- 'USER3' => 'cscart4',
);
- $initiateFields['CHECKSUM'] = md5( implode( '', $initiateFields ) . $form['key'] );
- $curl = curl_init( 'https://secure.paygate.co.za/payweb3/initiate.trans' );
- curl_setopt( $curl, CURLOPT_POST, count( $initiateFields ) );
- curl_setopt( $curl, CURLOPT_POSTFIELDS, $initiateFields );
- curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
- curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0 );
- curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, 0 );
- $response = curl_exec( $curl );
- curl_close( $curl );
- parse_str( $response, $responseFields );
+ if ($set_paymethod) {
+ switch ($pw3_paymethod) {
+ case 'pw3_cc':
+ $initiateFields['PAY_METHOD'] = 'CC';
+ $initiateFields['PAY_METHOD_DETAIL'] = 'Card';
+ break;
+ case 'pw3_bt':
+ $initiateFields['PAY_METHOD'] = 'BT';
+ $initiateFields['PAY_METHOD_DETAIL'] = 'SID';
+ break;
+ case 'pw3_zapper':
+ $initiateFields['PAY_METHOD'] = 'EW';
+ $initiateFields['PAY_METHOD_DETAIL'] = 'Zapper';
+ break;
+ case 'pw3_mobicred':
+ $initiateFields['PAY_METHOD'] = 'EW';
+ $initiateFields['PAY_METHOD_DETAIL'] = 'Mobicred';
+ break;
+ case 'pw3_momopay':
+ $initiateFields['PAY_METHOD'] = 'EW';
+ $initiateFields['PAY_METHOD_DETAIL'] = 'Momopay';
+ break;
+ case 'pw3_masterpass':
+ $initiateFields['PAY_METHOD'] = 'EW';
+ $initiateFields['PAY_METHOD_DETAIL'] = 'MasterPass';
+ break;
+ case 'pw3_snapscan':
+ $initiateFields['PAY_METHOD'] = 'EW';
+ $initiateFields['PAY_METHOD_DETAIL'] = 'SnapScan';
+ break;
+ case 'pw3_paypal':
+ $initiateFields['PAY_METHOD'] = 'EW';
+ $initiateFields['PAY_METHOD_DETAIL'] = 'PayPal';
+ break;
+ default:
+ break;
+ }
+ }
+
+ $initiateFields['NOTIFY_URL'] = $notify_url;
+ $initiateFields['USER3'] = 'cscart-v102';
+
+
+ $initiateFields['CHECKSUM'] = md5(implode('', $initiateFields) . $form['key']);
+ $curl = curl_init('https://secure.paygate.co.za/payweb3/initiate.trans');
+ curl_setopt($curl, CURLOPT_POST, count($initiateFields));
+ curl_setopt($curl, CURLOPT_POSTFIELDS, $initiateFields);
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
+ $response = curl_exec($curl);
+ curl_close($curl);
+ parse_str($response, $responseFields);
echo <<Kindly wait while you're redirected to PayGate ...