Skip to content

Commit

Permalink
Merge branch 'Release/7.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Mar 15, 2022
2 parents 91d51cd + 1acca49 commit 33c8c62
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 60 deletions.
16 changes: 14 additions & 2 deletions inc/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,21 @@ function mollieWooCommercIsExpiryDateEnabled()
return $expiryDateEnabled;
}

/**
* Format the value that is sent to Mollie's API
* with the required number of decimals
* depending on the currency used
*
* @param $value
* @param $currency
* @return string
*/
function mollieWooCommerceFormatCurrencyValue($value, $currency)
{
// Only the Japanese Yen has no decimals in the currency
$currenciesWithNoDecimals = ["JPY", "ISK"];
if(in_array($currency, $currenciesWithNoDecimals)){
return number_format($value, 0, '.', '');
}

return $currency === "JPY" ? number_format($value, 0, '.', '') : number_format($value, 2, '.', '');
return number_format($value, 2, '.', '');
}
2 changes: 1 addition & 1 deletion mollie-payments-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Mollie Payments for WooCommerce
* Plugin URI: https://www.mollie.com
* Description: Accept payments in WooCommerce with the official Mollie plugin
* Version: 7.0.3-beta1
* Version: 7.0.3
* Author: Mollie
* Author URI: https://www.mollie.com
* Requires at least: 5.0
Expand Down
24 changes: 1 addition & 23 deletions public/images/ideal-qr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 37 additions & 12 deletions public/images/ideal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 33c8c62

Please sign in to comment.