Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bp 3621 refund not working with pay pal presta shop #165

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading