spree_api 5.4.0.rc1 → 5.4.0.rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/spree/api/v3/store/carts/payments_controller.rb +7 -28
- data/app/controllers/spree/api/v3/store/customer/addresses_controller.rb +5 -22
- data/app/controllers/spree/api/v3/store/customer/store_credits_controller.rb +39 -0
- data/app/serializers/spree/api/v3/address_serializer.rb +2 -2
- data/app/serializers/spree/api/v3/admin/gift_card_serializer.rb +17 -0
- data/app/serializers/spree/api/v3/admin/order_serializer.rb +1 -0
- data/app/serializers/spree/api/v3/cart_serializer.rb +20 -1
- data/app/serializers/spree/api/v3/customer_serializer.rb +13 -0
- data/app/serializers/spree/api/v3/order_serializer.rb +20 -1
- data/app/serializers/spree/api/v3/product_serializer.rb +12 -2
- data/config/routes.rb +10 -13
- data/lib/spree/api/dependencies.rb +1 -0
- metadata +8 -7
- data/app/controllers/spree/api/v3/store/carts/payment_methods_controller.rb +0 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78b4c09d45771aeb527cc5f623c07cca20e2920d2d083e7641573b8b95cadbf2
|
|
4
|
+
data.tar.gz: 2dc7b84ce1f3e9b59fa3a6bc8c874d4488d8480841839765a5af4a8d21dcf30f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 412d63a74d08c348e9f76fd366552dc2af424ed3b42971896e3fdbe7e38c886592f5680207eb1805700f4e12c98a368428f50f4c389ee79953218729acd9c159
|
|
7
|
+
data.tar.gz: 4034da7fbd869926562e842632d12b2bc39eb3338987fc60904e6c08b1a4905d621735c713d0fe212a2319125fdcdb11616872479b0d18d8f5d280456f5cf9b1
|
|
@@ -3,9 +3,11 @@ module Spree
|
|
|
3
3
|
module V3
|
|
4
4
|
module Store
|
|
5
5
|
module Carts
|
|
6
|
-
class PaymentsController < Store::
|
|
6
|
+
class PaymentsController < Store::BaseController
|
|
7
7
|
include Spree::Api::V3::CartResolvable
|
|
8
8
|
|
|
9
|
+
before_action :find_cart!
|
|
10
|
+
|
|
9
11
|
# POST /api/v3/store/carts/:cart_id/payments
|
|
10
12
|
# Creates a payment for non-session payment methods (e.g. Check, Cash on Delivery, Bank Transfer)
|
|
11
13
|
def create
|
|
@@ -19,7 +21,7 @@ module Spree
|
|
|
19
21
|
)
|
|
20
22
|
end
|
|
21
23
|
|
|
22
|
-
unless payment_method.available_for_order?(@
|
|
24
|
+
unless payment_method.available_for_order?(@cart)
|
|
23
25
|
return render_error(
|
|
24
26
|
code: 'payment_method_unavailable',
|
|
25
27
|
message: Spree.t('api.v3.payments.method_unavailable'),
|
|
@@ -27,43 +29,20 @@ module Spree
|
|
|
27
29
|
)
|
|
28
30
|
end
|
|
29
31
|
|
|
30
|
-
amount = params[:amount].presence || @
|
|
32
|
+
amount = params[:amount].presence || @cart.total_minus_store_credits
|
|
31
33
|
|
|
32
|
-
@payment = @
|
|
34
|
+
@payment = @cart.payments.build(
|
|
33
35
|
payment_method: payment_method,
|
|
34
36
|
amount: amount,
|
|
35
37
|
metadata: params[:metadata].present? ? params[:metadata].to_unsafe_h : {}
|
|
36
38
|
)
|
|
37
39
|
|
|
38
40
|
if @payment.save
|
|
39
|
-
render json:
|
|
41
|
+
render json: Spree.api.payment_serializer.new(@payment, params: serializer_params).to_h, status: :created
|
|
40
42
|
else
|
|
41
43
|
render_errors(@payment.errors)
|
|
42
44
|
end
|
|
43
45
|
end
|
|
44
|
-
|
|
45
|
-
protected
|
|
46
|
-
|
|
47
|
-
def set_parent
|
|
48
|
-
find_cart!
|
|
49
|
-
@parent = @cart
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def parent_association
|
|
53
|
-
:payments
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def model_class
|
|
57
|
-
Spree::Payment
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def serializer_class
|
|
61
|
-
Spree.api.payment_serializer
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# Authorization is handled by find_cart! in set_parent
|
|
65
|
-
def authorize_resource!(*)
|
|
66
|
-
end
|
|
67
46
|
end
|
|
68
47
|
end
|
|
69
48
|
end
|
|
@@ -5,9 +5,9 @@ module Spree
|
|
|
5
5
|
module Customer
|
|
6
6
|
class AddressesController < ResourceController
|
|
7
7
|
prepend_before_action :require_authentication!
|
|
8
|
-
before_action :set_resource, only: [:show, :update, :destroy
|
|
8
|
+
before_action :set_resource, only: [:show, :update, :destroy]
|
|
9
9
|
|
|
10
|
-
# POST /api/v3/store/
|
|
10
|
+
# POST /api/v3/store/customers/me/addresses
|
|
11
11
|
def create
|
|
12
12
|
result = Spree.address_create_service.call(
|
|
13
13
|
address_params: permitted_params,
|
|
@@ -21,25 +21,7 @@ module Spree
|
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
# PATCH /api/v3/store/
|
|
25
|
-
def mark_as_default
|
|
26
|
-
kind = params[:kind].to_s
|
|
27
|
-
|
|
28
|
-
unless %w[billing shipping].include?(kind)
|
|
29
|
-
return render_error(
|
|
30
|
-
code: ERROR_CODES[:invalid_request],
|
|
31
|
-
message: 'kind must be billing or shipping',
|
|
32
|
-
status: :unprocessable_content
|
|
33
|
-
)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
attribute = kind == 'billing' ? :bill_address_id : :ship_address_id
|
|
37
|
-
current_user.update!(attribute => @resource.id)
|
|
38
|
-
|
|
39
|
-
render json: serialize_resource(@resource.reload)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# PATCH /api/v3/store/customer/addresses/:id
|
|
24
|
+
# PATCH /api/v3/store/customers/me/addresses/:id
|
|
43
25
|
def update
|
|
44
26
|
result = Spree.address_update_service.call(
|
|
45
27
|
address: @resource,
|
|
@@ -74,7 +56,8 @@ module Spree
|
|
|
74
56
|
def permitted_params
|
|
75
57
|
params.permit(
|
|
76
58
|
:first_name, :last_name, :address1, :address2, :city,
|
|
77
|
-
:postal_code, :phone, :company, :country_iso, :state_abbr, :state_name
|
|
59
|
+
:postal_code, :phone, :company, :country_iso, :state_abbr, :state_name,
|
|
60
|
+
:is_default_billing, :is_default_shipping
|
|
78
61
|
)
|
|
79
62
|
end
|
|
80
63
|
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
module Api
|
|
3
|
+
module V3
|
|
4
|
+
module Store
|
|
5
|
+
module Customer
|
|
6
|
+
class StoreCreditsController < ResourceController
|
|
7
|
+
prepend_before_action :require_authentication!
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
def set_parent
|
|
12
|
+
@parent = current_user
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def parent_association
|
|
16
|
+
:store_credits
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def scope
|
|
20
|
+
super.for_store(current_store).where(currency: current_currency)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def model_class
|
|
24
|
+
Spree::StoreCredit
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def serializer_class
|
|
28
|
+
Spree.api.store_credit_serializer
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Authorization is handled by set_parent scoping to current_user
|
|
32
|
+
def authorize_resource!(*)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -7,11 +7,11 @@ module Spree
|
|
|
7
7
|
city: [:string, nullable: true], postal_code: [:string, nullable: true], phone: [:string, nullable: true],
|
|
8
8
|
company: [:string, nullable: true], state_abbr: [:string, nullable: true], state_name: [:string, nullable: true],
|
|
9
9
|
state_text: [:string, nullable: true], country_iso: :string, country_name: :string,
|
|
10
|
-
quick_checkout: :boolean
|
|
10
|
+
quick_checkout: :boolean, is_default_billing: :boolean, is_default_shipping: :boolean
|
|
11
11
|
|
|
12
12
|
attributes :first_name, :last_name, :full_name, :address1, :address2, :postal_code,
|
|
13
13
|
:city, :phone, :company, :country_name, :country_iso, :state_text,
|
|
14
|
-
:state_abbr, :quick_checkout
|
|
14
|
+
:state_abbr, :quick_checkout, :is_default_billing, :is_default_shipping
|
|
15
15
|
|
|
16
16
|
# State name - used for countries without predefined states
|
|
17
17
|
attribute :state_name do |address|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
module Api
|
|
3
|
+
module V3
|
|
4
|
+
module Admin
|
|
5
|
+
class GiftCardSerializer < V3::GiftCardSerializer
|
|
6
|
+
typelize metadata: 'Record<string, unknown> | null'
|
|
7
|
+
|
|
8
|
+
attribute :metadata do |gift_card|
|
|
9
|
+
gift_card.metadata.presence
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
attributes created_at: :iso8601, updated_at: :iso8601
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -50,6 +50,7 @@ module Spree
|
|
|
50
50
|
|
|
51
51
|
one :billing_address, resource: Spree.api.admin_address_serializer, if: proc { expand?('billing_address') }
|
|
52
52
|
one :shipping_address, resource: Spree.api.admin_address_serializer, if: proc { expand?('shipping_address') }
|
|
53
|
+
one :gift_card, resource: Spree.api.admin_gift_card_serializer
|
|
53
54
|
|
|
54
55
|
many :payment_methods, resource: Spree.api.admin_payment_method_serializer, if: proc { expand?('payment_methods') }
|
|
55
56
|
|
|
@@ -14,9 +14,13 @@ module Spree
|
|
|
14
14
|
tax_total: :string, display_tax_total: :string,
|
|
15
15
|
included_tax_total: :string, display_included_tax_total: :string,
|
|
16
16
|
additional_tax_total: :string, display_additional_tax_total: :string,
|
|
17
|
+
store_credit_total: :string, display_store_credit_total: :string,
|
|
18
|
+
gift_card_total: :string, display_gift_card_total: :string,
|
|
19
|
+
covered_by_store_credit: :boolean,
|
|
17
20
|
total: :string, display_total: :string,
|
|
18
21
|
shipping_eq_billing_address: :boolean,
|
|
19
|
-
billing_address: { nullable: true }, shipping_address: { nullable: true }
|
|
22
|
+
billing_address: { nullable: true }, shipping_address: { nullable: true },
|
|
23
|
+
gift_card: { nullable: true }
|
|
20
24
|
|
|
21
25
|
# Override ID to use cart_ prefix
|
|
22
26
|
attribute :id do |order|
|
|
@@ -33,6 +37,20 @@ module Spree
|
|
|
33
37
|
:delivery_total, :display_delivery_total,
|
|
34
38
|
created_at: :iso8601, updated_at: :iso8601
|
|
35
39
|
|
|
40
|
+
attribute :store_credit_total do |order|
|
|
41
|
+
order.total_applied_store_credit.to_s
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
attribute :display_store_credit_total do |order|
|
|
45
|
+
order.display_total_applied_store_credit.to_s
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
attributes :gift_card_total, :display_gift_card_total
|
|
49
|
+
|
|
50
|
+
attribute :covered_by_store_credit do |order|
|
|
51
|
+
order.covered_by_store_credit?
|
|
52
|
+
end
|
|
53
|
+
|
|
36
54
|
attribute :current_step do |order|
|
|
37
55
|
order.current_checkout_step
|
|
38
56
|
end
|
|
@@ -57,6 +75,7 @@ module Spree
|
|
|
57
75
|
one :shipping_address, resource: Spree.api.address_serializer
|
|
58
76
|
|
|
59
77
|
many :payment_methods, resource: Spree.api.payment_method_serializer
|
|
78
|
+
one :gift_card, resource: Spree.api.gift_card_serializer
|
|
60
79
|
end
|
|
61
80
|
end
|
|
62
81
|
end
|
|
@@ -6,11 +6,24 @@ module Spree
|
|
|
6
6
|
class CustomerSerializer < BaseSerializer
|
|
7
7
|
typelize email: :string, first_name: [:string, nullable: true], last_name: [:string, nullable: true],
|
|
8
8
|
phone: [:string, nullable: true], accepts_email_marketing: :boolean,
|
|
9
|
+
available_store_credit_total: :string, display_available_store_credit_total: :string,
|
|
9
10
|
default_billing_address: { nullable: true }, default_shipping_address: { nullable: true }
|
|
10
11
|
|
|
11
12
|
attributes :email, :first_name, :last_name, :phone, :accepts_email_marketing,
|
|
12
13
|
created_at: :iso8601, updated_at: :iso8601
|
|
13
14
|
|
|
15
|
+
attribute :available_store_credit_total do |user, params|
|
|
16
|
+
store = params&.dig(:store) || Spree::Current.store
|
|
17
|
+
currency = params&.dig(:currency) || Spree::Current.currency || store&.default_currency
|
|
18
|
+
user.total_available_store_credit(currency, store).to_s
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
attribute :display_available_store_credit_total do |user, params|
|
|
22
|
+
store = params&.dig(:store) || Spree::Current.store
|
|
23
|
+
currency = params&.dig(:currency) || Spree::Current.currency || store&.default_currency
|
|
24
|
+
Spree::Money.new(user.total_available_store_credit(currency, store), currency: currency).to_s
|
|
25
|
+
end
|
|
26
|
+
|
|
14
27
|
many :addresses, resource: Spree.api.address_serializer
|
|
15
28
|
one :bill_address, key: :default_billing_address, resource: Spree.api.address_serializer
|
|
16
29
|
one :ship_address, key: :default_shipping_address, resource: Spree.api.address_serializer
|
|
@@ -14,8 +14,12 @@ module Spree
|
|
|
14
14
|
tax_total: :string, display_tax_total: :string,
|
|
15
15
|
included_tax_total: :string, display_included_tax_total: :string,
|
|
16
16
|
additional_tax_total: :string, display_additional_tax_total: :string,
|
|
17
|
+
store_credit_total: :string, display_store_credit_total: :string,
|
|
18
|
+
gift_card_total: :string, display_gift_card_total: :string,
|
|
19
|
+
covered_by_store_credit: :boolean,
|
|
17
20
|
total: :string, display_total: :string, completed_at: [:string, nullable: true],
|
|
18
|
-
billing_address: { nullable: true }, shipping_address: { nullable: true }
|
|
21
|
+
billing_address: { nullable: true }, shipping_address: { nullable: true },
|
|
22
|
+
gift_card: { nullable: true }
|
|
19
23
|
|
|
20
24
|
attributes :number, :email, :customer_note,
|
|
21
25
|
:currency, :locale, :total_quantity,
|
|
@@ -27,12 +31,27 @@ module Spree
|
|
|
27
31
|
:delivery_total, :display_delivery_total, :fulfillment_status, :payment_status,
|
|
28
32
|
completed_at: :iso8601, created_at: :iso8601, updated_at: :iso8601
|
|
29
33
|
|
|
34
|
+
attribute :store_credit_total do |order|
|
|
35
|
+
order.total_applied_store_credit.to_s
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
attribute :display_store_credit_total do |order|
|
|
39
|
+
order.display_total_applied_store_credit.to_s
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
attributes :gift_card_total, :display_gift_card_total
|
|
43
|
+
|
|
44
|
+
attribute :covered_by_store_credit do |order|
|
|
45
|
+
order.covered_by_store_credit?
|
|
46
|
+
end
|
|
47
|
+
|
|
30
48
|
many :discounts, resource: Spree.api.discount_serializer
|
|
31
49
|
many :line_items, key: :items, resource: Spree.api.line_item_serializer
|
|
32
50
|
many :fulfillments, resource: Spree.api.fulfillment_serializer
|
|
33
51
|
many :payments, resource: Spree.api.payment_serializer
|
|
34
52
|
one :billing_address, resource: Spree.api.address_serializer
|
|
35
53
|
one :shipping_address, resource: Spree.api.address_serializer
|
|
54
|
+
one :gift_card, resource: Spree.api.gift_card_serializer
|
|
36
55
|
end
|
|
37
56
|
end
|
|
38
57
|
end
|
|
@@ -4,7 +4,7 @@ module Spree
|
|
|
4
4
|
# Store API Product Serializer
|
|
5
5
|
# Customer-facing product data with limited fields
|
|
6
6
|
class ProductSerializer < BaseSerializer
|
|
7
|
-
typelize name: :string, description: [:string, nullable: true], slug: :string,
|
|
7
|
+
typelize name: :string, description: [:string, nullable: true], description_html: [:string, nullable: true], slug: :string,
|
|
8
8
|
meta_description: [:string, nullable: true], meta_keywords: [:string, nullable: true],
|
|
9
9
|
variant_count: :number,
|
|
10
10
|
default_variant_id: :string,
|
|
@@ -15,7 +15,7 @@ module Spree
|
|
|
15
15
|
original_price: ['Price', nullable: true],
|
|
16
16
|
tags: [:string, multi: true]
|
|
17
17
|
|
|
18
|
-
attributes :name, :
|
|
18
|
+
attributes :name, :slug,
|
|
19
19
|
:meta_description, :meta_keywords,
|
|
20
20
|
:variant_count,
|
|
21
21
|
available_on: :iso8601, created_at: :iso8601, updated_at: :iso8601
|
|
@@ -36,6 +36,16 @@ module Spree
|
|
|
36
36
|
product.available?
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
attribute :description do |product|
|
|
40
|
+
next if product.description.blank?
|
|
41
|
+
|
|
42
|
+
Nokogiri::HTML.fragment(product.description).text.squish
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
attribute :description_html do |product|
|
|
46
|
+
product.description
|
|
47
|
+
end
|
|
48
|
+
|
|
39
49
|
attribute :default_variant_id do |product|
|
|
40
50
|
product.default_variant&.prefixed_id
|
|
41
51
|
end
|
data/config/routes.rb
CHANGED
|
@@ -39,9 +39,8 @@ Spree::Core::Engine.add_routes do
|
|
|
39
39
|
end
|
|
40
40
|
resources :items, only: [:create, :update, :destroy], controller: 'carts/items'
|
|
41
41
|
resources :coupon_codes, only: [:create, :destroy], controller: 'carts/coupon_codes'
|
|
42
|
-
resources :fulfillments, only: [:
|
|
43
|
-
resources :
|
|
44
|
-
resources :payments, only: [:index, :show, :create], controller: 'carts/payments'
|
|
42
|
+
resources :fulfillments, only: [:update], controller: 'carts/fulfillments'
|
|
43
|
+
resources :payments, only: [:create], controller: 'carts/payments'
|
|
45
44
|
resources :payment_sessions, only: [:create, :show, :update], controller: 'carts/payment_sessions' do
|
|
46
45
|
member do
|
|
47
46
|
patch :complete
|
|
@@ -53,23 +52,21 @@ Spree::Core::Engine.add_routes do
|
|
|
53
52
|
# Orders (single order lookup, guest-accessible via order token)
|
|
54
53
|
resources :orders, only: [:show]
|
|
55
54
|
|
|
56
|
-
#
|
|
55
|
+
# Customers
|
|
57
56
|
resources :customers, only: [:create]
|
|
58
|
-
get 'customer', to: 'customers#show'
|
|
59
|
-
patch 'customer', to: 'customers#update'
|
|
60
57
|
|
|
61
|
-
#
|
|
62
|
-
namespace :customer, path: '
|
|
58
|
+
# Current customer profile and nested resources (/customers/me/...)
|
|
59
|
+
namespace :customer, path: 'customers/me' do
|
|
60
|
+
get '/', action: :show, controller: '/spree/api/v3/store/customers'
|
|
61
|
+
patch '/', action: :update, controller: '/spree/api/v3/store/customers'
|
|
62
|
+
|
|
63
63
|
resources :password_resets, only: [:create, :update]
|
|
64
64
|
|
|
65
65
|
resources :orders, only: [:index, :show]
|
|
66
|
-
resources :addresses, only: [:index, :show, :create, :update, :destroy]
|
|
67
|
-
member do
|
|
68
|
-
patch :mark_as_default
|
|
69
|
-
end
|
|
70
|
-
end
|
|
66
|
+
resources :addresses, only: [:index, :show, :create, :update, :destroy]
|
|
71
67
|
resources :credit_cards, only: [:index, :show, :destroy]
|
|
72
68
|
resources :gift_cards, only: [:index, :show]
|
|
69
|
+
resources :store_credits, only: [:index, :show]
|
|
73
70
|
resources :payment_setup_sessions, only: [:create, :show] do
|
|
74
71
|
member do
|
|
75
72
|
patch :complete
|
|
@@ -170,6 +170,7 @@ module Spree
|
|
|
170
170
|
admin_stock_item_serializer: 'Spree::Api::V3::Admin::StockItemSerializer',
|
|
171
171
|
admin_shipment_serializer: 'Spree::Api::V3::Admin::FulfillmentSerializer',
|
|
172
172
|
admin_fulfillment_serializer: 'Spree::Api::V3::Admin::FulfillmentSerializer',
|
|
173
|
+
admin_gift_card_serializer: 'Spree::Api::V3::Admin::GiftCardSerializer',
|
|
173
174
|
admin_payment_serializer: 'Spree::Api::V3::Admin::PaymentSerializer',
|
|
174
175
|
admin_refund_serializer: 'Spree::Api::V3::Admin::RefundSerializer',
|
|
175
176
|
admin_adjustment_serializer: 'Spree::Api::V3::Admin::AdjustmentSerializer',
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.4.0.
|
|
4
|
+
version: 5.4.0.rc2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vendo Connect Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rswag-specs
|
|
@@ -86,14 +86,14 @@ dependencies:
|
|
|
86
86
|
requirements:
|
|
87
87
|
- - '='
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 5.4.0.
|
|
89
|
+
version: 5.4.0.rc2
|
|
90
90
|
type: :runtime
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
94
|
- - '='
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 5.4.0.
|
|
96
|
+
version: 5.4.0.rc2
|
|
97
97
|
description: Spree's API
|
|
98
98
|
email:
|
|
99
99
|
- hello@spreecommerce.org
|
|
@@ -124,7 +124,6 @@ files:
|
|
|
124
124
|
- app/controllers/spree/api/v3/store/carts/coupon_codes_controller.rb
|
|
125
125
|
- app/controllers/spree/api/v3/store/carts/fulfillments_controller.rb
|
|
126
126
|
- app/controllers/spree/api/v3/store/carts/items_controller.rb
|
|
127
|
-
- app/controllers/spree/api/v3/store/carts/payment_methods_controller.rb
|
|
128
127
|
- app/controllers/spree/api/v3/store/carts/payment_sessions_controller.rb
|
|
129
128
|
- app/controllers/spree/api/v3/store/carts/payments_controller.rb
|
|
130
129
|
- app/controllers/spree/api/v3/store/carts/store_credits_controller.rb
|
|
@@ -139,6 +138,7 @@ files:
|
|
|
139
138
|
- app/controllers/spree/api/v3/store/customer/orders_controller.rb
|
|
140
139
|
- app/controllers/spree/api/v3/store/customer/password_resets_controller.rb
|
|
141
140
|
- app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rb
|
|
141
|
+
- app/controllers/spree/api/v3/store/customer/store_credits_controller.rb
|
|
142
142
|
- app/controllers/spree/api/v3/store/customers_controller.rb
|
|
143
143
|
- app/controllers/spree/api/v3/store/digitals_controller.rb
|
|
144
144
|
- app/controllers/spree/api/v3/store/locales_controller.rb
|
|
@@ -167,6 +167,7 @@ files:
|
|
|
167
167
|
- app/serializers/spree/api/v3/admin/digital_link_serializer.rb
|
|
168
168
|
- app/serializers/spree/api/v3/admin/discount_serializer.rb
|
|
169
169
|
- app/serializers/spree/api/v3/admin/fulfillment_serializer.rb
|
|
170
|
+
- app/serializers/spree/api/v3/admin/gift_card_serializer.rb
|
|
170
171
|
- app/serializers/spree/api/v3/admin/line_item_serializer.rb
|
|
171
172
|
- app/serializers/spree/api/v3/admin/media_serializer.rb
|
|
172
173
|
- app/serializers/spree/api/v3/admin/metafield_serializer.rb
|
|
@@ -268,9 +269,9 @@ licenses:
|
|
|
268
269
|
- BSD-3-Clause
|
|
269
270
|
metadata:
|
|
270
271
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
|
271
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.4.0.
|
|
272
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.4.0.rc2
|
|
272
273
|
documentation_uri: https://docs.spreecommerce.org/
|
|
273
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.4.0.
|
|
274
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.4.0.rc2
|
|
274
275
|
post_install_message:
|
|
275
276
|
rdoc_options: []
|
|
276
277
|
require_paths:
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module Spree
|
|
2
|
-
module Api
|
|
3
|
-
module V3
|
|
4
|
-
module Store
|
|
5
|
-
module Carts
|
|
6
|
-
class PaymentMethodsController < Store::BaseController
|
|
7
|
-
include Spree::Api::V3::CartResolvable
|
|
8
|
-
|
|
9
|
-
before_action :find_cart!
|
|
10
|
-
|
|
11
|
-
# GET /api/v3/store/carts/:cart_id/payment_methods
|
|
12
|
-
def index
|
|
13
|
-
methods = @cart.collect_frontend_payment_methods
|
|
14
|
-
render json: {
|
|
15
|
-
data: methods.map { |m| Spree.api.payment_method_serializer.new(m, params: serializer_params).to_h },
|
|
16
|
-
meta: { count: methods.size }
|
|
17
|
-
}
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|