Skip to content

Commit

Permalink
Merge pull request #6 from genuineq/master
Browse files Browse the repository at this point in the history
update to 6.js and version 1.0.4 from 1.0.3
  • Loading branch information
ionutcalara authored Mar 19, 2021
2 parents 79f5c3a + 94c1478 commit cca8eaa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions paylikepayment/controllers/front/paymentreturn.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @author DerikonDevelopment <[email protected]>
* @copyright Copyright (c) permanent, DerikonDevelopment
* @version 1.0.3
* @version 1.0.4
* @link http://www.derikon.com/
*
*/
Expand Down Expand Up @@ -43,7 +43,7 @@ public function init()
if (!$authorized) {
die($this->module->l('Paylike payment method is not available.', 'paymentreturn'));
}


if (Configuration::get('PAYLIKE_CHECKOUT_MODE') == 'delayed') {
$this->fetch();
Expand Down Expand Up @@ -99,19 +99,19 @@ public function fetch()

$total = $fetch['transaction']['amount'] / $currency_multiplier;
$amount = $fetch['transaction']['amount'];

//$status_paid = Configuration::get('PS_OS_PAYMENT');
$status_paid = 3; //Processing in progress

if ($this->module->validateOrder((int)$cart->id, $status_paid, $total, $this->module->displayName, $message, array(), null, false, $customer->secure_key)) {
$this->module->storeTransactionID($transactionid, $this->module->currentOrder, $total, $captured = 'NO');

$redirectLink = __PS_BASE_URI__.'index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key;
Tools::redirectLink($redirectLink);
} else {
//Paylike\Transaction::void($transactionid, ['amount' => $amount]); //Cancel Order
Paylike\Transaction::void($transactionid, array('amount' => $fetch['transaction']['amount'])); //Cancel Order

Logger::addLog('Invalid transaction.');
$this->context->smarty->assign(array(
'paylike_order_error' => 1,
Expand Down Expand Up @@ -200,7 +200,7 @@ public function capture()
$amount = $capture['transaction']['amount'];

$validOrder = $this->module->validateOrder((int)$cart->id, $status_paid, $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);

$message = 'Trx ID: '.$transactionid.'
Authorized Amount: '.($capture['transaction']['amount'] / $currency_multiplier).'
Captured Amount: '.($capture['transaction']['capturedAmount'] / $currency_multiplier).'
Expand Down
6 changes: 3 additions & 3 deletions paylikepayment/paylikepayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @author DerikonDevelopment <[email protected]>
* @copyright Copyright (c) permanent, DerikonDevelopment
* @license Addons PrestaShop license limitation
* @version 1.0.3
* @version 1.0.4
* @link http://www.derikon.com/
*
*/
Expand All @@ -26,7 +26,7 @@ class PaylikePayment extends PaymentModule {
public function __construct() {
$this->name = 'paylikepayment';
$this->tab = 'payments_gateways';
$this->version = '1.0.3';
$this->version = '1.0.4';
$this->author = 'DerikonDevelopment';
$this->bootstrap = true;
$this->module_key = '1d083bab290f652fb6fb7ae35f9f0942';
Expand Down Expand Up @@ -624,7 +624,7 @@ public function getModalForAddMoreLogo() {

public function hookHeader() {
/*if(Configuration::get('PAYLIKE_STATUS') == 'enabled' && $this->context->controller->php_self == 'order') {
$this->context->controller->addJs('https://sdk.paylike.io/3.js');
$this->context->controller->addJs('https://sdk.paylike.io/6.js');
}*/
}

Expand Down
2 changes: 1 addition & 1 deletion paylikepayment/views/templates/hook/payment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
height: 27px;
}
</style>
<script type="text/javascript" src="https://sdk.paylike.io/3.js"></script>
<script type="text/javascript" src="https://sdk.paylike.io/6.js"></script>
<script>
var PAYLIKE_PUBLIC_KEY = "{$PAYLIKE_PUBLIC_KEY|escape:'htmlall':'UTF-8'}";
var paylike = Paylike(PAYLIKE_PUBLIC_KEY);
Expand Down

0 comments on commit cca8eaa

Please sign in to comment.