Skip to content

Commit

Permalink
additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
leviothan committed Mar 12, 2018
1 parent a9d40f5 commit deed465
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ class PayBearValidationModuleFrontController extends ModuleFrontController
public function postProcess()
{
$cart = $this->context->cart;
if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active)
if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) {
$logMessage = sprintf('PayBear: order validation failed. id_customer: %s, id_address_delivery: %s, id_address_invoice: %s', $cart->id_customer, $cart->id_address_delivery, $cart->id_address_invoice);
PrestaShopLogger::addLog($logMessage, 1, null, 'Cart', $cart->id, true);
Tools::redirect('index.php?controller=order&step=1');
}

// Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
$authorized = false;
Expand All @@ -52,6 +55,8 @@ public function postProcess()

$customer = new Customer($cart->id_customer);
if (!Validate::isLoadedObject($customer)) {
$logMessage = sprintf('Paybear: order validation failed. Customer not found (%s)', $cart->id_customer);
PrestaShopLogger::addLog($logMessage, 1, null, 'Cart', $cart->id, true);
Tools::redirect('index.php?controller=order&step=1');
}

Expand Down
2 changes: 1 addition & 1 deletion paybear.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct()
{
$this->name = 'paybear';
$this->tab = 'payments_gateways';
$this->version = '0.6.0';
$this->version = '0.6.4';
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
$this->author = 'PayBear';
$this->controllers = array('validation', 'currencies', 'payment', 'callback', 'status');
Expand Down

0 comments on commit deed465

Please sign in to comment.