mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
33 lines
832 B
Ruby
33 lines
832 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Stripe
|
|
class Order < APIResource
|
|
extend Stripe::APIOperations::Create
|
|
extend Stripe::APIOperations::List
|
|
include Stripe::APIOperations::Save
|
|
|
|
OBJECT_NAME = "order".freeze
|
|
|
|
custom_method :pay, http_verb: :post
|
|
custom_method :return_order, http_verb: :post, http_path: "returns"
|
|
|
|
def pay(params = {}, opts = {})
|
|
resp, opts = request(:post, resource_url + "/pay", params, opts)
|
|
Util.convert_to_stripe_object(resp.data, opts)
|
|
end
|
|
|
|
def return_order(params = {}, opts = {})
|
|
resp, opts = request(:post, resource_url + "/returns", params, opts)
|
|
Util.convert_to_stripe_object(resp.data, opts)
|
|
end
|
|
|
|
private def pay_url
|
|
resource_url + "/pay"
|
|
end
|
|
|
|
private def returns_url
|
|
resource_url + "/returns"
|
|
end
|
|
end
|
|
end
|