Skip to content

Commit

Permalink
Merge pull request #25 from paynl/feature/loggingupdatejan18
Browse files Browse the repository at this point in the history
Updated logging level
  • Loading branch information
woutse authored Jan 30, 2022
2 parents a7d5139 + 548172b commit 15d9aca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Observer/OrderSaveCommitAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public function execute(\Magento\Framework\Event\Observer $observer)
$amountRefunded = isset($data['amount_refunded']) ? $data['amount_refunded'] : null;

if ($bHasAmountAuthorized && $amountPaid === null && $amountRefunded === null) {
payHelper::logDebug('AUTO-CAPTURING ' . $data['last_trans_id'], [], $order->getStore());
payHelper::logNotice('AUTO-CAPTURING ' . $data['last_trans_id'], [], $order->getStore());
try {
\Paynl\Config::setApiToken($this->config->getApiToken());
$result = \Paynl\Transaction::capture($data['last_trans_id']);
$strResult = 'Success';
} catch (\Exception $e) {
payHelper::logDebug('Order PAY error: ' . $e->getMessage() . ' EntityId: ' . $order->getEntityId(), [], $order->getStore());
payHelper::logCritical('Order PAY error: ' . $e->getMessage() . ' EntityId: ' . $order->getEntityId(), [], $order->getStore());
$strResult = 'Failed. Errorcode: PAY-MAGENTO2-003. See docs.pay.nl for more information';
}

Expand Down
4 changes: 2 additions & 2 deletions Observer/ShipmentSaveAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public function execute(\Magento\Framework\Event\Observer $observer)
$amountRefunded = isset($data['amount_refunded']) ? $data['amount_refunded'] : null;

if ($bHasAmountAuthorized && $amountPaid === null && $amountRefunded === null) {
payHelper::logDebug('AUTO-CAPTURING (rest)' . $data['last_trans_id'], [], $order->getStore());
payHelper::logNotice('AUTO-CAPTURING (rest)' . $data['last_trans_id'], [], $order->getStore());
try {
\Paynl\Config::setApiToken($this->config->getApiToken());
$result = \Paynl\Transaction::capture($data['last_trans_id']);
$strResult = 'Success';
} catch (\Exception $e) {
payHelper::logDebug('Order PAY error (rest): ' . $e->getMessage() . ' EntityId: ' . $order->getEntityId(), [], $order->getStore());
payHelper::logCritical('Order PAY error (rest): ' . $e->getMessage() . ' EntityId: ' . $order->getEntityId(), [], $order->getStore());
$strResult = 'Failed. Errorcode: PAY-MAGENTO2-004. See docs.pay.nl for more information';
}

Expand Down
Empty file added Setup/UpgradeData.php
Empty file.

0 comments on commit 15d9aca

Please sign in to comment.