Sha256: 5fa89a91b1ee5c097003ea521eb90f0468502b52529b15bf236c6503894ff958

Contents?: true

Size: 621 Bytes

Versions: 15

Compression:

Stored size: 621 Bytes

Contents

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

    OBJECT_NAME = 'order'

    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

15 entries across 15 versions & 1 rubygems

Version Path
stripe-3.3.2 lib/stripe/order.rb
stripe-3.3.1 lib/stripe/order.rb
stripe-3.3.0 lib/stripe/order.rb
stripe-3.2.0 lib/stripe/order.rb
stripe-3.1.0 lib/stripe/order.rb
stripe-3.0.3 lib/stripe/order.rb
stripe-3.0.1 lib/stripe/order.rb
stripe-3.0.0 lib/stripe/order.rb
stripe-2.12.0 lib/stripe/order.rb
stripe-2.11.0 lib/stripe/order.rb
stripe-2.10.0 lib/stripe/order.rb
stripe-2.9.0 lib/stripe/order.rb
stripe-2.8.0 lib/stripe/order.rb
stripe-2.7.0 lib/stripe/order.rb
stripe-2.6.0 lib/stripe/order.rb