Class: PayoneerApi::Client

Inherits:
Object
  • Object
show all
Includes:
API, Utils
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'

Instance Method Summary collapse

Methods included from API::Payees

#payee_details, #payee_prefilled_signup_url, #payee_signup_url

Methods included from Utils

#bool_to_string, #payout_methods_list, #perform, #perform_with_object

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/payoneer_api/client.rb', line 13

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