Skip to content

armgit / spree

Public Imported from GitHub
0

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.

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.rb
index 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 Spree
class CreditCardSerializer < BaseSerializer
set_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_metadata
belongs_to :payment_method
end
diff --git a/api/spec/jobs/spree/webhooks/endpoints/make_request_job_spec.rb b/api/spec/jobs/spree/webhooks/endpoints/make_request_job_spec.rb
index 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 do
let(: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)
end
it 'does not raise if used with the expected arguments', :job do
diff --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.rb
index 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 do
expect(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)
end
end
diff --git a/docs/api-reference/storefront.yaml b/docs/api-reference/storefront.yaml
index 3fd345d06d..5bebc9d3c3 100644
--- a/docs/api-reference/storefront.yaml
+++ b/docs/api-reference/storefront.yaml
@@ -1967,14 +1967,14 @@ components:
scheme: bearer
description: |-
User token to authorize Cart and Checkout requests.
-
+
It is required to associate Cart with the User.
orderToken:
type: apiKey
in: header
description: |-
Order token to authorize Cart and Checkout requests.
-
+
[How to obtain X-Spree-Order-Token](../authentication#for-guest-users)
name: X-Spree-Order-Token
schemas:
@@ -2580,6 +2580,10 @@ components:
type: string
example: John Doe
description: Card holder name
+ gateway_payment_profile_id:
+ type: string
+ example: card_1JqvNB2eZvKYlo2C5OlqLV7S
+ description: ID of a gateway's payment method
default:
type: boolean
example: true
@@ -6446,6 +6450,7 @@ components:
year: 2026
name: John Doe
default: true
+ gateway_payment_profile_id: card_1JqvNB2eZvKYlo2C5OlqLV7S
relationships:
payment_method:
data:
@@ -6494,6 +6499,7 @@ components:
month: 12
year: 2026
name: John Doe
+ gateway_payment_profile_id: card_1JqvNB2eZvKYlo2C5OlqLV7S
default: true
relationships:
payment_method: