Sha256: 358c14a5ba3fecdbf95cfd5c51cbb60ed58a17f61613fa6caf12832ff38b0f7a

Contents?: true

Size: 711 Bytes

Versions: 5

Compression:

Stored size: 711 Bytes

Contents

require 'rest_client'

module Versapay
  class Transactions

    def initialize(&block)
      yield self if block_given?
    end

    def create(args)
      Versapay::make_request(:post, "/api/transactions.json", args)
    end

    def list(page = nil)
      args = page.nil? ? {} : { :page => page }
      Versapay::make_request(:get, "/api/transactions/sent.json", args)
    end

    def view(token)
      Versapay::make_request(:get, "/api/transactions/#{token}.json")
    end

    def approve(token)
      Versapay::make_request(:post, "/api/transactions/#{token}/approve.json")
    end

    def cancel(token)
      Versapay::make_request(:post, "/api/transactions/#{token}/cancel.json")
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
versapay-0.1.4 lib/versapay/transactions.rb
versapay-0.1.3 lib/versapay/transactions.rb
versapay-0.1.2 lib/versapay/transactions.rb
versapay-0.1.1 lib/versapay/transactions.rb
versapay-0.1.0 lib/versapay/transactions.rb