class Straight
Constants
- VERSION
Public Class Methods
new(uri, gateway, options={})
click to toggle source
# File lib/straight-api.rb, line 9 def initialize (uri, gateway, options={}) self.class.base_uri "#{uri}/gateways/#{gateway}" @options = {query: options} end
Public Instance Methods
create(amount, options={})
click to toggle source
# File lib/straight-api.rb, line 14 def create (amount, options={}) options.merge!(@options) options.merge!({amount: amount}) options = {query: options} Hashie::Mash.new(JSON.parse(self.class.post('/orders', options))) end
get(id, options={})
click to toggle source
# File lib/straight-api.rb, line 21 def get (id, options={}) options.merge!(@options) options = {query: options} Hashie::Mash.new(JSON.parse(self.class.get("/orders/#{id}", options))) end