payoneer 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b7c4fda16d521bdceada614b720efe8ec33ad7e4
4
+ data.tar.gz: 66e4c1d2e1c1c312bd3401355d2c0d9384bae0d1
5
+ SHA512:
6
+ metadata.gz: 26ec5b315fd9ce785440c4e5eab9bed082eeebad20b7838b869579dcb2ee22139e9849c57db1350c57764984f2fd65196e803eac9c9187d234c699f5686afc86
7
+ data.tar.gz: 4c0aa2e58300f241cb1652a5724404d9ca043c52098f470306eef5e44cf2f215d29ce6e81b2982ecda79d46434d3b59aa37743a44289fdf2b7ba69a198493ce9
@@ -7,12 +7,12 @@ module Payoneer
7
7
 
8
8
  def execute(method_name, response_klass, params = {})
9
9
  configure_security
10
- response = self.class.get(api_url, :query => {:mname => method_name}.merge(params))
10
+ response = self.class.post(api_url, :query => {:mname => method_name}, :body => params)
11
11
  response_klass.new(response.body)
12
12
  end
13
13
 
14
14
  private
15
-
15
+
16
16
  def api_url
17
17
  ['https://', host, '/payouts/HttpApi/Api.aspx'].join
18
18
  end
@@ -6,7 +6,7 @@ require 'payoneer/version'
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'payoneer'
8
8
  s.version = Payoneer::VERSION
9
- s.date = '2014-04-23'
9
+ s.date = '2016-09-21'
10
10
  s.summary = "Payoneer API"
11
11
  s.description = "Interface to the Payoneer API"
12
12
  s.authors = ["Envato"]
@@ -23,4 +23,4 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency 'cane', '~> 2.6'
24
24
  s.add_development_dependency 'webmock', '~> 1.17'
25
25
  s.add_development_dependency 'timecop', '~> 0.7'
26
- end
26
+ end
@@ -3,6 +3,17 @@ require 'spec_helper'
3
3
  describe 'performing a payout' do
4
4
  let(:success_body) { '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><PerformPayoutPayment><Description></Description><PaymentID>333</PaymentID><Status>000</Status><PayoneerID>1234</PayoneerID></PerformPayoutPayment>' }
5
5
  let(:fail_body) { '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><PerformPayoutPayment><Description>Payee does not exist</Description><PaymentID>666</PaymentID><Status>002</Status><PayoneerID>8888</PayoneerID></PerformPayoutPayment>' }
6
+ let(:expected_params) { {
7
+ :p1 => 'frankie',
8
+ :p2 => 'bloggs',
9
+ :p3 => 'p90001',
10
+ :p4 => 'program12345',
11
+ :p5 => '1234',
12
+ :p6 => '44',
13
+ :p7 => '300',
14
+ :p8 => 'Hello Worlds',
15
+ :p9 => Time.now.utc.strftime("%m/%d/%Y %H:%M:%S")
16
+ } }
6
17
 
7
18
  before do
8
19
  Timecop.freeze
@@ -13,12 +24,11 @@ describe 'performing a payout' do
13
24
  Payoneer::Configuration.password = 'bloggs'
14
25
  Payoneer::Configuration.program_id = 'program12345'
15
26
 
16
- stub_request(:get, "https://api.sandbox.payoneer.com/payouts/HttpApi/Api.aspx?" + request_params).to_return(:body => response_body)
27
+ stub_request(:post, "https://api.sandbox.payoneer.com/payouts/HttpApi/Api.aspx?mname=PerformPayoutPayment").with(:body => expected_params).to_return(:body => response_body)
17
28
  end
18
29
 
19
30
  context 'when a successful payout is made' do
20
31
  let(:response_body) { success_body }
21
- let(:request_params) { "mname=PerformPayoutPayment&p1=frankie&p2=bloggs&p3=p90001&p4=program12345&p5=1234&p6=44&p7=300&p8=Hello Worlds&p9=#{Time.now.utc.strftime("%m/%d/%Y %H:%M:%S")}" }
22
32
 
23
33
  it 'returns success' do
24
34
  response = Payoneer::PerformPayoutPaymentRequest.new.perform_payment 1234, 44, 300, 'Hello Worlds'
@@ -28,7 +38,6 @@ describe 'performing a payout' do
28
38
 
29
39
  context 'when a failed payout is made' do
30
40
  let(:response_body) { fail_body }
31
- let(:request_params) { "mname=PerformPayoutPayment&p1=frankie&p2=bloggs&p3=p90001&p4=program12345&p5=1234&p6=44&p7=300&p8=Hello Worlds&p9=#{Time.now.utc.strftime("%m/%d/%Y %H:%M:%S")}" }
32
41
 
33
42
  it 'returns failure' do
34
43
  response = Payoneer::PerformPayoutPaymentRequest.new.perform_payment 1234, 44, 300, 'Hello Worlds'
@@ -36,4 +45,4 @@ describe 'performing a payout' do
36
45
  expect(response.error_message).to eq("Payee does not exist")
37
46
  end
38
47
  end
39
- end
48
+ end
@@ -4,4 +4,4 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'payoneer'
5
5
  require 'rspec'
6
6
  require 'webmock/rspec'
7
- require 'timecop'
7
+ require 'timecop'
metadata CHANGED
@@ -1,138 +1,123 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payoneer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
5
- prerelease:
4
+ version: 0.1.14
6
5
  platform: ruby
7
6
  authors:
8
7
  - Envato
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-04-23 00:00:00.000000000 Z
11
+ date: 2016-09-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: httparty
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0.13'
22
- - - ! '>='
20
+ - - ">="
23
21
  - !ruby/object:Gem::Version
24
22
  version: 0.13.1
25
23
  type: :runtime
26
24
  prerelease: false
27
25
  version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
26
  requirements:
30
- - - ~>
27
+ - - "~>"
31
28
  - !ruby/object:Gem::Version
32
29
  version: '0.13'
33
- - - ! '>='
30
+ - - ">="
34
31
  - !ruby/object:Gem::Version
35
32
  version: 0.13.1
36
33
  - !ruby/object:Gem::Dependency
37
34
  name: nokogiri
38
35
  requirement: !ruby/object:Gem::Requirement
39
- none: false
40
36
  requirements:
41
- - - ~>
37
+ - - "~>"
42
38
  - !ruby/object:Gem::Version
43
39
  version: '1.6'
44
- - - ! '>='
40
+ - - ">="
45
41
  - !ruby/object:Gem::Version
46
42
  version: 1.6.1
47
43
  type: :runtime
48
44
  prerelease: false
49
45
  version_requirements: !ruby/object:Gem::Requirement
50
- none: false
51
46
  requirements:
52
- - - ~>
47
+ - - "~>"
53
48
  - !ruby/object:Gem::Version
54
49
  version: '1.6'
55
- - - ! '>='
50
+ - - ">="
56
51
  - !ruby/object:Gem::Version
57
52
  version: 1.6.1
58
53
  - !ruby/object:Gem::Dependency
59
54
  name: rake
60
55
  requirement: !ruby/object:Gem::Requirement
61
- none: false
62
56
  requirements:
63
- - - ~>
57
+ - - "~>"
64
58
  - !ruby/object:Gem::Version
65
59
  version: '10.3'
66
60
  type: :development
67
61
  prerelease: false
68
62
  version_requirements: !ruby/object:Gem::Requirement
69
- none: false
70
63
  requirements:
71
- - - ~>
64
+ - - "~>"
72
65
  - !ruby/object:Gem::Version
73
66
  version: '10.3'
74
67
  - !ruby/object:Gem::Dependency
75
68
  name: rspec
76
69
  requirement: !ruby/object:Gem::Requirement
77
- none: false
78
70
  requirements:
79
- - - ~>
71
+ - - "~>"
80
72
  - !ruby/object:Gem::Version
81
73
  version: 3.0.0.beta1
82
74
  type: :development
83
75
  prerelease: false
84
76
  version_requirements: !ruby/object:Gem::Requirement
85
- none: false
86
77
  requirements:
87
- - - ~>
78
+ - - "~>"
88
79
  - !ruby/object:Gem::Version
89
80
  version: 3.0.0.beta1
90
81
  - !ruby/object:Gem::Dependency
91
82
  name: cane
92
83
  requirement: !ruby/object:Gem::Requirement
93
- none: false
94
84
  requirements:
95
- - - ~>
85
+ - - "~>"
96
86
  - !ruby/object:Gem::Version
97
87
  version: '2.6'
98
88
  type: :development
99
89
  prerelease: false
100
90
  version_requirements: !ruby/object:Gem::Requirement
101
- none: false
102
91
  requirements:
103
- - - ~>
92
+ - - "~>"
104
93
  - !ruby/object:Gem::Version
105
94
  version: '2.6'
106
95
  - !ruby/object:Gem::Dependency
107
96
  name: webmock
108
97
  requirement: !ruby/object:Gem::Requirement
109
- none: false
110
98
  requirements:
111
- - - ~>
99
+ - - "~>"
112
100
  - !ruby/object:Gem::Version
113
101
  version: '1.17'
114
102
  type: :development
115
103
  prerelease: false
116
104
  version_requirements: !ruby/object:Gem::Requirement
117
- none: false
118
105
  requirements:
119
- - - ~>
106
+ - - "~>"
120
107
  - !ruby/object:Gem::Version
121
108
  version: '1.17'
122
109
  - !ruby/object:Gem::Dependency
123
110
  name: timecop
124
111
  requirement: !ruby/object:Gem::Requirement
125
- none: false
126
112
  requirements:
127
- - - ~>
113
+ - - "~>"
128
114
  - !ruby/object:Gem::Version
129
115
  version: '0.7'
130
116
  type: :development
131
117
  prerelease: false
132
118
  version_requirements: !ruby/object:Gem::Requirement
133
- none: false
134
119
  requirements:
135
- - - ~>
120
+ - - "~>"
136
121
  - !ruby/object:Gem::Version
137
122
  version: '0.7'
138
123
  description: Interface to the Payoneer API
@@ -141,7 +126,7 @@ executables: []
141
126
  extensions: []
142
127
  extra_rdoc_files: []
143
128
  files:
144
- - .gitignore
129
+ - ".gitignore"
145
130
  - Gemfile
146
131
  - Gemfile.lock
147
132
  - LICENSE
@@ -161,26 +146,25 @@ files:
161
146
  homepage: https://github.com/envato/payoneer
162
147
  licenses:
163
148
  - MIT
149
+ metadata: {}
164
150
  post_install_message:
165
151
  rdoc_options: []
166
152
  require_paths:
167
153
  - lib
168
154
  required_ruby_version: !ruby/object:Gem::Requirement
169
- none: false
170
155
  requirements:
171
- - - ! '>='
156
+ - - ">="
172
157
  - !ruby/object:Gem::Version
173
158
  version: '0'
174
159
  required_rubygems_version: !ruby/object:Gem::Requirement
175
- none: false
176
160
  requirements:
177
- - - ! '>='
161
+ - - ">="
178
162
  - !ruby/object:Gem::Version
179
163
  version: '0'
180
164
  requirements: []
181
165
  rubyforge_project:
182
- rubygems_version: 1.8.21
166
+ rubygems_version: 2.2.3
183
167
  signing_key:
184
- specification_version: 3
168
+ specification_version: 4
185
169
  summary: Payoneer API
186
170
  test_files: []