class Pin::Recipient
This class models Pin's Recipient
API
Public Class Methods
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
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 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
# 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 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