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
Add `Payment#display_credit_allowed` and standarize money methods
Damian Legawiec0915ad96c7b9
diff --git a/core/app/models/spree/payment.rb b/core/app/models/spree/payment.rbindex 1461d303ec..054e44d722 100644--- a/core/app/models/spree/payment.rb+++ b/core/app/models/spree/payment.rb@@ -10,6 +10,8 @@ module Spreeinclude Spree::Security::Paymentsend+ extend Spree::DisplayMoney+include Spree::Payment::Processinginclude Spree::Payment::Webhooks@@ -81,6 +83,9 @@ module Spreedelegate :currency, to: :order+ money_methods :amount, :credit_allowed+ alias money display_amount # for compatibility with older versions of Spree+# order state machine (see http://github.com/pluginaweek/state_machine/tree/master for details)state_machine initial: :checkout do# With card payments, happens before purchase or authorization happens@@ -129,11 +134,6 @@ module Spreepayment_method.payment_source_class.unscoped { super }end- def money- Spree::Money.new(amount, currency: currency)- end- alias display_amount money-def amount=(amount)self[:amount] =case amount