You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a zero decimal currency donor, I want fee recovery calculations to be less confusing.
Details
In this example, the donor is giving 10555 in the IDR currency. This currency is not classified as a zero based currency by default, but it was specified as such using the give_fee_zero_based_currency filter in the custom gateway plugin. The payment gateway only accepts integer amounts for this currency.
The donor checks the box to cover the transaction fees. Here is the preview shown:
So far so good.
But the actual calculations for the fee recovery do use decimal places. Here is the final breakdown of the fee recovery as shown in the receipt:
Amount: Rp10870,55 (Rp10554,55 donation + Rp316,00 for fees)
Three problems.
Floating point math is not precise enough. 10555 got changed to 10554,55. For context, Rp10000 is less than $1 in USD. So it would not be uncommon for donors to give "large" amounts like this.
The fee recovery amount was prioritized over the original donation amount. If an amount has to be changed for the fee calculations, it should be the fee.
There should not be any decimal places at all.
Notably, this problem does not occur when using a currency that is zero based by default, such as the Japanese Yen.
Expected Behavior
The donation amount should remain the same as what the donor agreed to. It should be 10871.
The amounts should not include any decimal places. The original amount should be 10555. The fee should be 316.
Steps to Reproduce
Set your GiveWP currency to IDR (Indonesian Rupiah).
Add a give_fee_zero_based_currency filter that inserts the IDR currency into the list.
Enable fee recovery.
Make a donation with fee recovery selected.
System Information
Details
GiveWP 3.4.2
PHP 8.0.30
Acceptance Criteria
Fee calculations should respect the give_fee_zero_based_currency filter.
OR GiveWP can provide a way to set a currency as zero based in the settings.
The text was updated successfully, but these errors were encountered:
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.
User Story
As a zero decimal currency donor, I want fee recovery calculations to be less confusing.
Details
In this example, the donor is giving 10555 in the IDR currency. This currency is not classified as a zero based currency by default, but it was specified as such using the
give_fee_zero_based_currency
filter in the custom gateway plugin. The payment gateway only accepts integer amounts for this currency.The donor checks the box to cover the transaction fees. Here is the preview shown:
So far so good.
But the actual calculations for the fee recovery do use decimal places. Here is the final breakdown of the fee recovery as shown in the receipt:
Three problems.
Notably, this problem does not occur when using a currency that is zero based by default, such as the Japanese Yen.
Expected Behavior
The donation amount should remain the same as what the donor agreed to. It should be 10871.
The amounts should not include any decimal places. The original amount should be 10555. The fee should be 316.
Steps to Reproduce
give_fee_zero_based_currency
filter that inserts the IDR currency into the list.System Information
Details
GiveWP 3.4.2 PHP 8.0.30Acceptance Criteria
give_fee_zero_based_currency
filter.The text was updated successfully, but these errors were encountered: