Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vegimcarkaxhija committed May 24, 2024
1 parent 058854d commit 36031c5
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions buckaroo3.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,20 @@ public function hookDisplayAdminOrderMainBottom($params)
$refunds = $refundProvider->get($order);
$this->context->smarty->assign($refunds);

// Fetch payment fee details
$paymentMethodLabel = $order->payment;
$buckarooFeeService = $this->getBuckarooFeeService();
$paymentMethodName = $buckarooFeeService->getPaymentMethodByLabel($paymentMethodLabel);
$buckarooFee = $this->getBuckarooFee($paymentMethodName);

if (!is_array($buckarooFee)) {
$buckarooFee = [
'buckaroo_fee_tax_excl' => 0,
'buckaroo_fee_tax' => 0,
'buckaroo_fee_tax_incl' => 0,
];
$buckarooFeeData = (new RawBuckarooFeeRepository())->getFeeByOrderId($order->id);
$buckarooFeeData['buckaroo_fee_tax'] = $buckarooFeeData['buckaroo_fee_tax_incl'] - $buckarooFeeData['buckaroo_fee_tax_excl'];
if (!is_array($buckarooFeeData)) {
return $this->display(__FILE__, 'views/templates/hook/refund-hook.tpl');
}

$this->context->smarty->assign([
'buckaroo_fee' => $buckarooFee,
'buckaroo_fee' => $buckarooFeeData,
'currency' => new Currency($order->id_currency)
]);

// Display both templates
return $this->display(__FILE__, 'views/templates/hook/refund-hook.tpl') .
$this->display(__FILE__, 'views/templates/hook/payment-fee-table.tpl');
return $this->display(__FILE__, 'views/templates/hook/payment-fee-table.tpl').
$this->display(__FILE__, 'views/templates/hook/refund-hook.tpl');
}

/**
Expand Down

0 comments on commit 36031c5

Please sign in to comment.