Skip to content

Conversation

@Ferks-FK
Copy link
Collaborator

@Ferks-FK Ferks-FK commented Mar 29, 2025

This PR fixes the problem reported here: #1095
It also already has the fix for: #1210.

PR implements a 1000 division and multiplication factor to support currencies with 3 decimal places.

Edit:
In the commit 7d2c102 the way minimum_credits works has been changed.
Now the old -1 that was used to use the configuration value, becomes null, to avoid users putting -1, -10, -100 thinking it would work.

Todo:

  • Test the gateways (Mercado Pago, Mollie, Paypal, Stripe).
  • Test the partner discounts.

Copy link
Collaborator

@MrWeez MrWeez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you divide and multiply by 1000? If we store prices in cents, then we need to use 100 or am I wrong?

@MrWeez
Copy link
Collaborator

MrWeez commented Mar 29, 2025

Why do you divide and multiply by 1000? If we store prices in cents, then we need to use 100 or am I wrong?

Oh, my bad, I didn't know about the existence of currencies with three decimal.

@S0ly S0ly added the High Priority Critical. Act quickly for resolution label Mar 30, 2025
@S0ly S0ly changed the title Fix for the floating point problem fix: floating point error Mar 30, 2025
@S0ly S0ly requested review from 1day2die, IceToast and Copilot April 5, 2025 14:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 45 out of 65 changed files in this pull request and generated no comments.

Files not reviewed (20)
  • app/Casts/Settings/CurrencyCast.php: Language not supported
  • app/Classes/PaymentExtension.php: Language not supported
  • app/Extensions/PaymentGateways/MercadoPago/MercadoPagoExtension.php: Language not supported
  • app/Extensions/PaymentGateways/Mollie/MollieExtension.php: Language not supported
  • app/Extensions/PaymentGateways/PayPal/PayPalExtension.php: Language not supported
  • app/Extensions/PaymentGateways/Stripe/StripeExtension.php: Language not supported
  • app/Facades/Currency.php: Language not supported
  • app/Helpers/CurrencyHelper.php: Language not supported
  • app/Http/Controllers/Admin/CouponController.php: Language not supported
  • app/Http/Controllers/Admin/OverViewController.php: Language not supported
  • app/Http/Controllers/Admin/PaymentController.php: Language not supported
  • app/Http/Controllers/Admin/ProductController.php: Language not supported
  • app/Http/Controllers/Admin/SettingsController.php: Language not supported
  • app/Http/Controllers/Admin/ShopProductController.php: Language not supported
  • app/Http/Controllers/Admin/UserController.php: Language not supported
  • app/Http/Controllers/Admin/VoucherController.php: Language not supported
  • app/Http/Controllers/Auth/RegisterController.php: Language not supported
  • app/Http/Controllers/HomeController.php: Language not supported
  • app/Http/Controllers/ServerController.php: Language not supported
  • app/Http/Controllers/StoreController.php: Language not supported

@1day2die
Copy link
Collaborator

code LGTM, will spin up a test env

@S0ly S0ly self-requested a review April 18, 2025 13:12
Copy link
Member

@S0ly S0ly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good to me

@S0ly
Copy link
Member

S0ly commented Apr 21, 2025

This PR seems to include breaking changes for Payments gateway

we may want to release as 1.1.0 so show that

@1day2die 1day2die merged commit 491fd56 into Ctrlpanel-gg:development May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority Critical. Act quickly for resolution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server limits were increased with each purchase, ignoring the limits Floating Point Errors

4 participants