mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-06 00:00:30 -04:00
Compare commits
No commits in common. "e757a6f26c1ad76404e2dd178a51b62267d83949" and "af6fb06cd69e066adbdf7c2d9e67e80c3d870529" have entirely different histories.
e757a6f26c
...
af6fb06cd6
@ -62,6 +62,7 @@ module Stripe
|
|||||||
LineItem::OBJECT_NAME => LineItem,
|
LineItem::OBJECT_NAME => LineItem,
|
||||||
LoginLink::OBJECT_NAME => LoginLink,
|
LoginLink::OBJECT_NAME => LoginLink,
|
||||||
Mandate::OBJECT_NAME => Mandate,
|
Mandate::OBJECT_NAME => Mandate,
|
||||||
|
Order::OBJECT_NAME => Order,
|
||||||
PaymentIntent::OBJECT_NAME => PaymentIntent,
|
PaymentIntent::OBJECT_NAME => PaymentIntent,
|
||||||
PaymentLink::OBJECT_NAME => PaymentLink,
|
PaymentLink::OBJECT_NAME => PaymentLink,
|
||||||
PaymentMethod::OBJECT_NAME => PaymentMethod,
|
PaymentMethod::OBJECT_NAME => PaymentMethod,
|
||||||
|
@ -49,6 +49,7 @@ require "stripe/resources/issuing/transaction"
|
|||||||
require "stripe/resources/line_item"
|
require "stripe/resources/line_item"
|
||||||
require "stripe/resources/login_link"
|
require "stripe/resources/login_link"
|
||||||
require "stripe/resources/mandate"
|
require "stripe/resources/mandate"
|
||||||
|
require "stripe/resources/order"
|
||||||
require "stripe/resources/payment_intent"
|
require "stripe/resources/payment_intent"
|
||||||
require "stripe/resources/payment_link"
|
require "stripe/resources/payment_link"
|
||||||
require "stripe/resources/payment_method"
|
require "stripe/resources/payment_method"
|
||||||
|
89
lib/stripe/resources/order.rb
Normal file
89
lib/stripe/resources/order.rb
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user