Skip to content

Commit

Permalink
Backward_compatibility PS1.6: warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Dat Pham committed Sep 28, 2018
1 parent 7be47ca commit 0073fdd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/lemonway/classes/SplitpaymentDeadline.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public function pay($update = false)
$hpay = $kit->moneyInWithCardId($params);

if ($hpay->INT_STATUS == 0) {
// Status 0 means success
$this->status = SplitpaymentDeadline::STATUS_COMPLETE;

/* @var $invoiceCollection PrestaShopCollectionCore */
Expand Down
2 changes: 1 addition & 1 deletion src/lemonway/controllers/front/redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ public function postProcess()
$moneyInWeb->CARD->ID
);
}


$moneyInToken = $moneyInWeb->TOKEN;

Expand Down Expand Up @@ -309,6 +308,7 @@ public function postProcess()
$hpay = $kit->moneyInWithCardId($params);

if ($hpay->INT_STATUS == 0) {
// Status 0 means success
if (!$cart->OrderExists()) {
if ($methodInstance->isSplitPayment()) {
// If split payment
Expand Down
3 changes: 3 additions & 0 deletions src/lemonway/controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ public function postProcess()
$order->setCurrentState(Configuration::get("PS_OS_CANCELED"));
}

if (!$this->module->isVersion17()) {
$this->warning = array();
}
array_push($this->warning, $this->module->l('You have canceled the payment.'));
return $this->displayError();
default:
Expand Down
8 changes: 4 additions & 4 deletions src/lemonway/views/templates/front/error.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@

<div>
<h3>{l s='An error occurred' mod='lemonway'}:</h3>
{if $errors|@count gt 0}
{if $errors|@count gt 0}
<ul class="alert alert-danger">
{foreach from=$errors item='error'}
<li>{$error|escape:'htmlall':'UTF-8'}.</li>
<li>{$error|escape:'htmlall':'UTF-8'}</li>
{/foreach}
</ul>
{/if}

{if $warning|@count gt 0}
{if $warning|@count gt 0}
<ul class="alert alert-warning">
{foreach from=$warning item='warningMessage'}
<li>{$warningMessage|escape:'htmlall':'UTF-8'}.</li>
<li>{$warningMessage|escape:'htmlall':'UTF-8'}</li>
{/foreach}
</ul>
{/if}
Expand Down

0 comments on commit 0073fdd

Please sign in to comment.