adyen_jpiqueras 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05bd483db66cada29259292de71f385a2c54345a
4
- data.tar.gz: ac777c6f970f2b311ce3bd4d3798eace00b0d357
3
+ metadata.gz: b5139ac00936797e1f84aefb6a162168a81e310a
4
+ data.tar.gz: 0f8eb991c5e19cd5e5b76997ccd476fe0b788041
5
5
  SHA512:
6
- metadata.gz: c118178acf9a176f816c06fb831ba622656d0f99f611a62ada157422a76fcac23e2e16c6a6d5b78ebf0c0ebc737b450a4cf46076d2b1aa45903c1f055ce44b21
7
- data.tar.gz: 5131df70714f73087622423e4cc206412e5ab49abc53e5f61f060b1df9462ea796c84d60c72a0d3d15282889c52c0bf9b5a8ac90e0cde522b4cf31214fe1b811
6
+ metadata.gz: 9276098701eee8a3f7d17fea9c9a0232aa123a320bb830fc0b757d1b0e2910d2217e59b428666567c0ddc6ff8103a95d6d48c5f37f7b2106f7b14c3d235ac011
7
+ data.tar.gz: 116b47ff94bb0b875d816d1b738dfca7ea993bc2f1d98634dfa64400d590925fc334f748af396d7951c74d74a195ff1e88c65feab0edce6bb96e4e64505f2932
@@ -6,6 +6,18 @@ The following changes have been made to the library over the years. Pleae add an
6
6
 
7
7
  Nothing yet!
8
8
 
9
+ #### Version 2.5.0
10
+
11
+ - Add ThirdParty methods for Payout API
12
+
13
+ #### Version 2.4.0
14
+
15
+ - Fix error handling
16
+
17
+ #### Version 2.3.0
18
+
19
+ - Add Payouts API support
20
+
9
21
  #### Version 2.2.0
10
22
 
11
23
  - Add `Adyen::HPP` to integrate with Adyen's Hosted Payment Pages. `Adyen::HPP` supports the new HMAC-256 signing mechanism. `Adyen::Form` should be considered deprecated and will be removed from a future release.
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  EOS
21
21
 
22
22
  s.authors = ['Willem van Bergen', 'Michel Barbosa', 'Stefan Borsje', 'Eloy Durán', 'Jordi Piqueras']
23
- s.email = ['willem@vanbergen.org', 'cicaboo@gmail.com', 'mail@sborsje.nl', 'eloy.de.enige@gmail.com', 'jordi.piqueras@helpling.net']
23
+ s.email = ['willem@vanbergen.org', 'cicaboo@gmail.com', 'mail@sborsje.nl', 'eloy.de.enige@gmail.com', 'jordi.piqueras@helpling.com']
24
24
  s.homepage = 'http://github.com/wvanbergen/adyen/wiki'
25
25
  s.license = 'MIT'
26
26
 
@@ -109,7 +109,7 @@ module Adyen
109
109
  when Net::HTTPUnauthorized
110
110
  raise Adyen::REST::Error.new("Webservice credentials are incorrect")
111
111
  else
112
- raise Adyen::REST::Error.new("Unexpected HTTP response code: #{response.code} | response body: #{response.body}")
112
+ raise Adyen::REST::Error.new("Unexpected HTTP response code: #{response.code} | request path: #{request.path} | response body: #{response.body}")
113
113
  end
114
114
  end
115
115
 
@@ -5,6 +5,11 @@ module Adyen
5
5
  # https://docs.adyen.com/developers/payout-manual
6
6
  module Payout
7
7
  class Request < Adyen::REST::Request
8
+ protected
9
+
10
+ def base_path
11
+ '/pal/servlet/%s/v25/%s'
12
+ end
8
13
  end
9
14
 
10
15
  class Response < Adyen::REST::Response
@@ -60,16 +65,36 @@ module Adyen
60
65
  execute_request(request)
61
66
  end
62
67
 
68
+ def submit_payout_third_party(attributes = {})
69
+ request = store_request('Payout.submitThirdParty', attributes)
70
+ execute_request(request)
71
+ end
72
+
73
+ def submit_and_store_payout_third_party(attributes = {})
74
+ request = store_request('Payout.storeDetailAndSubmitThirdParty', attributes)
75
+ execute_request(request)
76
+ end
77
+
63
78
  def confirm_payout(attributes = {})
64
79
  request = review_request('Payout.confirm', attributes)
65
80
  execute_request(request)
66
81
  end
67
82
 
83
+ def confirm_payout_third_party(attributes = {})
84
+ request = review_request('Payout.confirmThirdParty', attributes)
85
+ execute_request(request)
86
+ end
87
+
68
88
  def decline_payout(attributes = {})
69
89
  request = review_request('Payout.decline', attributes)
70
90
  execute_request(request)
71
91
  end
72
92
 
93
+ def decline_payout_third_party(attributes = {})
94
+ request = review_request('Payout.declineThirdParty', attributes)
95
+ execute_request(request)
96
+ end
97
+
73
98
  private
74
99
  # Require you to use a client initialize with payout_store
75
100
  def store_request(action, attributes)
@@ -93,12 +93,12 @@ module Adyen
93
93
  end
94
94
 
95
95
  def generate_path(action)
96
- PATH % action.split('.')
96
+ base_path % action.split('.')
97
97
  end
98
98
 
99
- # @see Adyen::REST::Request#set_path
100
- PATH = '/pal/servlet/%s/v12/%s'
101
- private_constant :PATH
99
+ def base_path
100
+ '/pal/servlet/%s/v12/%s'
101
+ end
102
102
  end
103
103
  end
104
104
  end
@@ -1,5 +1,5 @@
1
1
  module Adyen
2
2
  # Version constant for the Adyen plugin.
3
3
  # Set it & commit the change before running rake release.
4
- VERSION = "2.4.0"
4
+ VERSION = '2.5.0'
5
5
  end
@@ -8,6 +8,7 @@ class PayoutAPITest < Minitest::Test
8
8
  'storePayout@Company.VanBergen',
9
9
  'xxWWcc'
10
10
  )
11
+ @merchant_account = 'VanBergenORG'
11
12
  end
12
13
 
13
14
  def teardown
@@ -16,7 +17,7 @@ class PayoutAPITest < Minitest::Test
16
17
 
17
18
  def test_submit_and_store_request
18
19
  response = @client.submit_and_store_payout(
19
- merchantAccount: 'VanBergenORG',
20
+ merchantAccount: @merchant_account,
20
21
  amount: { currency: 'EUR', value: 20},
21
22
  bank: { iban: 'NL48RABO0132394782', bankName: 'Rabobank', countryCode: 'NL', ownerName: 'Test shopper' },
22
23
  recurring: { contract: 'PAYOUT' },
@@ -29,9 +30,32 @@ class PayoutAPITest < Minitest::Test
29
30
  assert response.psp_reference
30
31
  end
31
32
 
33
+ def test_submit_and_store_third_party_request
34
+ response = @client.submit_and_store_payout_third_party(
35
+ merchantAccount: @merchant_account,
36
+ amount: { currency: 'EUR', value: 20},
37
+ bank: { iban: 'NL48RABO0132394782', bankName: 'Rabobank', countryCode: 'NL', ownerName: 'Test shopper' },
38
+ recurring: { contract: 'PAYOUT' },
39
+ reference: 'PayoutPayment-0001',
40
+ shopperEmail: 'shopper@example.com',
41
+ shopperReference: 'ShopperFoo',
42
+ entityType: 'NaturalPerson',
43
+ shoppername: {
44
+ firstname: 'John',
45
+ gender: 'MALE',
46
+ lastname: 'Doe',
47
+ },
48
+ nationality: 'NL',
49
+ dateOfBirth: '1980-01-01',
50
+ )
51
+
52
+ assert response.received?
53
+ assert response.psp_reference
54
+ end
55
+
32
56
  def test_store_request
33
57
  response = @client.store_payout(
34
- merchantAccount: 'VanBergenORG',
58
+ merchantAccount: @merchant_account,
35
59
  bank: { iban: 'NL48RABO0132394782', bankName: 'Rabobank', countryCode: 'NL', ownerName: 'Test shopper' },
36
60
  recurring: { contract: 'PAYOUT' },
37
61
  shopperEmail: 'shopper@example.com',
@@ -44,7 +68,7 @@ class PayoutAPITest < Minitest::Test
44
68
 
45
69
  def test_submit_request
46
70
  response = @client.submit_payout(
47
- merchantAccount: 'VanBergenORG',
71
+ merchantAccount: @merchant_account,
48
72
  amount: { currency: 'EUR', value: 20 },
49
73
  recurring: { contract: 'PAYOUT' },
50
74
  reference: 'PayoutPayment-0001',
@@ -56,6 +80,29 @@ class PayoutAPITest < Minitest::Test
56
80
  assert response.received?
57
81
  assert response.psp_reference
58
82
  end
83
+
84
+ def test_submit_third_party_request
85
+ response = @client.submit_payout_third_party(
86
+ merchantAccount: @merchant_account,
87
+ amount: { currency: 'EUR', value: 20 },
88
+ recurring: { contract: 'PAYOUT' },
89
+ reference: 'PayoutPayment-0001',
90
+ shopperEmail: 'shopper@example.com',
91
+ shopperReference: 'ShopperFoo',
92
+ selectedRecurringDetailReference: 'LATEST',
93
+ entityType: 'NaturalPerson',
94
+ shoppername: {
95
+ firstname: 'John',
96
+ gender: 'MALE',
97
+ lastname: 'Doe',
98
+ },
99
+ nationality: 'NL',
100
+ dateOfBirth: '1980-01-01',
101
+ )
102
+
103
+ assert response.received?
104
+ assert response.psp_reference
105
+ end
59
106
  end
60
107
 
61
108
  class PayoutReviewTest < Minitest::Test
@@ -65,6 +112,7 @@ class PayoutReviewTest < Minitest::Test
65
112
  'reviewPayout@Company.VanBergen',
66
113
  'ssWWcc'
67
114
  )
115
+ @merchant_account = 'VanBergenORG'
68
116
  end
69
117
 
70
118
  def teardown
@@ -73,7 +121,17 @@ class PayoutReviewTest < Minitest::Test
73
121
 
74
122
  def test_confirm_payout
75
123
  response = @client.confirm_payout(
76
- merchantAccount: 'VanBergenORG',
124
+ merchantAccount: @merchant_account,
125
+ originalReference: '1234'
126
+ )
127
+
128
+ assert response.confirmed?
129
+ assert response.psp_reference
130
+ end
131
+
132
+ def test_confirm_payout_third_party
133
+ response = @client.confirm_payout_third_party(
134
+ merchantAccount: @merchant_account,
77
135
  originalReference: '1234'
78
136
  )
79
137
 
@@ -83,7 +141,17 @@ class PayoutReviewTest < Minitest::Test
83
141
 
84
142
  def test_decline_payout
85
143
  response = @client.decline_payout(
86
- merchantAccount: 'VanBergenORG',
144
+ merchantAccount: @merchant_account,
145
+ originalReference: '1234'
146
+ )
147
+
148
+ assert response.declined?
149
+ assert response.psp_reference
150
+ end
151
+
152
+ def test_decline_payout_third_party
153
+ response = @client.decline_payout_third_party(
154
+ merchantAccount: @merchant_account,
87
155
  originalReference: '1234'
88
156
  )
89
157
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adyen_jpiqueras
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-09-05 00:00:00.000000000 Z
15
+ date: 2017-09-12 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake
@@ -143,7 +143,7 @@ email:
143
143
  - cicaboo@gmail.com
144
144
  - mail@sborsje.nl
145
145
  - eloy.de.enige@gmail.com
146
- - jordi.piqueras@helpling.net
146
+ - jordi.piqueras@helpling.com
147
147
  executables: []
148
148
  extensions: []
149
149
  extra_rdoc_files:
@@ -264,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  requirements:
265
265
  - Having Nokogiri installed will speed up XML handling when using the SOAP API.
266
266
  rubyforge_project:
267
- rubygems_version: 2.5.1
267
+ rubygems_version: 2.6.8
268
268
  signing_key:
269
269
  specification_version: 4
270
270
  summary: Integrate Adyen payment services in your Ruby on Rails application.