class Pin::Recipient

This class models Pin's Recipient API

Public Class Methods

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

Lists all recipients for your account args: page (Fixnum), pagination (Boolean) returns: a collection of recipients

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

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

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

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

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

Find a recipient for your account given a token args: token (String) returns: a recipient pinpayments.com/docs/api/recipients#get-recipient

# File lib/pin_up/recipient.rb, line 32
def self.find(token)
  build_response(make_request(:get, {url: "recipients/#{token}" } ))
end
transfers(token, pagination = false) click to toggle source
# File lib/pin_up/recipient.rb, line 46
def self.transfers(token, pagination = false)
  build_collection_response(make_request(:get, { url: "recipients/#{token}/transfers" } ), pagination)
end
update(token, options = {}) click to toggle source

Update a recipient for your account given a token and any of: email, name, bank_account (hash) args: token (String), options (Hash) returns: a recipient pinpayments.com/docs/api/recipients#put-recipient

# File lib/pin_up/recipient.rb, line 42
def self.update(token, options = {})
  build_response(make_request(:put, { url: "recipients/#{token}", options: options }))
end