Class: PayoneerApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/payoneer_api/client.rb

Constant Summary collapse

SANDBOX_API_URL =
'https://api.sandbox.payoneer.com/Payouts/HttpApi/API.aspx?'
PRODUCTION_API_URL =
'https://api.payoneer.com/payouts/HttpAPI/API.aspx?'
API_PORT =
'443'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
16
17
18
# File 'lib/payoneer_api/client.rb', line 11

def initialize(options = {})
  @partner_id, @username, @password = options[:partner_id], options[:username], options[:password]
  @environment = options[:environment]
  if @environment.nil? && defined?(Rails)
    Rails.env.production? ? 'production' : 'sandbox'
  end
  @environment ||= 'sandbox'
end

Class Method Details



7
8
9
# File 'lib/payoneer_api/client.rb', line 7

def self.new_payee_link(partner_id, username, password, member_name)
  new(partner_id, username, password).(member_name)
end

Instance Method Details

#payee_prefilled_signup_url(member_name, attributes = {}) ⇒ Object



25
26
27
28
# File 'lib/payoneer_api/client.rb', line 25

def (member_name, attributes = {})
  response = post_api_call(payee_prefill_args(attributes.merge(payee_id: member_name)))
  xml_api_result(response)
end

#payee_signup_url(member_name) ⇒ Object



20
21
22
23
# File 'lib/payoneer_api/client.rb', line 20

def (member_name)
  response = get_api_call(payee_link_args(payee_id: member_name))
  api_result(response)
end