Skip to content

Commit

Permalink
Fix HRK order refund currency
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanPetakNeuralab committed Dec 30, 2022
1 parent 773e5c9 commit 06a8b23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions includes/core/class-kekspay-connector.php
Expand Up @@ -61,10 +61,12 @@ public function refund( $order, $amount ) {

$currency = $order->get_currency();

$refund_amount = $amount;
$refund_amount = $amount;
$refund_currency = $currency;

if ( 'HRK' === $currency ) {
$refund_amount = round( $amount / 7.5345, 2 );
$refund_amount = round( $amount / 7.5345, 2 );
$refund_currency = 'EUR';
}

$timestamp = time();
Expand All @@ -76,7 +78,7 @@ public function refund( $order, $amount ) {
'amount' => $refund_amount,
'epochtime' => $timestamp,
'hash' => Kekspay_Data::get_hash( $order, $refund_amount, $timestamp ),
'currency' => $currency,
'currency' => $refund_currency,
);

$wc_price = wc_price( $amount, array( 'currency' => $currency ) );
Expand Down

0 comments on commit 06a8b23

Please sign in to comment.