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
Include `payment_id` in `Payment::GatewayOptions#to_hash`
Damian Legawiec647ab3d24503
diff --git a/core/app/models/spree/payment/gateway_options.rb b/core/app/models/spree/payment/gateway_options.rbindex 73fa66b177..c943bb9508 100644--- a/core/app/models/spree/payment/gateway_options.rb+++ b/core/app/models/spree/payment/gateway_options.rb@@ -30,6 +30,10 @@ module Spree"#{order.number}-#{payment.number}"end+ def payment_id+ payment.number+ end+def shippingorder.ship_total * exchange_multiplierend@@ -61,6 +65,7 @@ module Spree:customer_id,:ip,:order_id,+ :payment_id,:shipping,:tax,:subtotal,diff --git a/core/spec/models/spree/payment/gateway_options_spec.rb b/core/spec/models/spree/payment/gateway_options_spec.rbindex 89ef7babaf..640b5b1ff9 100644--- a/core/spec/models/spree/payment/gateway_options_spec.rb+++ b/core/spec/models/spree/payment/gateway_options_spec.rb@@ -56,6 +56,12 @@ RSpec.describe Spree::Payment::GatewayOptions, type: :model doit { is_expected.to eq payment }end+ describe '#payment_id' do+ subject { options.payment_id }++ it { is_expected.to eq 'P1566' }+ end+describe '#email' dosubject { options.email }@@ -138,6 +144,7 @@ RSpec.describe Spree::Payment::GatewayOptions, type: :model docustomer_id: 144,ip: '0.0.0.0',order_id: 'R1444-P1566',+ payment_id: 'P1566',shipping: '1244'.to_d,tax: '153'.to_d,subtotal: '1511'.to_d,