class Pin::Transfer

This class models Pin's Transfers API

Public Class Methods

all(page = nil, pagination = false) click to toggle source

Returns a paginated list of all transfers. page: page (Fixnum), pagination (Boolean)

if pagination is passed, access the response hash with [:response] and the pagination hash with [:pagination]

pinpayments.com/docs/api/transfers#get-transfers

# File lib/pin_up/transfer.rb, line 21
def self.all(page = nil, pagination = false)
  build_collection_response(make_request(:get, {url: "transfers?page=#{page}" } ), pagination)
end
create(options) click to toggle source

Creates a new transfer and returns its details. pinpayments.com/docs/api/transfers#post-transfers args: options (Hash)

# File lib/pin_up/transfer.rb, line 9
def self.create(options)
  build_response(make_request(:post, { url: 'transfers', options: options }))
end
find(token) click to toggle source

Returns the details of a transfer. args: token (String) returns: a transfer pinpayments.com/docs/api/transfers#get-transfer

# File lib/pin_up/transfer.rb, line 30
def self.find(token)
  build_response(make_request(:get, {url: "transfers/#{token}" } ))
end
line_items(token, page = nil, pagination = false) click to toggle source

Returns the line items associated with transfer. args: token (String), page (Fixnum), pagination (Boolean)

pinpayments.com/docs/api/transfers#get-transfer-line-items

# File lib/pin_up/transfer.rb, line 57
def self.line_items(token, page = nil, pagination = false)
  build_collection_response(make_request(:get, {url: "transfers/#{token}/line_items?page=#{page}" } ), pagination)
end