payoneer_api 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/lib/payoneer_api/client.rb +143 -0
- data/lib/payoneer_api/payoneer_exception.rb +3 -0
- data/lib/payoneer_api/version.rb +15 -0
- data/lib/payoneer_api.rb +4 -0
- data/payoneer_api.gemspec +29 -0
- data/spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_prefilled_signup_url/with_all_correct_params_passed_in/includes_a_token_parameter_in_this_url.yml +51 -0
- data/spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_prefilled_signup_url/with_all_correct_params_passed_in/returns_a_url_to_the_prefilled_registration_page.yml +51 -0
- data/spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_signup_url/returns_a_url_to_the_registration_page.yml +49 -0
- data/spec/payoneer_api/client_spec.rb +47 -0
- data/spec/spec_helper.rb +20 -0
- metadata +144 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 186608abc85884aea5d12fb594a9e9581ce6fde6
|
4
|
+
data.tar.gz: 3f83e3d00cd6ebfe32759ffb7f95eaa228ec802c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5a000acb2128f7bd5ea79f6a84e409930b35955688bef4e1c01252b801c25c42ae652c51fa08d8e17465b8c49581e98e1b1f7bcee8c22b0eb2e13d0c37907435
|
7
|
+
data.tar.gz: fb2456ececf88ad71a6d93b7615b8a01cef0d662462b31f68eb954a4b35cea6bde386c2e83ffd48b3ff5472c1d4d2f5d417591239266abec5abf5a95b7d87443
|
data/README.md
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
module PayoneerApi
|
2
|
+
class Client
|
3
|
+
SANDBOX_API_URL = 'https://api.sandbox.payoneer.com/Payouts/HttpApi/API.aspx?'
|
4
|
+
PRODUCTION_API_URL = 'https://api.payoneer.com/payouts/HttpAPI/API.aspx?'
|
5
|
+
API_PORT = '443'
|
6
|
+
|
7
|
+
def self.new_payee_link(partner_id, username, password, member_name)
|
8
|
+
new(partner_id, username, password).payee_signup_url(member_name)
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(options = {})
|
12
|
+
@partner_id, @username, @password = options[:partner_id], options[:username], options[:password]
|
13
|
+
@environment = options[:environment]
|
14
|
+
if @environment.nil? && defined?(Rails)
|
15
|
+
Rails.env.production? ? 'production' : 'sandbox'
|
16
|
+
end
|
17
|
+
@environment ||= 'sandbox'
|
18
|
+
end
|
19
|
+
|
20
|
+
def payee_signup_url(member_name)
|
21
|
+
response = get_api_call(payee_link_args(payee_id: member_name))
|
22
|
+
api_result(response)
|
23
|
+
end
|
24
|
+
|
25
|
+
def payee_prefilled_signup_url(member_name, attributes = {})
|
26
|
+
response = post_api_call(payee_prefill_args(attributes.merge(payee_id: member_name)))
|
27
|
+
xml_api_result(response)
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def api_result(response)
|
33
|
+
if response.code == '200'
|
34
|
+
return response.body
|
35
|
+
else
|
36
|
+
raise PayoneerException, api_error_description(response)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def xml_api_result(response)
|
41
|
+
if response.code == '200'
|
42
|
+
result = Nokogiri::XML.parse(response.body)
|
43
|
+
token = result.css('PayoneerToken Token').first
|
44
|
+
return token.text if token
|
45
|
+
end
|
46
|
+
raise PayoneerException, api_error_description(response)
|
47
|
+
end
|
48
|
+
|
49
|
+
def api_error_description(response)
|
50
|
+
return nil unless response and response.body
|
51
|
+
body_hash = Nokogiri::XML.parse(response.body)
|
52
|
+
if body_hash['PayoneerResponse']
|
53
|
+
return body_hash['PayoneerResponse']['Description']
|
54
|
+
else
|
55
|
+
return body_hash.to_s
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def get_api_call(args_hash)
|
60
|
+
uri = URI.parse(api_url)
|
61
|
+
uri.query = URI.encode_www_form(args_hash)
|
62
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
63
|
+
http.use_ssl = true
|
64
|
+
|
65
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
66
|
+
http.request(request)
|
67
|
+
end
|
68
|
+
|
69
|
+
def post_api_call(args_hash)
|
70
|
+
uri = URI.parse(api_url)
|
71
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
72
|
+
http.use_ssl = true
|
73
|
+
|
74
|
+
request = Net::HTTP::Post.new(uri.request_uri)
|
75
|
+
request.set_form_data(args_hash)
|
76
|
+
http.request(request)
|
77
|
+
end
|
78
|
+
|
79
|
+
def payee_link_args(args)
|
80
|
+
{
|
81
|
+
mname: 'GetToken',
|
82
|
+
p1: @username,
|
83
|
+
p2: @password,
|
84
|
+
p3: @partner_id,
|
85
|
+
p4: args[:payee_id],
|
86
|
+
p5: args[:session_id],
|
87
|
+
}.delete_if { |_, value| value.nil? || value.empty? }
|
88
|
+
end
|
89
|
+
|
90
|
+
def payee_prefill_args(args)
|
91
|
+
{
|
92
|
+
mname: 'GetTokenXML',
|
93
|
+
p1: @username,
|
94
|
+
p2: @password,
|
95
|
+
p3: @partner_id,
|
96
|
+
p4: args[:payee_id],
|
97
|
+
xml: prefill_xml_data(args)
|
98
|
+
}
|
99
|
+
end
|
100
|
+
|
101
|
+
def prefill_xml_data(args)
|
102
|
+
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
103
|
+
xml.PayoneerDetails do
|
104
|
+
xml.Details do
|
105
|
+
xml.userName @username
|
106
|
+
xml.password @password
|
107
|
+
xml.prid @partner_id
|
108
|
+
xml.apuid args[:payee_id]
|
109
|
+
xml.sessionid args[:session_id] if args[:session_id]
|
110
|
+
xml.redirect args[:redirect_url] if args[:redirect_url]
|
111
|
+
xml.redirectTime args[:redirect_time] if args[:redirect_time]
|
112
|
+
xml.cardType args[:card_type] if args[:card_type]
|
113
|
+
xml.BlockType args[:block_type] if args[:block_type]
|
114
|
+
xml.PayoutMethodList (args[:payout_methods].is_a?(Array) ?
|
115
|
+
args[:payout_methods].join(',') :
|
116
|
+
args[:payout_methods]) if args[:payout_methods]
|
117
|
+
xml.regMode args[:registration_mode] if args[:registration_mode]
|
118
|
+
xml.holdApproval args[:hold_approval] if args[:hold_approval]
|
119
|
+
end
|
120
|
+
xml.PersonalDetails do
|
121
|
+
xml.firstName args[:first_name] if args[:first_name]
|
122
|
+
xml.lastName args[:last_name] if args[:last_name]
|
123
|
+
xml.dateOfBirth args[:date_of_birth] if args[:date_of_birth]
|
124
|
+
xml.address1 args[:address].is_a?(Array) ? args[:address].first : args[:address]
|
125
|
+
xml.address2 args[:address].last if args[:address].is_a?(Array)
|
126
|
+
xml.city args[:city] if args[:city]
|
127
|
+
xml.country args[:country_code] if args[:country_code]
|
128
|
+
xml.state args[:state_code] if args[:state_code]
|
129
|
+
xml.zipCode args[:zip_code] if args[:zip_code]
|
130
|
+
xml.mobile args[:mobile_phone] if args[:mobile_phone]
|
131
|
+
xml.phone args[:phone] if args[:phone]
|
132
|
+
xml.email args[:email] if args[:email]
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
builder.to_xml#.tap { |x| puts x.inspect }
|
137
|
+
end
|
138
|
+
|
139
|
+
def api_url
|
140
|
+
@environment.to_s == 'production' ? PRODUCTION_API_URL : SANDBOX_API_URL
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
data/lib/payoneer_api.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'payoneer_api/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'payoneer_api'
|
7
|
+
spec.version = PayoneerApi::Version
|
8
|
+
spec.date = '2014-05-02'
|
9
|
+
spec.description = %q(Ruby wrapper for Payoneer API)
|
10
|
+
spec.summary = spec.description
|
11
|
+
spec.authors = ['Donald Piret']
|
12
|
+
spec.email = %w[donald@donaldpiret.com]
|
13
|
+
spec.files = %w[README.md payoneer_api.gemspec]
|
14
|
+
spec.files += Dir.glob('lib/**/*.rb')
|
15
|
+
spec.files += Dir.glob('spec/**/*')
|
16
|
+
spec.licenses = %w[MIT]
|
17
|
+
spec.require_paths = %w[lib]
|
18
|
+
spec.required_rubygems_version = '>= 1.3.5'
|
19
|
+
spec.test_files = Dir.glob('spec/**/*')
|
20
|
+
spec.homepage = 'https://github.com/donaldpiret/payoneer_api'
|
21
|
+
|
22
|
+
spec.add_dependency 'nokogiri', '~> 1.5'
|
23
|
+
|
24
|
+
spec.add_development_dependency 'rspec', '~> 2.14'
|
25
|
+
spec.add_development_dependency 'vcr', '~> 2.9'
|
26
|
+
spec.add_development_dependency 'webmock', '~> 1.17'
|
27
|
+
spec.add_development_dependency 'dotenv', '~> 0.11'
|
28
|
+
spec.add_development_dependency 'byebug', '~> 3.1'
|
29
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.sandbox.payoneer.com/Payouts/HttpApi/API.aspx
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: mname=GetTokenXML&p1=Room5620&p2=12Gauh3uSe&p3=100035620&p4=1&xml=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3CPayoneerDetails%3E%0A++%3CDetails%3E%0A++++%3CuserName%3ERoom5620%3C%2FuserName%3E%0A++++%3Cpassword%3E12Gauh3uSe%3C%2Fpassword%3E%0A++++%3Cprid%3E100035620%3C%2Fprid%3E%0A++++%3Capuid%3E1%3C%2Fapuid%3E%0A++++%3Credirect%3Ehttp%3A%2F%2Ftest.com%2Fredirect%3C%2Fredirect%3E%0A++++%3CredirectTime%3E10%3C%2FredirectTime%3E%0A++++%3CPayoutMethodList%3EPrepaidCard%3C%2FPayoutMethodList%3E%0A++%3C%2FDetails%3E%0A++%3CPersonalDetails%3E%0A++++%3CfirstName%3EDonald%3C%2FfirstName%3E%0A++++%3ClastName%3EPiret%3C%2FlastName%3E%0A++++%3CdateOfBirth%3E1984-04-01%3C%2FdateOfBirth%3E%0A++++%3Caddress1%3E115+Amoy+street%3C%2Faddress1%3E%0A++++%3Ccity%3ESingapore%3C%2Fcity%3E%0A++++%3CzipCode%3E069935%3C%2FzipCode%3E%0A++++%3Cphone%3E%2B123456789%3C%2Fphone%3E%0A++++%3Cemail%3Edonald%40roomorama.com%3C%2Femail%3E%0A++%3C%2FPersonalDetails%3E%0A%3C%2FPayoneerDetails%3E%0A
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- no-cache, no-store, must-revalidate
|
25
|
+
Pragma:
|
26
|
+
- no-cache
|
27
|
+
Content-Type:
|
28
|
+
- text/html; charset=utf-8
|
29
|
+
Expires:
|
30
|
+
- '-1'
|
31
|
+
Set-Cookie:
|
32
|
+
- ASP.NET_SessionId=o3lj0gw4e5owdto2rblf4xkw; domain=.sandbox.payoneer.com;
|
33
|
+
path=/; secure; HttpOnly
|
34
|
+
- pid=100035620; domain=.sandbox.payoneer.com; expires=Fri, 01-May-2015 03:32:26
|
35
|
+
GMT; path=/; secure
|
36
|
+
P3p:
|
37
|
+
- CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
|
38
|
+
X-Powered-By:
|
39
|
+
- ASP.NET
|
40
|
+
Date:
|
41
|
+
- Fri, 02 May 2014 03:32:27 GMT
|
42
|
+
Content-Length:
|
43
|
+
- '185'
|
44
|
+
Connection:
|
45
|
+
- Keep-Alive
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: <?xml version="1.0" encoding="UTF-8"?><PayoneerToken><Token>http://payouts.sandbox.payoneer.com/partners/lp.aspx?token=b8e8eab41931475cb4b66b54996a7cb1A9A9579049</Token></PayoneerToken>
|
49
|
+
http_version:
|
50
|
+
recorded_at: Fri, 02 May 2014 03:32:26 GMT
|
51
|
+
recorded_with: VCR 2.9.0
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.sandbox.payoneer.com/Payouts/HttpApi/API.aspx
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: mname=GetTokenXML&p1=Room5620&p2=12Gauh3uSe&p3=100035620&p4=1&xml=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3CPayoneerDetails%3E%0A++%3CDetails%3E%0A++++%3CuserName%3ERoom5620%3C%2FuserName%3E%0A++++%3Cpassword%3E12Gauh3uSe%3C%2Fpassword%3E%0A++++%3Cprid%3E100035620%3C%2Fprid%3E%0A++++%3Capuid%3E1%3C%2Fapuid%3E%0A++++%3Credirect%3Ehttp%3A%2F%2Ftest.com%2Fredirect%3C%2Fredirect%3E%0A++++%3CredirectTime%3E10%3C%2FredirectTime%3E%0A++++%3CPayoutMethodList%3EPrepaidCard%3C%2FPayoutMethodList%3E%0A++%3C%2FDetails%3E%0A++%3CPersonalDetails%3E%0A++++%3CfirstName%3EDonald%3C%2FfirstName%3E%0A++++%3ClastName%3EPiret%3C%2FlastName%3E%0A++++%3CdateOfBirth%3E1984-04-01%3C%2FdateOfBirth%3E%0A++++%3Caddress1%3E115+Amoy+street%3C%2Faddress1%3E%0A++++%3Ccity%3ESingapore%3C%2Fcity%3E%0A++++%3CzipCode%3E069935%3C%2FzipCode%3E%0A++++%3Cphone%3E%2B123456789%3C%2Fphone%3E%0A++++%3Cemail%3Edonald%40roomorama.com%3C%2Femail%3E%0A++%3C%2FPersonalDetails%3E%0A%3C%2FPayoneerDetails%3E%0A
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- no-cache, no-store, must-revalidate
|
25
|
+
Pragma:
|
26
|
+
- no-cache
|
27
|
+
Content-Type:
|
28
|
+
- text/html; charset=utf-8
|
29
|
+
Expires:
|
30
|
+
- '-1'
|
31
|
+
Set-Cookie:
|
32
|
+
- ASP.NET_SessionId=ggmjf5i3ls0zaaghaxt1kk5w; domain=.sandbox.payoneer.com;
|
33
|
+
path=/; secure; HttpOnly
|
34
|
+
- pid=100035620; domain=.sandbox.payoneer.com; expires=Fri, 01-May-2015 03:10:21
|
35
|
+
GMT; path=/; secure
|
36
|
+
P3p:
|
37
|
+
- CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
|
38
|
+
X-Powered-By:
|
39
|
+
- ASP.NET
|
40
|
+
Date:
|
41
|
+
- Fri, 02 May 2014 03:10:21 GMT
|
42
|
+
Content-Length:
|
43
|
+
- '185'
|
44
|
+
Connection:
|
45
|
+
- Keep-Alive
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: <?xml version="1.0" encoding="UTF-8"?><PayoneerToken><Token>http://payouts.sandbox.payoneer.com/partners/lp.aspx?token=b8e8eab41931475cb4b66b54996a7cb1A9A9579049</Token></PayoneerToken>
|
49
|
+
http_version:
|
50
|
+
recorded_at: Fri, 02 May 2014 03:10:21 GMT
|
51
|
+
recorded_with: VCR 2.9.0
|
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.sandbox.payoneer.com/Payouts/HttpApi/API.aspx?mname=GetToken&p1=Room5620&p2=12Gauh3uSe&p3=100035620&p4=1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Cache-Control:
|
22
|
+
- no-cache, no-store, must-revalidate
|
23
|
+
Pragma:
|
24
|
+
- no-cache
|
25
|
+
Content-Type:
|
26
|
+
- text/html; charset=utf-8
|
27
|
+
Expires:
|
28
|
+
- '-1'
|
29
|
+
Set-Cookie:
|
30
|
+
- ASP.NET_SessionId=0ismdumpgdhxsjd1lj3hiuk5; domain=.sandbox.payoneer.com;
|
31
|
+
path=/; secure; HttpOnly
|
32
|
+
- pid=100035620; domain=.sandbox.payoneer.com; expires=Fri, 01-May-2015 03:29:35
|
33
|
+
GMT; path=/; secure
|
34
|
+
P3p:
|
35
|
+
- CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
|
36
|
+
X-Powered-By:
|
37
|
+
- ASP.NET
|
38
|
+
Date:
|
39
|
+
- Fri, 02 May 2014 03:29:35 GMT
|
40
|
+
Content-Length:
|
41
|
+
- '101'
|
42
|
+
Connection:
|
43
|
+
- Keep-Alive
|
44
|
+
body:
|
45
|
+
encoding: UTF-8
|
46
|
+
string: http://payouts.sandbox.payoneer.com/partners/lp.aspx?token=b8e8eab41931475cb4b66b54996a7cb1A9A9579049
|
47
|
+
http_version:
|
48
|
+
recorded_at: Fri, 02 May 2014 03:29:35 GMT
|
49
|
+
recorded_with: VCR 2.9.0
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe PayoneerApi::Client do
|
3
|
+
let(:client) {
|
4
|
+
PayoneerApi::Client.new(
|
5
|
+
partner_id: ENV['PAYONEER_ID'],
|
6
|
+
username: ENV['PAYONEER_USERNAME'],
|
7
|
+
password: ENV['PAYONEER_PASSWORD'],
|
8
|
+
environment: 'sandbox'
|
9
|
+
)
|
10
|
+
}
|
11
|
+
|
12
|
+
describe '#payee_signup_url', vcr: true do
|
13
|
+
it 'returns a url to the registration page' do
|
14
|
+
response = client.payee_signup_url('1')
|
15
|
+
expect(URI.parse(response).host).to eq('payouts.sandbox.payoneer.com')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#payee_prefilled_signup_url', vcr: true do
|
20
|
+
context 'with all correct params passed in' do
|
21
|
+
let(:params) {{
|
22
|
+
redirect_url: 'http://test.com/redirect',
|
23
|
+
redirect_time: 10,
|
24
|
+
payout_methods: 'PrepaidCard',
|
25
|
+
first_name: 'Donald',
|
26
|
+
last_name: 'Piret',
|
27
|
+
date_of_birth: Date.parse('1984-04-01'),
|
28
|
+
address: '115 Amoy street',
|
29
|
+
city: 'Singapore',
|
30
|
+
county_code: 'SG',
|
31
|
+
zip_code: '069935',
|
32
|
+
phone: '+123456789',
|
33
|
+
email: 'donald@roomorama.com'
|
34
|
+
}}
|
35
|
+
|
36
|
+
it 'returns a url to the prefilled registration page' do
|
37
|
+
response = client.payee_prefilled_signup_url('1', params)
|
38
|
+
expect(URI.parse(response).host).to eq('payouts.sandbox.payoneer.com')
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'includes a token parameter in this url' do
|
42
|
+
response = client.payee_prefilled_signup_url('1', params)
|
43
|
+
expect(CGI.parse(URI.parse(response).query)).to have_key('token')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
Bundler.setup
|
3
|
+
|
4
|
+
require 'payoneer_api'
|
5
|
+
require 'vcr'
|
6
|
+
require 'webmock'
|
7
|
+
require 'nokogiri'
|
8
|
+
require 'byebug'
|
9
|
+
require 'dotenv'
|
10
|
+
Dotenv.load
|
11
|
+
|
12
|
+
RSpec.configure do |c|
|
13
|
+
c.treat_symbols_as_metadata_keys_with_true_values = true
|
14
|
+
end
|
15
|
+
|
16
|
+
VCR.configure do |c|
|
17
|
+
c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
18
|
+
c.hook_into :webmock
|
19
|
+
c.configure_rspec_metadata!
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: payoneer_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Donald Piret
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.14'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.14'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: vcr
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.9'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.17'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.17'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: dotenv
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.11'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.11'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.1'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.1'
|
97
|
+
description: Ruby wrapper for Payoneer API
|
98
|
+
email:
|
99
|
+
- donald@donaldpiret.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- README.md
|
105
|
+
- lib/payoneer_api.rb
|
106
|
+
- lib/payoneer_api/client.rb
|
107
|
+
- lib/payoneer_api/payoneer_exception.rb
|
108
|
+
- lib/payoneer_api/version.rb
|
109
|
+
- payoneer_api.gemspec
|
110
|
+
- spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_prefilled_signup_url/with_all_correct_params_passed_in/includes_a_token_parameter_in_this_url.yml
|
111
|
+
- spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_prefilled_signup_url/with_all_correct_params_passed_in/returns_a_url_to_the_prefilled_registration_page.yml
|
112
|
+
- spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_signup_url/returns_a_url_to_the_registration_page.yml
|
113
|
+
- spec/payoneer_api/client_spec.rb
|
114
|
+
- spec/spec_helper.rb
|
115
|
+
homepage: https://github.com/donaldpiret/payoneer_api
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
|
+
metadata: {}
|
119
|
+
post_install_message:
|
120
|
+
rdoc_options: []
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 1.3.5
|
133
|
+
requirements: []
|
134
|
+
rubyforge_project:
|
135
|
+
rubygems_version: 2.2.2
|
136
|
+
signing_key:
|
137
|
+
specification_version: 4
|
138
|
+
summary: Ruby wrapper for Payoneer API
|
139
|
+
test_files:
|
140
|
+
- spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_prefilled_signup_url/with_all_correct_params_passed_in/includes_a_token_parameter_in_this_url.yml
|
141
|
+
- spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_prefilled_signup_url/with_all_correct_params_passed_in/returns_a_url_to_the_prefilled_registration_page.yml
|
142
|
+
- spec/fixtures/vcr_cassettes/PayoneerApi_Client/_payee_signup_url/returns_a_url_to_the_registration_page.yml
|
143
|
+
- spec/payoneer_api/client_spec.rb
|
144
|
+
- spec/spec_helper.rb
|