Skip to content

Commit d0e95dd

Browse files
authored
EUR currency was getting saved in all refunds for non EUR currencies.
Prevent the default Money currency (EUR) from leaking into the refunded amount for non-EUR payments.
1 parent 8627aaa commit d0e95dd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Plugin.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,9 @@ public static function create_refund( Refund $refund ) {
11481148

11491149
$refunded_amount = $payment->get_refunded_amount();
11501150

1151+
// Prevent the default Money currency (EUR) from leaking into the refunded amount for non-EUR payments.
1152+
$refunded_amount->set_currency( $payment->get_total_amount()->get_currency() );
1153+
11511154
$refunded_amount = $refunded_amount->add( $refund->get_amount() );
11521155

11531156
$payment->set_refunded_amount( $refunded_amount );

0 commit comments

Comments
 (0)