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-4.11.0 lib/stripe/order.rb
stripe-4.10.0 lib/stripe/order.rb
stripe-4.9.1 lib/stripe/order.rb
stripe-4.9.0 lib/stripe/order.rb
stripe-4.8.1 lib/stripe/order.rb
stripe-4.8.0 lib/stripe/order.rb
stripe-4.7.1 lib/stripe/order.rb
stripe-4.7.0 lib/stripe/order.rb
stripe-4.6.0 lib/stripe/order.rb
stripe-4.5.0 lib/stripe/order.rb
stripe-4.4.1 lib/stripe/order.rb
stripe-4.4.0 lib/stripe/order.rb
stripe-4.3.0 lib/stripe/order.rb
stripe-4.2.0 lib/stripe/order.rb
stripe-4.1.0 lib/stripe/order.rb
stripe-4.0.3 lib/stripe/order.rb
stripe-4.0.2 lib/stripe/order.rb
stripe-4.0.1 lib/stripe/order.rb
stripe-4.0.0 lib/stripe/order.rb
stripe-3.31.1 lib/stripe/order.rb