Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Use BigDecimal with precision to qvoid Ruby 3.0 comparision issues
Damian Legawiecec541f95d525
diff --git a/core/app/models/spree/store_credit.rb b/core/app/models/spree/store_credit.rbindex e032f1c714..2009380d9d 100644--- a/core/app/models/spree/store_credit.rb+++ b/core/app/models/spree/store_credit.rb@@ -68,7 +68,7 @@ module Spreeenddef validate_authorization(amount, order_currency)- if amount_remaining.to_d < amount.to_d+ if BigDecimal(amount_remaining, 3) < BigDecimal(amount, 3)errors.add(:base, Spree.t('store_credit_payment_method.insufficient_funds'))elsif currency != order_currencyerrors.add(:base, Spree.t('store_credit_payment_method.currency_mismatch'))