Skip to content

Commit

Permalink
Merge pull request #47 from paynl/feature/PLUG-274
Browse files Browse the repository at this point in the history
feature/PLUG-274
  • Loading branch information
woutse authored Feb 9, 2021
2 parents cb7f342 + 0ac7865 commit b7ce956
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions app/code/community/Pay/Payment/Helper/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ public function __construct()
{
$this->helperData = Mage::helper('pay_payment');
}

/**
* Processes the order by transactionId, the data is collected by calling the pay api
*
* @param string $transactionId
* @param Mage_Core_Model_Store $store
* @param string $action
*
* @return string|null the new status
* @param $transactionId
* @param null $store
* @param null $action
* @return string|void
* @throws Mage_Core_Exception
* @throws \Paynl\Error\Api
* @throws \Paynl\Error\Error
* @throws Exception
*/
public function processByTransactionId($transactionId, $store = null, $action = null)
{
Expand Down Expand Up @@ -48,26 +52,26 @@ public function processByTransactionId($transactionId, $store = null, $action =
$status = Pay_Payment_Model_Transaction::STATE_VERIFY;
} else {
if (!empty($action) && strtolower($action) == 'new_ppt') {
throw Mage::exception('Pay_Payment', 'Status is still pending', 101);
throw Mage::exception('Pay_Payment', 'Status is still pending', 101);
}
if ($extended_logging) {
$order->addStatusHistoryComment('Status is pending, exiting');
}
$order->save();
//we gaan geen update doen

# No update needed
return;
}
$authTransaction = $order->getPayment()->getAuthorizationTransaction();
if ($status == Pay_Payment_Model_Transaction::STATE_SUCCESS &&
$authTransaction &&
$blockCapture
) {

$authTransaction = $order->getPayment() ? $order->getPayment()->getAuthorizationTransaction() : false;
if ($status == Pay_Payment_Model_Transaction::STATE_SUCCESS && $authTransaction && $blockCapture) {
if ($extended_logging) {
$order->addStatusHistoryComment('Blocking capture because block capture is enabled and an authorize transaction is present.');
}
$order->save();
return $status;
}

$paidAmount = $transaction->getPaidCurrencyAmount();
if ($store->getConfig('pay_payment/general/only_base_currency') == 1) {
$paidAmount = $transaction->getPaidAmount();
Expand Down

0 comments on commit b7ce956

Please sign in to comment.