Class: MangoPay::Recipient

Inherits:
Resource show all
Defined in:
lib/mangopay/recipient.rb

Class Method Summary collapse

Methods inherited from Resource

class_name, url

Class Method Details

.create(params, user_id, idempotency_key = nil) ⇒ Object



4
5
6
# File 'lib/mangopay/recipient.rb', line 4

def self.create(params, user_id, idempotency_key = nil)
  MangoPay.request(:post, "#{MangoPay.api_path}/users/#{user_id}/recipients", params, {}, idempotency_key)
end

.deactivate(recipient_id) ⇒ Object



28
29
30
31
32
33
# File 'lib/mangopay/recipient.rb', line 28

def self.deactivate(recipient_id)
  params = {
    Status: 'DEACTIVATED'
  }
  MangoPay.request(:put, "#{MangoPay.api_path}/recipients/#{recipient_id}", params, {})
end

.get(recipient_id, filters = {}) ⇒ Object



8
9
10
# File 'lib/mangopay/recipient.rb', line 8

def self.get(recipient_id, filters = {})
  MangoPay.request(:get, "#{MangoPay.api_path}/recipients/#{recipient_id}", {}, filters)
end

.get_payout_methods(country, currency, filters = {}) ⇒ Object



20
21
22
# File 'lib/mangopay/recipient.rb', line 20

def self.get_payout_methods(country, currency, filters = {})
  MangoPay.request(:get, "#{MangoPay.api_path}/recipients/payout-methods?country=#{country}&currency=#{currency}", {}, filters)
end

.get_schema(payout_method_type, recipient_type, currency, country, filters = {}) ⇒ Object



16
17
18
# File 'lib/mangopay/recipient.rb', line 16

def self.get_schema(payout_method_type, recipient_type, currency, country, filters = {})
  MangoPay.request(:get, "#{MangoPay.api_path}/recipients/schema?payoutMethodType=#{payout_method_type}&recipientType=#{recipient_type}&currency=#{currency}&country=#{country}", {}, filters)
end

.get_user_recipients(user_id, filters = {}) ⇒ Object



12
13
14
# File 'lib/mangopay/recipient.rb', line 12

def self.get_user_recipients(user_id, filters = {})
  MangoPay.request(:get, "#{MangoPay.api_path}/users/#{user_id}/recipients", {}, filters)
end

.validate(params, user_id, idempotency_key = nil) ⇒ Object



24
25
26
# File 'lib/mangopay/recipient.rb', line 24

def self.validate(params, user_id, idempotency_key = nil)
  MangoPay.request(:post, "#{MangoPay.api_path}/users/#{user_id}/recipients/validate", params, {}, idempotency_key)
end