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 `gateway_payment_profile_id` to `Spree::V2::Storefront::CreditCardSerializer` (#12141)
Łukasz Adamczyk170c441c96dc
diff --git a/api/app/serializers/spree/v2/storefront/credit_card_serializer.rb b/api/app/serializers/spree/v2/storefront/credit_card_serializer.rbindex 56f35178b7..9ceb0d15d8 100644--- a/api/app/serializers/spree/v2/storefront/credit_card_serializer.rb+++ b/api/app/serializers/spree/v2/storefront/credit_card_serializer.rb@@ -4,7 +4,7 @@ module Spreeclass CreditCardSerializer < BaseSerializerset_type :credit_card- attributes :cc_type, :last_digits, :month, :year, :name, :default, :public_metadata+ attributes :cc_type, :last_digits, :month, :year, :name, :default, :gateway_payment_profile_id, :public_metadatabelongs_to :payment_methodenddiff --git a/api/spec/jobs/spree/webhooks/endpoints/make_request_job_spec.rb b/api/spec/jobs/spree/webhooks/endpoints/make_request_job_spec.rbindex 3a180d2080..3d65dd4390 100644--- a/api/spec/jobs/spree/webhooks/endpoints/make_request_job_spec.rb+++ b/api/spec/jobs/spree/webhooks/endpoints/make_request_job_spec.rb@@ -7,7 +7,7 @@ describe Spree::Webhooks::Subscribers::MakeRequestJob dolet(:webhook_payload_body) { {} }it 'enqueues a HTTP request using Spree::Webhooks::Subscribers::HandleRequest', :job do- expect { described_class.perform_later(webhook_payload_body, event, subscriber, 1) }.to have_enqueued_job.on_queue(queue)+ expect { described_class.perform_later(webhook_payload_body, event, subscriber) }.to have_enqueued_job.on_queue(queue)endit 'does not raise if used with the expected arguments', :job dodiff --git a/api/spec/requests/spree/api/v2/storefront/account/credit_cards_spec.rb b/api/spec/requests/spree/api/v2/storefront/account/credit_cards_spec.rbindex 96909a9735..7211e5d451 100644--- a/api/spec/requests/spree/api/v2/storefront/account/credit_cards_spec.rb+++ b/api/spec/requests/spree/api/v2/storefront/account/credit_cards_spec.rb@@ -14,6 +14,7 @@ describe 'Storefront API v2 CreditCards spec', type: :request doexpect(json_response['data'][0]).to have_attribute(:month)expect(json_response['data'][0]).to have_attribute(:year)expect(json_response['data'][0]).to have_attribute(:name)+ expect(json_response['data'][0]).to have_attribute(:gateway_payment_profile_id)expect(json_response['data'][0]).to have_attribute(:public_metadata)endenddiff --git a/docs/api-reference/storefront.yaml b/docs/api-reference/storefront.yamlindex 3fd345d06d..5bebc9d3c3 100644--- a/docs/api-reference/storefront.yaml+++ b/docs/api-reference/storefront.yaml@@ -1967,14 +1967,14 @@ components:scheme: bearerdescription: |-User token to authorize Cart and Checkout requests.-+It is required to associate Cart with the User.orderToken:type: apiKeyin: headerdescription: |-Order token to authorize Cart and Checkout requests.-+[How to obtain X-Spree-Order-Token](../authentication#for-guest-users)name: X-Spree-Order-Tokenschemas:@@ -2580,6 +2580,10 @@ components:type: stringexample: John Doedescription: Card holder name+ gateway_payment_profile_id:+ type: string+ example: card_1JqvNB2eZvKYlo2C5OlqLV7S+ description: ID of a gateway's payment methoddefault:type: booleanexample: true@@ -6446,6 +6450,7 @@ components:year: 2026name: John Doedefault: true+ gateway_payment_profile_id: card_1JqvNB2eZvKYlo2C5OlqLV7Srelationships:payment_method:data:@@ -6494,6 +6499,7 @@ components:month: 12year: 2026name: John Doe+ gateway_payment_profile_id: card_1JqvNB2eZvKYlo2C5OlqLV7Sdefault: truerelationships:payment_method: