Skip to content

Commit

Permalink
Switch payment verification parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
bosunolanrewaju committed May 30, 2017
1 parent 75c7960 commit fe5c78f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ravepaymentgateway/controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ public function postProcess()
$payment_customer = Tools::getValue('customer');
$payment_status = Tools::getValue('status_code');
$tx_ref = Tools::getValue('tx_ref');
$flw_ref = Tools::getValue('flw_ref');
$sec_key = Configuration::get('RAVE_SC_KEY');

$extra_vars = array(
'transaction_id' => $tx_ref,
);

$txn = json_decode( $this->_fetchTransaction($tx_ref, $sec_key) );
$txn = json_decode( $this->_fetchTransaction($flw_ref, $sec_key) );
$is_successful = !empty($txn->data) && $this->_is_successful($txn->data);

$message = 'New Order Details - <br>'.
Expand Down Expand Up @@ -110,11 +111,11 @@ public function postProcess()
Tools::redirect($url);
}

private function _fetchTransaction($txRef, $secretKey) {
private function _fetchTransaction($flwRef, $secretKey) {

$URL = $this->context->cookie->base_url . "/flwv3-pug/getpaidx/api/verify";
$data = http_build_query(array(
'tx_ref' => $txRef,
'flw_ref' => $flwRef,
'SECKEY' => $secretKey
));

Expand All @@ -126,7 +127,6 @@ private function _fetchTransaction($txRef, $secretKey) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
$output = curl_exec($ch);
$failed = curl_errno($ch);
$error = curl_error($ch);
Expand Down
2 changes: 2 additions & 0 deletions ravepaymentgateway/views/js/rave.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ var redirectTo = function(url) {
if (url && response) {
var responseCode = (response.paymentType === 'account') ? response.acctvalrespcode : response.vbvrespcode;
var txRef = response.txRef;
var flwRef = response.flwRef;
var amount = response.amount;
var currency = response.currency;
var customerEmail = response.customer.email;
var form = createDOMElement('form', {method: 'post', action: url});
form.appendChild(createDOMElement('input', {name: 'status_code', value: responseCode}));
form.appendChild(createDOMElement('input', {name: 'tx_ref', value: txRef}));
form.appendChild(createDOMElement('input', {name: 'flw_ref', value: flwRef}));
form.appendChild(createDOMElement('input', {name: 'amount', value: amount}));
form.appendChild(createDOMElement('input', {name: 'currency', value: currency}));
form.appendChild(createDOMElement('input', {name: 'customer', value: customerEmail}));
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Rave is available in:

Safety Measure: Please make a backup of your website before installing any 3rd party module on your Prestashop site.

* Download the payment module to your computer from [here](https://github.com/bosunolanrewaju/prestashop-rave-payment-module/releases/download/v0.1.2/ravepaymentgateway.zip).
* Download the payment module to your computer from [here](https://github.com/bosunolanrewaju/prestashop-rave-payment-module/releases/download/v0.1.3/ravepaymentgateway.zip).
* Unzip (Extract) the content of the zip and copy the __ravepaymentgateway__ folder into your __Prestashop__ > __modules__ folder.
* Login to your Back Office.
* Go to "Modules and Services" in the menu, and search for __Rave Payment Gateway__ module.
Expand Down

0 comments on commit fe5c78f

Please sign in to comment.