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.

Added Platform Payments API for fetching Payments (#11414)

Damian Legawieceeab2e754fb9
diff --git a/api/app/controllers/spree/api/v2/platform/payments_controller.rb b/api/app/controllers/spree/api/v2/platform/payments_controller.rb
new file mode 100644
index 0000000000..79f8329483
--- /dev/null
+++ b/api/app/controllers/spree/api/v2/platform/payments_controller.rb
@@ -0,0 +1,15 @@
+module Spree
+ module Api
+ module V2
+ module Platform
+ class PaymentsController < ResourceController
+ private
+
+ def model_class
+ Spree::Payment
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/api/config/routes.rb b/api/config/routes.rb
index 92cc93d153..29d4da239e 100644
--- a/api/config/routes.rb
+++ b/api/config/routes.rb
@@ -233,13 +233,14 @@ Spree::Core::Engine.add_routes do
# Payments API
resources :payments do
- member do
- patch :authorize
- patch :capture
- patch :purchase
- patch :void
- patch :credit
- end
+ # TODO: support custom actions
+ # member do
+ # patch :authorize
+ # patch :capture
+ # patch :purchase
+ # patch :void
+ # patch :credit
+ # end
end
# Geo API
diff --git a/api/docs/v2/platform/index.yaml b/api/docs/v2/platform/index.yaml
index ad0ae68e31..cccfd2a364 100644
--- a/api/docs/v2/platform/index.yaml
+++ b/api/docs/v2/platform/index.yaml
@@ -69,8 +69,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-20T13:33:10.849Z'
- updated_at: '2021-10-20T13:33:10.849Z'
+ created_at: '2021-10-20T14:21:21.713Z'
+ updated_at: '2021-10-20T14:21:21.713Z'
deleted_at:
label:
relationships:
@@ -97,8 +97,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-20T13:33:10.854Z'
- updated_at: '2021-10-20T13:33:10.854Z'
+ created_at: '2021-10-20T14:21:21.718Z'
+ updated_at: '2021-10-20T14:21:21.718Z'
deleted_at:
label:
relationships:
@@ -168,8 +168,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-20T13:33:11.068Z'
- updated_at: '2021-10-20T13:33:11.068Z'
+ created_at: '2021-10-20T14:21:21.926Z'
+ updated_at: '2021-10-20T14:21:21.926Z'
deleted_at:
label:
relationships:
@@ -259,8 +259,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-20T13:33:11.112Z'
- updated_at: '2021-10-20T13:33:11.112Z'
+ created_at: '2021-10-20T14:21:21.975Z'
+ updated_at: '2021-10-20T14:21:21.975Z'
deleted_at:
label:
relationships:
@@ -333,8 +333,8 @@ paths:
state_name:
alternative_phone: 555-555-0199
company: Company
- created_at: '2021-10-20T13:33:11.176Z'
- updated_at: '2021-10-20T13:33:11.187Z'
+ created_at: '2021-10-20T14:21:22.041Z'
+ updated_at: '2021-10-20T14:21:22.053Z'
deleted_at:
label:
relationships:
@@ -466,8 +466,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-10-20T13:33:11.454Z'
- updated_at: '2021-10-20T13:33:11.454Z'
+ created_at: '2021-10-20T14:21:22.345Z'
+ updated_at: '2021-10-20T14:21:22.345Z'
state: open
included: false
display_amount: "$100.00"
@@ -493,8 +493,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-10-20T13:33:11.481Z'
- updated_at: '2021-10-20T13:33:11.481Z'
+ created_at: '2021-10-20T14:21:22.373Z'
+ updated_at: '2021-10-20T14:21:22.373Z'
state: open
included: false
display_amount: "$100.00"
@@ -563,8 +563,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-10-20T13:33:11.812Z'
- updated_at: '2021-10-20T13:33:11.812Z'
+ created_at: '2021-10-20T14:21:22.701Z'
+ updated_at: '2021-10-20T14:21:22.701Z'
state: open
included: false
display_amount: "$100.00"
@@ -642,8 +642,8 @@ paths:
label: Shipping
mandatory:
eligible: true
- created_at: '2021-10-20T13:33:11.966Z'
- updated_at: '2021-10-20T13:33:11.973Z'
+ created_at: '2021-10-20T14:21:22.832Z'
+ updated_at: '2021-10-20T14:21:22.838Z'
state: open
included: false
display_amount: "$1.00"
@@ -715,8 +715,8 @@ paths:
label: New label
mandatory:
eligible: true
- created_at: '2021-10-20T13:33:12.208Z'
- updated_at: '2021-10-20T13:33:12.224Z'
+ created_at: '2021-10-20T14:21:23.075Z'
+ updated_at: '2021-10-20T14:21:23.101Z'
state: open
included: false
display_amount: "$15.00"
@@ -844,8 +844,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-20T13:33:12.919Z'
- updated_at: '2021-10-20T13:33:12.919Z'
+ created_at: '2021-10-20T14:21:23.797Z'
+ updated_at: '2021-10-20T14:21:23.797Z'
relationships:
product:
data:
@@ -859,8 +859,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-20T13:33:13.008Z'
- updated_at: '2021-10-20T13:33:13.008Z'
+ created_at: '2021-10-20T14:21:23.900Z'
+ updated_at: '2021-10-20T14:21:23.900Z'
relationships:
product:
data:
@@ -917,8 +917,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-20T13:33:13.682Z'
- updated_at: '2021-10-20T13:33:13.682Z'
+ created_at: '2021-10-20T14:21:24.524Z'
+ updated_at: '2021-10-20T14:21:24.524Z'
relationships:
product:
data:
@@ -981,8 +981,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-20T13:33:13.902Z'
- updated_at: '2021-10-20T13:33:13.902Z'
+ created_at: '2021-10-20T14:21:24.731Z'
+ updated_at: '2021-10-20T14:21:24.731Z'
relationships:
product:
data:
@@ -1042,8 +1042,8 @@ paths:
type: classification
attributes:
position: 1
- created_at: '2021-10-20T13:33:14.379Z'
- updated_at: '2021-10-20T13:33:14.379Z'
+ created_at: '2021-10-20T14:21:25.150Z'
+ updated_at: '2021-10-20T14:21:25.150Z'
relationships:
product:
data:
@@ -1153,8 +1153,8 @@ paths:
type: classification
attributes:
position: 2
- created_at: '2021-10-20T13:33:15.464Z'
- updated_at: '2021-10-20T13:33:15.491Z'
+ created_at: '2021-10-20T14:21:26.396Z'
+ updated_at: '2021-10-20T14:21:26.433Z'
relationships:
product:
data:
@@ -1245,35 +1245,35 @@ paths:
- id: '1'
type: cms_page
attributes:
- title: Nesciunt tempora debitis sunt odio atque doloremque
- quae.
+ title: Nesciunt officia eum reprehenderit reiciendis aut necessitatibus
+ laudantium veritatis.
meta_title:
content:
meta_description:
visible: true
- slug: nesciunt-tempora-debitis-sunt-odio-atque-doloremque-quae
+ slug: nesciunt-officia-eum-reprehenderit-reiciendis-aut-necessitatibus-laudantium-veritatis
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-20T13:33:15.984Z'
- updated_at: '2021-10-20T13:33:15.984Z'
+ created_at: '2021-10-20T14:21:27.166Z'
+ updated_at: '2021-10-20T14:21:27.166Z'
relationships:
cms_sections:
data: []
- id: '2'
type: cms_page
attributes:
- title: Laboriosam enim alias consequatur est sequi quis laudantium.
+ title: Officia praesentium quas aliquam quod voluptate.
meta_title:
content:
meta_description:
visible: true
- slug: laboriosam-enim-alias-consequatur-est-sequi-quis-laudantium
+ slug: officia-praesentium-quas-aliquam-quod-voluptate
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-20T13:33:15.989Z'
- updated_at: '2021-10-20T13:33:15.989Z'
+ created_at: '2021-10-20T14:21:27.181Z'
+ updated_at: '2021-10-20T14:21:27.181Z'
relationships:
cms_sections:
data: []
@@ -1323,17 +1323,17 @@ paths:
id: '5'
type: cms_page
attributes:
- title: Fugiat sapiente culpa autem earum quidem.
+ title: Saepe ullam aspernatur ex sit hic deleniti facere.
meta_title:
content:
meta_description:
visible: true
- slug: fugiat-sapiente-culpa-autem-earum-quidem
+ slug: saepe-ullam-aspernatur-ex-sit-hic-deleniti-facere
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-20T13:33:16.088Z'
- updated_at: '2021-10-20T13:33:16.088Z'
+ created_at: '2021-10-20T14:21:27.298Z'
+ updated_at: '2021-10-20T14:21:27.298Z'
relationships:
cms_sections:
data: []
@@ -1389,17 +1389,17 @@ paths:
id: '6'
type: cms_page
attributes:
- title: Iste eum consequatur nemo voluptatem sed voluptas.
+ title: Dignissimos iste beatae recusandae magnam.
meta_title:
content:
meta_description:
visible: true
- slug: iste-eum-consequatur-nemo-voluptatem-sed-voluptas
+ slug: dignissimos-iste-beatae-recusandae-magnam
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-20T13:33:16.147Z'
- updated_at: '2021-10-20T13:33:16.147Z'
+ created_at: '2021-10-20T14:21:27.362Z'
+ updated_at: '2021-10-20T14:21:27.362Z'
relationships:
cms_sections:
data: []
@@ -1457,12 +1457,12 @@ paths:
content:
meta_description:
visible: true
- slug: provident-rem-voluptatum-earum-natus
+ slug: earum-a-beatae-ipsa-molestias-accusamus-ratione
type: Spree::Cms::Pages::StandardPage
locale: en
deleted_at:
- created_at: '2021-10-20T13:33:16.245Z'
- updated_at: '2021-10-20T13:33:16.259Z'
+ created_at: '2021-10-20T14:21:27.438Z'
+ updated_at: '2021-10-20T14:21:27.451Z'
relationships:
cms_sections:
data: []
@@ -1576,7 +1576,8 @@ paths:
- id: '1'
type: cms_section
attributes:
- name: Possimus dolore esse accusamus ratione similique.
+ name: Doloremque hic voluptatibus ipsa repellendus corrupti
+ dolorum quas.
content: {}
settings:
gutters: No Gutters
@@ -1585,8 +1586,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 1
linked_resource_type: Spree::Taxon
- created_at: '2021-10-20T13:33:16.516Z'
- updated_at: '2021-10-20T13:33:16.516Z'
+ created_at: '2021-10-20T14:21:27.755Z'
+ updated_at: '2021-10-20T14:21:27.755Z'
relationships:
cms_page:
data:
@@ -1597,7 +1598,7 @@ paths:
- id: '2'
type: cms_section
attributes:
- name: Eligendi quasi ullam vero incidunt.
+ name: Doloremque eum voluptates nisi iure eaque itaque.
content:
link_type_one: Spree::Taxon
link_type_two: Spree::Taxon
@@ -1609,8 +1610,8 @@ paths:
type: Spree::Cms::Sections::ImageGallery
position: 2
linked_resource_type:
- created_at: '2021-10-20T13:33:16.522Z'
- updated_at: '2021-10-20T13:33:16.522Z'
+ created_at: '2021-10-20T14:21:27.761Z'
+ updated_at: '2021-10-20T14:21:27.761Z'
relationships:
cms_page:
data:
@@ -1621,7 +1622,8 @@ paths:
- id: '3'
type: cms_section
attributes:
- name: Recusandae esse ipsam dolor delectus.
+ name: Quibusdam qui nesciunt quis velit provident officia
+ tenetur molestiae.
content: {}
settings:
gutters: No Gutters
@@ -1630,8 +1632,8 @@ paths:
type: Spree::Cms::Sections::FeaturedArticle
position: 3
linked_resource_type: Spree::Taxon
- created_at: '2021-10-20T13:33:16.539Z'
- updated_at: '2021-10-20T13:33:16.539Z'
+ created_at: '2021-10-20T14:21:27.772Z'
+ updated_at: '2021-10-20T14:21:27.772Z'
relationships:
cms_page:
data:
@@ -1642,7 +1644,7 @@ paths:
- id: '4'
type: cms_section
attributes:
- name: Quo corrupti esse pariatur minus voluptatum praesentium.
+ name: Omnis unde laudantium nisi corporis.
content: {}
settings:
gutters: No Gutters
@@ -1651,8 +1653,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-10-20T13:33:16.553Z'
- updated_at: '2021-10-20T13:33:16.553Z'
+ created_at: '2021-10-20T14:21:27.785Z'
+ updated_at: '2021-10-20T14:21:27.785Z'
relationships:
cms_page:
data:
@@ -1665,8 +1667,7 @@ paths:
- id: '5'
type: cms_section
attributes:
- name: Officiis nostrum tenetur sapiente magnam odit aliquid
- sit.
+ name: Optio et eaque aliquam sint.
content: {}
settings:
gutters: No Gutters
@@ -1675,8 +1676,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 5
linked_resource_type: Spree::Product
- created_at: '2021-10-20T13:33:16.567Z'
- updated_at: '2021-10-20T13:33:16.567Z'
+ created_at: '2021-10-20T14:21:27.797Z'
+ updated_at: '2021-10-20T14:21:27.797Z'
relationships:
cms_page:
data:
@@ -1732,7 +1733,8 @@ paths:
id: '14'
type: cms_section
attributes:
- name: Excepturi facilis eos similique cumque commodi.
+ name: Voluptatum molestiae aperiam tenetur minima natus excepturi
+ voluptate.
content: {}
settings:
gutters: No Gutters
@@ -1741,8 +1743,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-10-20T13:33:16.773Z'
- updated_at: '2021-10-20T13:33:16.773Z'
+ created_at: '2021-10-20T14:21:28.058Z'
+ updated_at: '2021-10-20T14:21:28.058Z'
relationships:
cms_page:
data:
@@ -1804,8 +1806,8 @@ paths:
id: '21'
type: cms_section
attributes:
- name: Vero inventore doloremque ullam incidunt consequatur
- aliquam.
+ name: Reprehenderit repudiandae perspiciatis aliquam voluptatum
+ illo quibusdam sequi autem.
content: {}
settings:
gutters: No Gutters
@@ -1814,8 +1816,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-10-20T13:33:16.946Z'
- updated_at: '2021-10-20T13:33:16.946Z'
+ created_at: '2021-10-20T14:21:28.231Z'
+ updated_at: '2021-10-20T14:21:28.231Z'
relationships:
cms_page:
data:
@@ -1883,8 +1885,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 4
linked_resource_type: Spree::Product
- created_at: '2021-10-20T13:33:17.245Z'
- updated_at: '2021-10-20T13:33:17.262Z'
+ created_at: '2021-10-20T14:21:28.533Z'
+ updated_at: '2021-10-20T14:21:28.553Z'
relationships:
cms_page:
data:
@@ -1986,7 +1988,7 @@ paths:
id: '58'
type: cms_section
attributes:
- name: Accusamus illum placeat a rerum perferendis debitis.
+ name: Laboriosam omnis repellendus reprehenderit quidem eaque.
content: {}
settings:
gutters: No Gutters
@@ -1995,8 +1997,8 @@ paths:
type: Spree::Cms::Sections::HeroImage
position: 3
linked_resource_type: Spree::Product
- created_at: '2021-10-20T13:33:18.022Z'
- updated_at: '2021-10-20T13:33:18.037Z'
+ created_at: '2021-10-20T14:21:29.244Z'
+ updated_at: '2021-10-20T14:21:29.260Z'
relationships:
cms_page:
data:
@@ -2054,9 +2056,9 @@ paths:
name: United States of America
numcode: 840
states_required: true
- updated_at: '2021-10-20T13:33:18.298Z'
+ updated_at: '2021-10-20T14:21:29.452Z'
zipcode_required: true
- created_at: '2021-10-20T13:33:18.298Z'
+ created_at: '2021-10-20T14:21:29.452Z'
relationships:
states:
data: []
@@ -2069,9 +2071,9 @@ paths:
name: NAME_2
numcode: 840
states_required: false
- updated_at: '2021-10-20T13:33:18.306Z'
+ updated_at: '2021-10-20T14:21:29.462Z'
zipcode_required: true
- created_at: '2021-10-20T13:33:18.306Z'
+ created_at: '2021-10-20T14:21:29.462Z'
relationships:
states:
data: []
@@ -2084,9 +2086,9 @@ paths:
name: NAME_3
numcode: 840
states_required: false
- updated_at: '2021-10-20T13:33:18.308Z'
+ updated_at: '2021-10-20T14:21:29.464Z'
zipcode_required: true
- created_at: '2021-10-20T13:33:18.308Z'
+ created_at: '2021-10-20T14:21:29.464Z'
relationships:
states:
data: []
@@ -2141,9 +2143,9 @@ paths:
name: NAME_6
numcode: 840
states_required: false
- updated_at: '2021-10-20T13:33:18.372Z'
+ updated_at: '2021-10-20T14:21:29.522Z'
zipcode_required: true
- created_at: '2021-10-20T13:33:18.372Z'
+ created_at: '2021-10-20T14:21:29.522Z'
relationships:
states:
data: []
@@ -2195,7 +2197,7 @@ paths:
- id: '1'
type: digital_link
attributes:
- token: oFF9NYvBCSJohNuropUqbWAE
+ token: RqCV4LtPqkjvrqXien6DNWdn
access_counter: 0
relationships:
digital:
@@ -2209,7 +2211,7 @@ paths:
- id: '2'
type: digital_link
attributes:
- token: HEfdTWti4BS9kkwYKMVFKPEs
+ token: JEDCxnaXWSH5Bo2tW93QE34L
access_counter: 0
relationships:
digital:
@@ -2259,7 +2261,7 @@ paths:
id: '5'
type: digital_link
attributes:
- token: x8gyPgBsrw6aBuAqrJhNq21G
+ token: cNxyUWmb7muF6FpVvfBgKauU
access_counter: 0
relationships:
digital:
@@ -2318,7 +2320,7 @@ paths:
id: '6'
type: digital_link
attributes:
- token: SvvLYt6FJ91xjBTGK6XrdozR
+ token: Rb6qzWnmhe4B4yTsTLVMRHV9
access_counter: 0
relationships:
digital:
@@ -2371,7 +2373,7 @@ paths:
id: '8'
type: digital_link
attributes:
- token: WoJW9DrPxcy8iDobDvZHJJbu
+ token: BHdnNooGF73m2qNbwxj2WQRj
access_counter: 0
relationships:
digital:
@@ -2474,7 +2476,7 @@ paths:
id: '13'
type: digital_link
attributes:
- token: dE8smCgXNtWGptHmFTRKhdoA
+ token: QxUTAQoh4uvfJ5Um8eDem5CR
access_counter: 0
relationships:
digital:
@@ -2859,8 +2861,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-10-20T13:33:31.105Z'
- updated_at: '2021-10-20T13:33:31.119Z'
+ created_at: '2021-10-20T14:21:43.995Z'
+ updated_at: '2021-10-20T14:21:44.006Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -2870,14 +2872,14 @@ paths:
pre_tax_amount: '10.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_price: "$10.00"
single_display_amount: "$10.00"
+ display_price: "$10.00"
display_discounted_amount: "$10.00"
display_total: "$10.00"
display_subtotal: "$10.00"
- display_final_amount: "$10.00"
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
+ display_final_amount: "$10.00"
display_promo_total: "$0.00"
display_pre_tax_amount: "$10.00"
display_included_tax_total: "$0.00"
@@ -2906,8 +2908,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-10-20T13:33:31.175Z'
- updated_at: '2021-10-20T13:33:31.183Z'
+ created_at: '2021-10-20T14:21:44.052Z'
+ updated_at: '2021-10-20T14:21:44.058Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -2917,14 +2919,14 @@ paths:
pre_tax_amount: '10.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_price: "$10.00"
single_display_amount: "$10.00"
+ display_price: "$10.00"
display_discounted_amount: "$10.00"
display_total: "$10.00"
display_subtotal: "$10.00"
- display_final_amount: "$10.00"
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
+ display_final_amount: "$10.00"
display_promo_total: "$0.00"
display_pre_tax_amount: "$10.00"
display_included_tax_total: "$0.00"
@@ -2996,8 +2998,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-10-20T13:33:31.479Z'
- updated_at: '2021-10-20T13:33:31.603Z'
+ created_at: '2021-10-20T14:21:44.352Z'
+ updated_at: '2021-10-20T14:21:44.402Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3007,14 +3009,14 @@ paths:
pre_tax_amount: '10.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_price: "$10.00"
single_display_amount: "$10.00"
+ display_price: "$10.00"
display_discounted_amount: "$10.00"
display_total: "$10.00"
display_subtotal: "$10.00"
- display_final_amount: "$10.00"
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
+ display_final_amount: "$10.00"
display_promo_total: "$0.00"
display_pre_tax_amount: "$10.00"
display_included_tax_total: "$0.00"
@@ -3095,8 +3097,8 @@ paths:
attributes:
quantity: 1
price: '10.0'
- created_at: '2021-10-20T13:33:31.782Z'
- updated_at: '2021-10-20T13:33:31.791Z'
+ created_at: '2021-10-20T14:21:44.585Z'
+ updated_at: '2021-10-20T14:21:44.593Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3106,14 +3108,14 @@ paths:
pre_tax_amount: '10.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_price: "$10.00"
single_display_amount: "$10.00"
+ display_price: "$10.00"
display_discounted_amount: "$10.00"
display_total: "$10.00"
display_subtotal: "$10.00"
- display_final_amount: "$10.00"
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
+ display_final_amount: "$10.00"
display_promo_total: "$0.00"
display_pre_tax_amount: "$10.00"
display_included_tax_total: "$0.00"
@@ -3188,8 +3190,8 @@ paths:
attributes:
quantity: 4
price: '10.0'
- created_at: '2021-10-20T13:33:32.121Z'
- updated_at: '2021-10-20T13:33:32.175Z'
+ created_at: '2021-10-20T14:21:44.887Z'
+ updated_at: '2021-10-20T14:21:44.938Z'
currency: USD
cost_price: '17.0'
adjustment_total: '0.0'
@@ -3199,14 +3201,14 @@ paths:
pre_tax_amount: '40.0'
taxable_adjustment_total: '0.0'
non_taxable_adjustment_total: '0.0'
- display_price: "$10.00"
single_display_amount: "$10.00"
+ display_price: "$10.00"
display_discounted_amount: "$40.00"
display_total: "$40.00"
display_subtotal: "$40.00"
- display_final_amount: "$40.00"
display_adjustment_total: "$0.00"
display_additional_tax_total: "$0.00"
+ display_final_amount: "$40.00"
display_promo_total: "$0.00"
display_pre_tax_amount: "$40.00"
display_included_tax_total: "$0.00"
@@ -3237,10 +3239,10 @@ paths:
examples:
Example:
value:
- error: 'Quantity selected of "Product #133 - 9557" is not available.'
+ error: 'Quantity selected of "Product #133 - 1556" is not available.'
errors:
quantity:
- - 'selected of "Product #133 - 9557" is not available.'
+ - 'selected of "Product #133 - 1556" is not available.'
'404':
description: Record not found
content:
@@ -3350,8 +3352,8 @@ paths:
lft: 2
rgt: 3
depth: 1
- created_at: '2021-10-20T13:33:32.962Z'
- updated_at: '2021-10-20T13:33:32.968Z'
+ created_at: '2021-10-20T14:21:45.724Z'
+ updated_at: '2021-10-20T14:21:45.731Z'
link:
is_container: false
is_root: false
@@ -3387,8 +3389,8 @@ paths:
lft: 4
rgt: 5
depth: 1
- created_at: '2021-10-20T13:33:33.064Z'
- updated_at: '2021-10-20T13:33:33.073Z'
+ created_at: '2021-10-20T14:21:45.816Z'
+ updated_at: '2021-10-20T14:21:45.823Z'
link:
is_container: false
is_root: false
@@ -3424,8 +3426,8 @@ paths:
lft: 6
rgt: 7
depth: 1
- created_at: '2021-10-20T13:33:33.161Z'
- updated_at: '2021-10-20T13:33:33.168Z'
+ created_at: '2021-10-20T14:21:45.903Z'
+ updated_at: '2021-10-20T14:21:45.908Z'
link:
is_container: false
is_root: false
@@ -3461,8 +3463,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-10-20T13:33:33.254Z'
- updated_at: '2021-10-20T13:33:33.261Z'
+ created_at: '2021-10-20T14:21:45.993Z'
+ updated_at: '2021-10-20T14:21:46.001Z'
link:
is_container: false
is_root: false
@@ -3498,8 +3500,8 @@ paths:
lft: 10
rgt: 11
depth: 1
- created_at: '2021-10-20T13:33:33.339Z'
- updated_at: '2021-10-20T13:33:33.346Z'
+ created_at: '2021-10-20T14:21:46.084Z'
+ updated_at: '2021-10-20T14:21:46.091Z'
link:
is_container: false
is_root: false
@@ -3535,8 +3537,8 @@ paths:
lft: 12
rgt: 13
depth: 1
- created_at: '2021-10-20T13:33:33.427Z'
- updated_at: '2021-10-20T13:33:33.434Z'
+ created_at: '2021-10-20T14:21:46.172Z'
+ updated_at: '2021-10-20T14:21:46.178Z'
link:
is_container: false
is_root: false
@@ -3572,8 +3574,8 @@ paths:
lft: 14
rgt: 15
depth: 1
- created_at: '2021-10-20T13:33:33.510Z'
- updated_at: '2021-10-20T13:33:33.517Z'
+ created_at: '2021-10-20T14:21:46.259Z'
+ updated_at: '2021-10-20T14:21:46.266Z'
link:
is_container: false
is_root: false
@@ -3599,8 +3601,7 @@ paths:
- id: '1'
type: menu_item
attributes:
- name: Laudantium necessitatibus fugit cum similique illum
- at nam.
+ name: Quam odio esse voluptas magnam enim.
subtitle:
destination:
new_window: false
@@ -3610,8 +3611,8 @@ paths:
lft: 1
rgt: 16
depth: 0
- created_at: '2021-10-20T13:33:32.883Z'
- updated_at: '2021-10-20T13:33:33.531Z'
+ created_at: '2021-10-20T14:21:45.642Z'
+ updated_at: '2021-10-20T14:21:46.282Z'
link:
is_container: true
is_root: true
@@ -3700,8 +3701,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-10-20T13:33:34.613Z'
- updated_at: '2021-10-20T13:33:34.619Z'
+ created_at: '2021-10-20T14:21:47.329Z'
+ updated_at: '2021-10-20T14:21:47.335Z'
link:
is_container: false
is_root: false
@@ -3787,8 +3788,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-10-20T13:33:35.327Z'
- updated_at: '2021-10-20T13:33:35.334Z'
+ created_at: '2021-10-20T14:21:48.029Z'
+ updated_at: '2021-10-20T14:21:48.037Z'
link:
is_container: false
is_root: false
@@ -3870,8 +3871,8 @@ paths:
lft: 8
rgt: 9
depth: 1
- created_at: '2021-10-20T13:33:36.556Z'
- updated_at: '2021-10-20T13:33:36.596Z'
+ created_at: '2021-10-20T14:21:49.361Z'
+ updated_at: '2021-10-20T14:21:49.402Z'
link:
is_container: false
is_root: false
@@ -3996,8 +3997,8 @@ paths:
lft: 5
rgt: 6
depth: 2
- created_at: '2021-10-20T13:33:39.256Z'
- updated_at: '2021-10-20T13:33:39.291Z'
+ created_at: '2021-10-20T14:21:52.167Z'
+ updated_at: '2021-10-20T14:21:52.205Z'
link:
is_container: false
is_root: false
@@ -4089,25 +4090,25 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-10-20T13:33:40.089Z'
- updated_at: '2021-10-20T13:33:40.350Z'
+ created_at: '2021-10-20T14:21:52.940Z'
+ updated_at: '2021-10-20T14:21:53.143Z'
relationships:
menu_items:
data:
+ - id: '89'
+ type: menu_item
- id: '87'
type: menu_item
- id: '90'
type: menu_item
- - id: '89'
- type: menu_item
- id: '19'
type: menu
attributes:
name: Footer Menu
location: footer
locale: en
- created_at: '2021-10-20T13:33:40.101Z'
- updated_at: '2021-10-20T13:33:40.537Z'
+ created_at: '2021-10-20T14:21:52.951Z'
+ updated_at: '2021-10-20T14:21:53.319Z'
relationships:
menu_items:
data:
@@ -4166,8 +4167,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-10-20T13:33:40.999Z'
- updated_at: '2021-10-20T13:33:41.007Z'
+ created_at: '2021-10-20T14:21:53.838Z'
+ updated_at: '2021-10-20T14:21:53.846Z'
relationships:
menu_items:
data:
@@ -4231,8 +4232,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-10-20T13:33:41.055Z'
- updated_at: '2021-10-20T13:33:41.065Z'
+ created_at: '2021-10-20T14:21:53.893Z'
+ updated_at: '2021-10-20T14:21:53.903Z'
relationships:
menu_items:
data:
@@ -4290,8 +4291,8 @@ paths:
name: Main Menu
location: header
locale: en
- created_at: '2021-10-20T13:33:41.164Z'
- updated_at: '2021-10-20T13:33:41.175Z'
+ created_at: '2021-10-20T14:21:54.022Z'
+ updated_at: '2021-10-20T14:21:54.035Z'
relationships:
menu_items:
data:
@@ -4414,8 +4415,8 @@ paths:
name: foo-size-68
presentation: Size
position: 1
- created_at: '2021-10-20T13:33:41.395Z'
- updated_at: '2021-10-20T13:33:41.395Z'
+ created_at: '2021-10-20T14:21:54.302Z'
+ updated_at: '2021-10-20T14:21:54.302Z'
filterable: true
relationships:
option_values:
@@ -4426,8 +4427,8 @@ paths:
name: foo-size-69
presentation: Size
position: 2
- created_at: '2021-10-20T13:33:41.397Z'
- updated_at: '2021-10-20T13:33:41.397Z'
+ created_at: '2021-10-20T14:21:54.304Z'
+ updated_at: '2021-10-20T14:21:54.304Z'
filterable: true
relationships:
option_values:
@@ -4474,8 +4475,8 @@ paths:
name: foo-size-72
presentation: Size
position: 1
- created_at: '2021-10-20T13:33:41.468Z'
- updated_at: '2021-10-20T13:33:41.468Z'
+ created_at: '2021-10-20T14:21:54.368Z'
+ updated_at: '2021-10-20T14:21:54.368Z'
filterable: true
relationships:
option_values:
@@ -4528,8 +4529,8 @@ paths:
name: foo-size-73
presentation: Size
position: 1
- created_at: '2021-10-20T13:33:41.507Z'
- updated_at: '2021-10-20T13:33:41.507Z'
+ created_at: '2021-10-20T14:21:54.408Z'
+ updated_at: '2021-10-20T14:21:54.408Z'
filterable: true
relationships:
option_values:
@@ -4579,8 +4580,8 @@ paths:
name: Size-X
presentation: Size
position: 1
- created_at: '2021-10-20T13:33:41.570Z'
- updated_at: '2021-10-20T13:33:41.580Z'
+ created_at: '2021-10-20T14:21:54.479Z'
+ updated_at: '2021-10-20T14:21:54.489Z'
filterable: true
relationships:
option_values:
@@ -4704,8 +4705,8 @@ paths:
position: 1
name: Size-68
presentation: S
- created_at: '2021-10-20T13:33:41.732Z'
- updated_at: '2021-10-20T13:33:41.732Z'
+ created_at: '2021-10-20T14:21:54.634Z'
+ updated_at: '2021-10-20T14:21:54.634Z'
relationships:
option_type:
data:
@@ -4717,8 +4718,8 @@ paths:
position: 1
name: Size-69
presentation: S
- created_at: '2021-10-20T13:33:41.738Z'
- updated_at: '2021-10-20T13:33:41.738Z'
+ created_at: '2021-10-20T14:21:54.641Z'
+ updated_at: '2021-10-20T14:21:54.641Z'
relationships:
option_type:
data:
@@ -4773,8 +4774,8 @@ paths:
position: 1
name: Size-72
presentation: S
- created_at: '2021-10-20T13:33:41.811Z'
- updated_at: '2021-10-20T13:33:41.811Z'
+ created_at: '2021-10-20T14:21:54.712Z'
+ updated_at: '2021-10-20T14:21:54.712Z'
relationships:
option_type:
data:
@@ -4833,8 +4834,8 @@ paths:
position: 1
name: Size-73
presentation: S
- created_at: '2021-10-20T13:33:41.878Z'
- updated_at: '2021-10-20T13:33:41.878Z'
+ created_at: '2021-10-20T14:21:54.758Z'
+ updated_at: '2021-10-20T14:21:54.758Z'
relationships:
option_type:
data:
@@ -4892,8 +4893,8 @@ paths:
position: 1
name: M
presentation: S
- created_at: '2021-10-20T13:33:41.952Z'
- updated_at: '2021-10-20T13:33:41.963Z'
+ created_at: '2021-10-20T14:21:54.832Z'
+ updated_at: '2021-10-20T14:21:54.844Z'
relationships:
option_type:
data:
@@ -5009,7 +5010,7 @@ paths:
- id: '40'
type: order
attributes:
- number: R699468900
+ number: R509046101
item_total: '0.0'
total: '0.0'
state: cart
@@ -5018,10 +5019,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:42.140Z'
- updated_at: '2021-10-20T13:33:42.140Z'
+ created_at: '2021-10-20T14:21:55.028Z'
+ updated_at: '2021-10-20T14:21:55.028Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5093,7 +5094,7 @@ paths:
- id: '41'
type: order
attributes:
- number: R180748832
+ number: R602538420
item_total: '0.0'
total: '0.0'
state: cart
@@ -5102,10 +5103,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:42.151Z'
- updated_at: '2021-10-20T13:33:42.151Z'
+ created_at: '2021-10-20T14:21:55.049Z'
+ updated_at: '2021-10-20T14:21:55.049Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5220,7 +5221,7 @@ paths:
id: '44'
type: order
attributes:
- number: R819705544
+ number: R823781006
item_total: '0.0'
total: '0.0'
state: cart
@@ -5231,8 +5232,8 @@ paths:
payment_state:
email:
special_instructions:
- created_at: '2021-10-20T13:33:42.469Z'
- updated_at: '2021-10-20T13:33:42.487Z'
+ created_at: '2021-10-20T14:21:55.487Z'
+ updated_at: '2021-10-20T14:21:55.517Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -5344,7 +5345,7 @@ paths:
id: '45'
type: order
attributes:
- number: R512586754
+ number: R813032041
item_total: '10.0'
total: '110.0'
state: delivery
@@ -5353,10 +5354,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:42.547Z'
- updated_at: '2021-10-20T13:33:42.706Z'
+ created_at: '2021-10-20T14:21:55.568Z'
+ updated_at: '2021-10-20T14:21:55.764Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5480,7 +5481,7 @@ paths:
id: '47'
type: order
attributes:
- number: R163007838
+ number: R314833712
item_total: '10.0'
total: '110.0'
state: delivery
@@ -5491,8 +5492,8 @@ paths:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:42.929Z'
- updated_at: '2021-10-20T13:33:43.053Z'
+ created_at: '2021-10-20T14:21:56.060Z'
+ updated_at: '2021-10-20T14:21:56.423Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5666,7 +5667,7 @@ paths:
id: '52'
type: order
attributes:
- number: R268630481
+ number: R322807282
item_total: '10.0'
total: '110.0'
state: payment
@@ -5675,10 +5676,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:43.869Z'
- updated_at: '2021-10-20T13:33:44.052Z'
+ created_at: '2021-10-20T14:21:57.448Z'
+ updated_at: '2021-10-20T14:21:57.643Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5805,7 +5806,7 @@ paths:
id: '54'
type: order
attributes:
- number: R398577232
+ number: R352099896
item_total: '10.0'
total: '110.0'
state: payment
@@ -5814,10 +5815,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:44.285Z'
- updated_at: '2021-10-20T13:33:44.454Z'
+ created_at: '2021-10-20T14:21:57.903Z'
+ updated_at: '2021-10-20T14:21:58.072Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -5944,19 +5945,19 @@ paths:
id: '56'
type: order
attributes:
- number: R304425300
+ number: R390145875
item_total: '10.0'
total: '110.0'
state: complete
adjustment_total: '0.0'
- completed_at: '2021-10-20T13:33:45.222Z'
+ completed_at: '2021-10-20T14:21:58.763Z'
payment_total: '0.0'
shipment_state: pending
payment_state: balance_due
special_instructions:
- created_at: '2021-10-20T13:33:44.682Z'
- updated_at: '2021-10-20T13:33:45.222Z'
+ created_at: '2021-10-20T14:21:58.407Z'
+ updated_at: '2021-10-20T14:21:58.763Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6094,7 +6095,7 @@ paths:
id: '59'
type: order
attributes:
- number: R499447624
+ number: R512235812
item_total: '0.0'
total: '0.0'
state: cart
@@ -6103,10 +6104,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:45.608Z'
- updated_at: '2021-10-20T13:33:45.741Z'
+ created_at: '2021-10-20T14:21:59.557Z'
+ updated_at: '2021-10-20T14:21:59.762Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -6228,7 +6229,7 @@ paths:
id: '61'
type: order
attributes:
- number: R272280314
+ number: R683976408
item_total: '10.0'
total: '110.0'
state: delivery
@@ -6237,10 +6238,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:46.059Z'
- updated_at: '2021-10-20T13:33:46.163Z'
+ created_at: '2021-10-20T14:22:00.103Z'
+ updated_at: '2021-10-20T14:22:00.277Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6366,19 +6367,19 @@ paths:
id: '63'
type: order
attributes:
- number: R479685123
+ number: R234207443
item_total: '10.0'
total: '10.0'
state: canceled
adjustment_total: '0.0'
- completed_at: '2021-10-20T13:33:46.504Z'
+ completed_at: '2021-10-20T14:22:00.740Z'
payment_total: '0.0'
shipment_state: canceled
payment_state: void
special_instructions:
- created_at: '2021-10-20T13:33:46.376Z'
- updated_at: '2021-10-20T13:33:46.584Z'
+ created_at: '2021-10-20T14:22:00.586Z'
+ updated_at: '2021-10-20T14:22:00.850Z'
currency: USD
last_ip_address:
shipment_total: '0.0'
@@ -6520,7 +6521,7 @@ paths:
id: '66'
type: order
attributes:
- number: R442561215
+ number: R608229850
item_total: '10.0'
total: '110.0'
state: delivery
@@ -6529,10 +6530,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:46.949Z'
- updated_at: '2021-10-20T13:33:47.114Z'
+ created_at: '2021-10-20T14:22:01.306Z'
+ updated_at: '2021-10-20T14:22:01.573Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6673,7 +6674,7 @@ paths:
id: '69'
type: order
attributes:
- number: R292417133
+ number: R556431002
item_total: '10.0'
total: '10.0'
state: delivery
@@ -6682,10 +6683,10 @@ paths:
payment_total: '0.0'
shipment_state:
payment_state:
special_instructions:
- created_at: '2021-10-20T13:33:47.521Z'
- updated_at: '2021-10-20T13:33:47.793Z'
+ created_at: '2021-10-20T14:22:02.179Z'
+ updated_at: '2021-10-20T14:22:02.376Z'
currency: USD
last_ip_address:
shipment_total: '100.0'
@@ -6793,6 +6794,259 @@ paths:
application/json:
schema:
"$ref": "#/components/schemas/coupon_code_param"
+ "/api/v2/platform/payments":
+ get:
+ summary: Return a list of Payments
+ tags:
+ - Payments
+ security:
+ - bearer_auth: []
+ description: Returns a list of Payments
+ operationId: payments-list
+ parameters:
+ - name: page
+ in: query
+ example: 1
+ schema:
+ type: integer
+ - name: per_page
+ in: query
+ example: 50
+ schema:
+ type: integer
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: payment_method,order,source
+ schema:
+ type: string
+ - name: filter[payment_method_id_eq]
+ in: query
+ description: ''
+ example: '1'
+ schema:
+ type: string
+ - name: filter[amount_gteq]
+ in: query
+ description: ''
+ example: 99.9
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Records returned
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ - id: '6'
+ type: payment
+ attributes:
+ amount: '45.75'
+ source_type: Spree::CreditCard
+ state: invalid
+ response_code: '12345'
+ avs_response:
+ created_at: '2021-10-20T14:22:02.866Z'
+ updated_at: '2021-10-20T14:22:02.889Z'
+ number: PUVZ1KRO
+ cvv_response_code:
+ cvv_response_message:
+ display_amount: "$45.75"
+ relationships:
+ order:
+ data:
+ id: '72'
+ type: order
+ payment_method:
+ data:
+ id: '12'
+ type: payment_method
+ source:
+ data:
+ id: '5'
+ type: credit_card
+ log_entries:
+ data: []
+ state_changes:
+ data:
+ - id: '15'
+ type: state_change
+ payment_capture_events:
+ data: []
+ refunds:
+ data: []
+ - id: '7'
+ type: payment
+ attributes:
+ amount: '45.75'
+ source_type: Spree::CreditCard
+ state: checkout
+ response_code: '12345'
+ avs_response:
+ created_at: '2021-10-20T14:22:02.884Z'
+ updated_at: '2021-10-20T14:22:02.884Z'
+ number: PPOV92IT
+ cvv_response_code:
+ cvv_response_message:
+ display_amount: "$45.75"
+ relationships:
+ order:
+ data:
+ id: '72'
+ type: order
+ payment_method:
+ data:
+ id: '12'
+ type: payment_method
+ source:
+ data:
+ id: '6'
+ type: credit_card
+ log_entries:
+ data: []
+ state_changes:
+ data: []
+ payment_capture_events:
+ data: []
+ refunds:
+ data: []
+ meta:
+ count: 2
+ total_count: 2
+ total_pages: 1
+ links:
+ self: http://www.example.com/api/v2/platform/payments?page=1&per_page=&include=&filter[payment_method_id_eq]=&filter[amount_gteq]=
+ next: http://www.example.com/api/v2/platform/payments?filter%5Bamount_gteq%5D=&filter%5Bpayment_method_id_eq%5D=&include=&page=1&per_page=
+ prev: http://www.example.com/api/v2/platform/payments?filter%5Bamount_gteq%5D=&filter%5Bpayment_method_id_eq%5D=&include=&page=1&per_page=
+ last: http://www.example.com/api/v2/platform/payments?filter%5Bamount_gteq%5D=&filter%5Bpayment_method_id_eq%5D=&include=&page=1&per_page=
+ first: http://www.example.com/api/v2/platform/payments?filter%5Bamount_gteq%5D=&filter%5Bpayment_method_id_eq%5D=&include=&page=1&per_page=
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ "/api/v2/platform/payments/{id}":
+ get:
+ summary: Return a Payment
+ tags:
+ - Payments
+ security:
+ - bearer_auth: []
+ description: Returns a Payment
+ operationId: show-payment
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: include
+ in: query
+ description: 'Select which associated resources you would like to fetch, see:
+ <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>'
+ example: payment_method,order,source
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Record found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ data:
+ id: '10'
+ type: payment
+ attributes:
+ amount: '45.75'
+ source_type: Spree::CreditCard
+ state: checkout
+ response_code: '12345'
+ avs_response:
+ created_at: '2021-10-20T14:22:03.070Z'
+ updated_at: '2021-10-20T14:22:03.070Z'
+ number: PELDCA1D
+ cvv_response_code:
+ cvv_response_message:
+ display_amount: "$45.75"
+ relationships:
+ order:
+ data:
+ id: '74'
+ type: order
+ payment_method:
+ data:
+ id: '18'
+ type: payment_method
+ source:
+ data:
+ id: '9'
+ type: credit_card
+ log_entries:
+ data: []
+ state_changes:
+ data: []
+ payment_capture_events:
+ data: []
+ refunds:
+ data: []
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
+ delete:
+ summary: Delete a Payment
+ tags:
+ - Payments
+ security:
+ - bearer_auth: []
+ description: Deletes a Payment
+ operationId: delete-payment
+ parameters:
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: string
+ responses:
+ '204':
+ description: Record deleted
+ '404':
+ description: Record not found
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The resource you were looking for could not be found.
+ '401':
+ description: Authentication Failed
+ content:
+ application/vnd.api+json:
+ examples:
+ Example:
+ value:
+ error: The access token is invalid
"/api/v2/platform/shipping_categories":
get:
summary: Return a list of Shipping Categories
@@ -6839,14 +7093,14 @@ paths:
type: shipping_category
attributes:
name: 'ShippingCategory #103'
- created_at: '2021-10-20T13:33:48.154Z'
- updated_at: '2021-10-20T13:33:48.154Z'
+ created_at: '2021-10-20T14:22:03.336Z'
+ updated_at: '2021-10-20T14:22:03.336Z'
- id: '104'
type: shipping_category
attributes:
name: 'ShippingCategory #104'
- created_at: '2021-10-20T13:33:48.156Z'
- updated_at: '2021-10-20T13:33:48.156Z'
+ created_at: '2021-10-20T14:22:03.338Z'
+ updated_at: '2021-10-20T14:22:03.338Z'
meta:
count: 2
total_count: 2
@@ -6894,8 +7148,8 @@ paths:
type: shipping_category
attributes:
name: 'ShippingCategory #107'
- created_at: '2021-10-20T13:33:48.213Z'
- updated_at: '2021-10-20T13:33:48.213Z'
+ created_at: '2021-10-20T14:22:03.399Z'
+ updated_at: '2021-10-20T14:22:03.399Z'
'422':
description: invalid request
content:
@@ -6947,8 +7201,8 @@ paths:
type: shipping_category
attributes:
name: 'ShippingCategory #108'
- created_at: '2021-10-20T13:33:48.250Z'
- updated_at: '2021-10-20T13:33:48.250Z'
+ created_at: '2021-10-20T14:22:03.439Z'
+ updated_at: '2021-10-20T14:22:03.439Z'
'404':
description: Record not found
content:
@@ -6999,8 +7253,8 @@ paths:
type: shipping_category
attributes:
name: Default
- created_at: '2021-10-20T13:33:48.317Z'
- updated_at: '2021-10-20T13:33:48.325Z'
+ created_at: '2021-10-20T14:22:03.500Z'
+ updated_at: '2021-10-20T14:22:03.510Z'
'422':
description: invalid request
content:
@@ -7123,8 +7377,8 @@ paths:
lft: 2
rgt: 3
description:
- created_at: '2021-10-20T13:33:48.547Z'
- updated_at: '2021-10-20T13:33:48.552Z'
+ created_at: '2021-10-20T14:22:03.759Z'
+ updated_at: '2021-10-20T14:22:03.765Z'
meta_title:
meta_description:
meta_keywords:
@@ -7158,8 +7412,8 @@ paths:
lft: 4
rgt: 5
description:
- created_at: '2021-10-20T13:33:48.632Z'
- updated_at: '2021-10-20T13:33:48.637Z'
+ created_at: '2021-10-20T14:22:03.860Z'
+ updated_at: '2021-10-20T14:22:03.864Z'
meta_title:
meta_description:
meta_keywords:
@@ -7193,8 +7447,8 @@ paths:
lft: 1
rgt: 6
description:
- created_at: '2021-10-20T13:33:48.466Z'
- updated_at: '2021-10-20T13:33:48.649Z'
+ created_at: '2021-10-20T14:22:03.671Z'
+ updated_at: '2021-10-20T14:22:03.877Z'
meta_title:
meta_description:
meta_keywords:
@@ -7271,8 +7525,8 @@ paths:
lft: 2
rgt: 3
description:
- created_at: '2021-10-20T13:33:48.970Z'
- updated_at: '2021-10-20T13:33:48.976Z'
+ created_at: '2021-10-20T14:22:04.212Z'
+ updated_at: '2021-10-20T14:22:04.219Z'
meta_title:
meta_description:
meta_keywords:
@@ -7353,8 +7607,8 @@ paths:
lft: 2
rgt: 3
description:
- created_at: '2021-10-20T13:33:49.139Z'
- updated_at: '2021-10-20T13:33:49.152Z'
+ created_at: '2021-10-20T14:22:04.432Z'
+ updated_at: '2021-10-20T14:22:04.439Z'
meta_title:
meta_description:
meta_keywords:
@@ -7436,8 +7690,8 @@ paths:
lft: 2
rgt: 3
description:
- created_at: '2021-10-20T13:33:49.543Z'
- updated_at: '2021-10-20T13:33:49.579Z'
+ created_at: '2021-10-20T14:22:04.733Z'
+ updated_at: '2021-10-20T14:22:04.774Z'
meta_title:
meta_description:
meta_keywords:
@@ -7575,12 +7829,12 @@ paths:
Example:
value:
data:
- - id: '73'
+ - id: '79'
type: user
attributes:
- created_at: '2021-10-20T13:33:50.213Z'
- updated_at: '2021-10-20T13:33:50.213Z'
+ created_at: '2021-10-20T14:22:05.545Z'
+ updated_at: '2021-10-20T14:22:05.545Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -7589,12 +7843,12 @@ paths:
data:
ship_address:
data:
- - id: '74'
+ - id: '80'
type: user
attributes:
- created_at: '2021-10-20T13:33:50.220Z'
- updated_at: '2021-10-20T13:33:50.220Z'
+ created_at: '2021-10-20T14:22:05.555Z'
+ updated_at: '2021-10-20T14:22:05.555Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -7603,12 +7857,12 @@ paths:
data:
ship_address:
data:
- - id: '75'
+ - id: '81'
type: user
attributes:
- created_at: '2021-10-20T13:33:50.222Z'
- updated_at: '2021-10-20T13:33:50.222Z'
+ created_at: '2021-10-20T14:22:05.558Z'
+ updated_at: '2021-10-20T14:22:05.558Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -7660,12 +7914,12 @@ paths:
Example:
value:
data:
- id: '80'
+ id: '86'
type: user
attributes:
- created_at: '2021-10-20T13:33:50.327Z'
- updated_at: '2021-10-20T13:33:50.327Z'
+ created_at: '2021-10-20T14:22:05.731Z'
+ updated_at: '2021-10-20T14:22:05.731Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -7721,12 +7975,12 @@ paths:
Example:
value:
data:
- id: '83'
+ id: '89'
type: user
attributes:
- created_at: '2021-10-20T13:33:50.387Z'
- updated_at: '2021-10-20T13:33:50.387Z'
+ created_at: '2021-10-20T14:22:05.864Z'
+ updated_at: '2021-10-20T14:22:05.864Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -7781,12 +8035,12 @@ paths:
Example:
value:
data:
- id: '88'
+ id: '94'
type: user
attributes:
- created_at: '2021-10-20T13:33:50.474Z'
- updated_at: '2021-10-20T13:33:50.487Z'
+ created_at: '2021-10-20T14:22:06.017Z'
+ updated_at: '2021-10-20T14:22:06.036Z'
average_order_value: []
lifetime_value: []
store_credits: []
@@ -7921,12 +8175,12 @@ paths:
position: 1
cost_currency: USD
track_inventory: true
- updated_at: '2021-10-20T13:33:50.727Z'
+ updated_at: '2021-10-20T14:22:06.636Z'
discontinue_on:
- created_at: '2021-10-20T13:33:50.720Z'
+ created_at: '2021-10-20T14:22:06.620Z'
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #170 - 5909'
+ name: 'Product #170 - 2530'
options_text: ''
total_on_hand: 0
purchasable: true
@@ -7961,21 +8215,21 @@ paths:
type: variant
attributes:
sku: SKU-238
- weight: '105.97'
- height: '141.23'
- depth: '121.7'
+ weight: '173.31'
+ height: '168.48'
+ depth: '81.83'
deleted_at:
is_master: false
cost_price: '17.0'
position: 2
cost_currency: USD
track_inventory: true
- updated_at: '2021-10-20T13:33:50.760Z'
+ updated_at: '2021-10-20T14:22:06.690Z'
discontinue_on:
- created_at: '2021-10-20T13:33:50.752Z'
+ created_at: '2021-10-20T14:22:06.675Z'
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #170 - 5909'
+ name: 'Product #170 - 2530'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -8012,21 +8266,21 @@ paths:
type: variant
attributes:
sku: SKU-239
- weight: '36.19'
- height: '56.45'
- depth: '119.88'
+ weight: '170.32'
+ height: '16.36'
+ depth: '66.26'
deleted_at:
is_master: false
cost_price: '17.0'
position: 3
cost_currency: USD
track_inventory: true
- updated_at: '2021-10-20T13:33:50.784Z'
+ updated_at: '2021-10-20T14:22:06.717Z'
discontinue_on:
- created_at: '2021-10-20T13:33:50.775Z'
+ created_at: '2021-10-20T14:22:06.709Z'
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #170 - 5909'
+ name: 'Product #170 - 2530'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -8112,21 +8366,21 @@ paths:
type: variant
attributes:
sku: SKU-244
- weight: '156.9'
- height: '148.9'
- depth: '87.76'
+ weight: '100.1'
+ height: '82.2'
+ depth: '20.34'
deleted_at:
is_master: false
cost_price: '17.0'
position: 2
cost_currency: USD
track_inventory: true
- updated_at: '2021-10-20T13:33:51.096Z'
+ updated_at: '2021-10-20T14:22:07.029Z'
discontinue_on:
- created_at: '2021-10-20T13:33:51.088Z'
+ created_at: '2021-10-20T14:22:07.019Z'
display_compare_at_price:
display_price: "$19.99"
- name: 'Product #172 - 6559'
+ name: 'Product #172 - 6535'
options_text: 'Size: S'
total_on_hand: 0
purchasable: true
@@ -8248,10 +8502,10 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-20T13:33:51.950Z'
- updated_at: '2021-10-20T13:33:51.950Z'
- display_price: "$19.99"
+ created_at: '2021-10-20T14:22:07.663Z'
+ updated_at: '2021-10-20T14:22:07.663Z'
display_total: "$19.99"
+ display_price: "$19.99"
price: '19.99'
total: '19.99'
relationships:
@@ -8263,10 +8517,10 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-20T13:33:52.026Z'
- updated_at: '2021-10-20T13:33:52.026Z'
- display_price: "$19.99"
+ created_at: '2021-10-20T14:22:07.731Z'
+ updated_at: '2021-10-20T14:22:07.731Z'
display_total: "$19.99"
+ display_price: "$19.99"
price: '19.99'
total: '19.99'
relationships:
@@ -8278,10 +8532,10 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-20T13:33:52.110Z'
- updated_at: '2021-10-20T13:33:52.110Z'
- display_price: "$19.99"
+ created_at: '2021-10-20T14:22:07.799Z'
+ updated_at: '2021-10-20T14:22:07.799Z'
display_total: "$19.99"
+ display_price: "$19.99"
price: '19.99'
total: '19.99'
relationships:
@@ -8293,10 +8547,10 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-20T13:33:52.191Z'
- updated_at: '2021-10-20T13:33:52.191Z'
- display_price: "$19.99"
+ created_at: '2021-10-20T14:22:07.899Z'
+ updated_at: '2021-10-20T14:22:07.899Z'
display_total: "$19.99"
+ display_price: "$19.99"
price: '19.99'
total: '19.99'
relationships:
@@ -8351,10 +8605,10 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-20T13:33:52.720Z'
- updated_at: '2021-10-20T13:33:52.720Z'
- display_price: "$19.99"
+ created_at: '2021-10-20T14:22:08.410Z'
+ updated_at: '2021-10-20T14:22:08.410Z'
display_total: "$19.99"
+ display_price: "$19.99"
price: '19.99'
total: '19.99'
relationships:
@@ -8418,10 +8672,10 @@ paths:
type: wished_item
attributes:
quantity: 1
- created_at: '2021-10-20T13:33:53.030Z'
- updated_at: '2021-10-20T13:33:53.030Z'
- display_price: "$19.99"
+ created_at: '2021-10-20T14:22:08.681Z'
+ updated_at: '2021-10-20T14:22:08.681Z'
display_total: "$19.99"
+ display_price: "$19.99"
price: '19.99'
total: '19.99'
relationships:
@@ -8479,10 +8733,10 @@ paths:
type: wished_item
attributes:
quantity: 3
- created_at: '2021-10-20T13:33:53.463Z'
- updated_at: '2021-10-20T13:33:53.473Z'
- display_price: "$19.99"
+ created_at: '2021-10-20T14:22:09.147Z'
+ updated_at: '2021-10-20T14:22:09.157Z'
display_total: "$59.97"
+ display_price: "$19.99"
price: '19.99'
total: '59.97'
relationships:
@@ -8603,9 +8857,9 @@ paths:
name: Black Friday
is_private: true
is_default: false
- created_at: '2021-10-20T13:33:54.408Z'
- updated_at: '2021-10-20T13:33:54.408Z'
- token: QdxVdowg2b9SymdQEGy34Evg
+ created_at: '2021-10-20T14:22:10.096Z'
+ updated_at: '2021-10-20T14:22:10.096Z'
+ token: BAKR2ARKeLGpUdrNxdpr9j6Z
variant_included: false
relationships:
wished_items:
@@ -8620,9 +8874,9 @@ paths:
name: Birthday
is_private: true
is_default: false
- created_at: '2021-10-20T13:33:54.411Z'
- updated_at: '2021-10-20T13:33:54.411Z'
- token: 9erHugRXC55T5SzX5jq5wMkA
+ created_at: '2021-10-20T14:22:10.098Z'
+ updated_at: '2021-10-20T14:22:10.098Z'
+ token: wdKcMYAmyYd6YyFy2ZyW69KY
variant_included: false
relationships:
wished_items:
@@ -8680,9 +8934,9 @@ paths:
name: Wishlist_26
is_private: true
is_default: false
- created_at: '2021-10-20T13:33:55.127Z'
- updated_at: '2021-10-20T13:33:55.127Z'
- token: 5ozT3g7idkZHwR3NddgiWMt2
+ created_at: '2021-10-20T14:22:10.760Z'
+ updated_at: '2021-10-20T14:22:10.760Z'
+ token: CkMnM7bNpBwWSsygVXV8FKga
variant_included: false
relationships:
wished_items:
@@ -8742,9 +8996,9 @@ paths:
name: My Wishlist
is_private: true
is_default: false
- created_at: '2021-10-20T13:33:55.181Z'
- updated_at: '2021-10-20T13:33:55.181Z'
- token: jmSBpZAMx3Y3D3vWz85gwyLZ
+ created_at: '2021-10-20T14:22:10.830Z'
+ updated_at: '2021-10-20T14:22:10.830Z'
+ token: CXTVebsUj5KRnP2yGE9oR6jQ
variant_included: false
relationships:
wished_items:
@@ -8801,9 +9055,9 @@ paths:
name: My Super Wishlist
is_private: true
is_default: false
- created_at: '2021-10-20T13:33:55.267Z'
- updated_at: '2021-10-20T13:33:55.279Z'
- token: P6hDWBpCDQa4psrEn3W1fsTT
+ created_at: '2021-10-20T14:22:10.913Z'
+ updated_at: '2021-10-20T14:22:10.925Z'
+ token: dkd9w3oPUpRugtEcBuXB428j
variant_included: false
relationships:
wished_items:
@@ -8893,6 +9147,7 @@ tags:
- name: Option Types
- name: Option Values
- name: Orders
+- name: Payments
- name: Shipping Categories
- name: Taxons
- name: Users
@@ -9084,7 +9339,7 @@ components:
completed_at:
type: string
format: date_time
- example: 2021-10-20 13:33:09 UTC
+ example: 2021-10-20 14:21:20 UTC
bill_address_id:
type: string
example: '1'
@@ -9152,7 +9407,7 @@ components:
approved_at:
type: string
format: date_time
- example: 2021-10-20 13:33:09 UTC
+ example: 2021-10-20 14:21:20 UTC
confirmation_delivered:
type: boolean
example: true
diff --git a/api/spec/integration/api/v2/platform/payments_spec.rb b/api/spec/integration/api/v2/platform/payments_spec.rb
new file mode 100644
index 0000000000..969369e11f
--- /dev/null
+++ b/api/spec/integration/api/v2/platform/payments_spec.rb
@@ -0,0 +1,43 @@
+require 'swagger_helper'
+
+describe 'Payments API', swagger: true do
+ include_context 'Platform API v2'
+
+ resource_name = 'Payment'
+ options = {
+ include_example: 'payment_method,order,source',
+ filter_examples: [{ name: 'filter[payment_method_id_eq]', example: '1' },
+ { name: 'filter[amount_gteq]', example: 99.90 }]
+ }
+
+ let(:id) { create(:payment, payment_method: payment_method, order: order).id }
+ let(:order) { create(:order, store: store) }
+ let(:payment_method) { create(:credit_card_payment_method, stores: [store]) }
+ let(:records_list) { create_list(:payment, 2, order: order, payment_method: payment_method) }
+ let(:valid_create_param_value) { build(:payment, payment_method: payment_method, order: order) }
+ let(:valid_update_param_value) do
+ {
+ amount: 100.90
+ }
+ end
+ let(:invalid_param_value) do
+ {
+ amount: 'string',
+ }
+ end
+
+ # include_examples 'CRUD examples', resource_name, options
+
+ resource_path = resource_name.parameterize(separator: '_').pluralize
+
+ path "/api/v2/platform/#{resource_path}" do
+ include_examples 'GET records list', resource_name, options
+ # include_examples 'POST create record', resource_name, options
+ end
+
+ path "/api/v2/platform/#{resource_path}/{id}" do
+ include_examples 'GET record', resource_name, options
+ # include_examples 'PATCH update record', resource_name, options
+ include_examples 'DELETE record', resource_name, options
+ end
+end
diff --git a/api/spec/swagger_helper.rb b/api/spec/swagger_helper.rb
index 96739545ee..cf905ceadd 100644
--- a/api/spec/swagger_helper.rb
+++ b/api/spec/swagger_helper.rb
@@ -54,6 +54,7 @@ RSpec.configure do |config|
{ name: 'Option Types' },
{ name: 'Option Values' },
{ name: 'Orders' },
+ { name: 'Payments' },
{ name: 'Shipping Categories' },
{ name: 'Taxons' },
{ name: 'Users' },
diff --git a/core/app/models/spree/payment.rb b/core/app/models/spree/payment.rb
index 57242bc2e1..771a558767 100644
--- a/core/app/models/spree/payment.rb
+++ b/core/app/models/spree/payment.rb
@@ -66,6 +66,9 @@ module Spree
scope :store_credits, -> { where(source_type: Spree::StoreCredit.to_s) }
scope :not_store_credits, -> { where(arel_table[:source_type].not_eq(Spree::StoreCredit.to_s).or(arel_table[:source_type].eq(nil))) }
+ self.whitelisted_ransackable_associations = %w[payment_method order source]
+ self.whitelisted_ransackable_attributes = %w[number amount state response_code avs_response cvv_response_code cvv_response_message]
+
# transaction_id is much easier to understand
def transaction_id
response_code