Skip to content

Commit

Permalink
Merge pull request #165 from buckaroo-it/BP-3621-Refund-not-working-w…
Browse files Browse the repository at this point in the history
…ith-PayPal-PrestaShop

Bp 3621 refund not working with pay pal presta shop
  • Loading branch information
vegimcarkaxhija authored Jun 18, 2024
2 parents 109fdf1 + a1034a5 commit 66d7037
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions buckaroo3.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,16 @@ public function hookDisplayAdminOrderMainBottom($params)
$this->context->smarty->assign($refunds);

$buckarooFeeData = (new RawBuckarooFeeRepository())->getFeeByOrderId($order->id);
$buckarooFeeData['buckaroo_fee_tax'] = $buckarooFeeData['buckaroo_fee_tax_incl'] - $buckarooFeeData['buckaroo_fee_tax_excl'];

// Ensure that $buckarooFeeData is an array
if (!is_array($buckarooFeeData)) {
return $this->display(__FILE__, 'views/templates/hook/refund-hook.tpl');
$buckarooFeeData = [
'buckaroo_fee_tax_excl' => 0,
'buckaroo_fee_tax_incl' => 0,
'buckaroo_fee_tax' => 0
];
} else {
$buckarooFeeData['buckaroo_fee_tax'] = $buckarooFeeData['buckaroo_fee_tax_incl'] - $buckarooFeeData['buckaroo_fee_tax_excl'];
}

$this->context->smarty->assign([
Expand Down

0 comments on commit 66d7037

Please sign in to comment.