-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea331fd
commit 75e6a7c
Showing
5 changed files
with
92 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v205 | ||
v212 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# File generated from our OpenAPI spec | ||
# frozen_string_literal: true | ||
|
||
module Stripe | ||
# An Order describes a purchase being made by a customer, including the | ||
# products & quantities being purchased, the order status, the payment information, | ||
# and the billing/shipping details. | ||
# | ||
# Related guide: [Orders overview](https://stripe.com/docs/orders) | ||
class Order < APIResource | ||
extend Stripe::APIOperations::Create | ||
extend Stripe::APIOperations::List | ||
include Stripe::APIOperations::Save | ||
|
||
OBJECT_NAME = "order" | ||
|
||
def cancel(params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/orders/%<id>s/cancel", { id: CGI.escape(self["id"]) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
def list_line_items(params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :get, | ||
path: format("/v1/orders/%<id>s/line_items", { id: CGI.escape(self["id"]) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
def reopen(params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/orders/%<id>s/reopen", { id: CGI.escape(self["id"]) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
def submit(params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/orders/%<id>s/submit", { id: CGI.escape(self["id"]) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
def self.cancel(id, params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/orders/%<id>s/cancel", { id: CGI.escape(id) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
def self.list_line_items(id, params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :get, | ||
path: format("/v1/orders/%<id>s/line_items", { id: CGI.escape(id) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
def self.reopen(id, params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/orders/%<id>s/reopen", { id: CGI.escape(id) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
|
||
def self.submit(id, params = {}, opts = {}) | ||
request_stripe_object( | ||
method: :post, | ||
path: format("/v1/orders/%<id>s/submit", { id: CGI.escape(id) }), | ||
params: params, | ||
opts: opts | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters