Sha256: 8df5e025dc5d554389a13b726466faefabd55c9e7cfc83f1d6ef650a71cebd12

Contents?: true

Size: 663 Bytes

Versions: 31

Compression:

Stored size: 663 Bytes

Contents

# frozen_string_literal: true

module Stripe
  class Order < APIResource
    extend Stripe::APIOperations::List
    extend Stripe::APIOperations::Create
    include Stripe::APIOperations::Save

    OBJECT_NAME = "order".freeze

    def pay(params, opts = {})
      resp, opts = request(:post, pay_url, params, opts)
      initialize_from(resp.data, opts)
    end

    def return_order(params, opts = {})
      resp, opts = request(:post, returns_url, params, opts)
      Util.convert_to_stripe_object(resp.data, opts)
    end

    private

    def pay_url
      resource_url + "/pay"
    end

    def returns_url
      resource_url + "/returns"
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
stripe-3.31.0 lib/stripe/order.rb
stripe-3.30.0 lib/stripe/order.rb
stripe-3.29.0 lib/stripe/order.rb
stripe-3.28.0 lib/stripe/order.rb
stripe-3.27.0 lib/stripe/order.rb
stripe-3.26.1 lib/stripe/order.rb
stripe-3.26.0 lib/stripe/order.rb
stripe-3.25.0 lib/stripe/order.rb
stripe-3.24.0 lib/stripe/order.rb
stripe-3.23.0 lib/stripe/order.rb
stripe-3.22.0 lib/stripe/order.rb