adyen-ruby-api-library 4.0.2 → 4.1.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
  SHA256:
3
- metadata.gz: 9e1e891caf5313d525a5cc00bfa709e032684bb84383944357c9ed709b7c517d
4
- data.tar.gz: 6fe18663705bb0ca470d6d9ed0e506a59c5521ccbd7ec9637c653e4b39ea5223
3
+ metadata.gz: 3c88f2064ec4c1e38cfbd6b4d07ea19e0f85e93b40529f17bbdb54674d34adb0
4
+ data.tar.gz: 2948eb3c524bc1361688bf800bda8e9f24f3aaa2b7ec199914ccbb5020b8d2f5
5
5
  SHA512:
6
- metadata.gz: 001454cc1d12e9c6920744a9f8ae34b08f8d9dedddd99795a11372b8b2a6015047957c5f7e81eb8eed970df956fb75cdd46f3c7ca40ed26b8cb5246af0ba5ee4
7
- data.tar.gz: 051c5988b2fd0eb10c0879465c2b67a59f1ada3b0324a02e65b91c9d56e1ff1ff28354cf748e03066a18e50bb2dbc371877c97f871f838910043792973fca3da
6
+ metadata.gz: daebc0ac72b38814bd7111b47a91933ad5f5c5ae7b83eb50ef70fc1540251febb3a2cb2de4d644e0d49d48a1e4e3fa8de09450fa030627f13b48e7af558bf85c
7
+ data.tar.gz: 1e2a7692384f3da060ede6be60f5ac404c84360892a28b71a632a32ca42483900cba0699b865ab5ca82605cab0d19ae3b15e8b1dac37f19c4f8d51fb00a363b2
data/README.md CHANGED
@@ -13,6 +13,7 @@ The Library supports all APIs under the following services:
13
13
  * payouts
14
14
  * recurring
15
15
  * marketpay
16
+ * postfmapi
16
17
 
17
18
  ## Requirements
18
19
 
@@ -137,6 +138,14 @@ adyen.checkout.version = 50
137
138
  - update_notification_configuration
138
139
  - delete_notification_configurations
139
140
 
141
+ **marketpay.hop:**
142
+ - get_onboarding_url
143
+
144
+ **postfmapi:**
145
+ - assign_terminals
146
+ - find_terminal
147
+ - get_terminals_under_account
148
+
140
149
  ## Support
141
150
 
142
151
  If you have any problems, questions or suggestions, create an issue here or send your inquiry to support@adyen.com.
@@ -7,6 +7,7 @@ require_relative "adyen/services/payments"
7
7
  require_relative "adyen/services/payouts"
8
8
  require_relative "adyen/services/recurring"
9
9
  require_relative "adyen/services/marketpay"
10
+ require_relative "adyen/services/postfmapi"
10
11
  require_relative "adyen/services/service"
11
12
  require_relative "adyen/hash_with_accessors"
12
13
  require_relative "adyen/utils/hmac_validator"
data/lib/adyen/client.rb CHANGED
@@ -45,12 +45,15 @@ module Adyen
45
45
  when "CheckoutUtility"
46
46
  url = "https://checkout-#{@env}.adyen.com/checkout"
47
47
  supports_live_url_prefix = true
48
- when "Account", "Fund", "Notification"
48
+ when "Account", "Fund", "Notification", "Hop"
49
49
  url = "https://cal-#{@env}.adyen.com/cal/services"
50
50
  supports_live_url_prefix = false
51
51
  when "Recurring", "Payment", "Payout"
52
52
  url = "https://pal-#{@env}.adyen.com/pal/servlet"
53
53
  supports_live_url_prefix = true
54
+ when "Terminal"
55
+ url = "https://postfmapi-#{@env}.adyen.com/postfmapi/terminal"
56
+ supports_live_url_prefix = false
54
57
  else
55
58
  raise ArgumentError, "Invalid service specified"
56
59
  end
@@ -66,7 +69,7 @@ module Adyen
66
69
 
67
70
  # construct full URL from service and endpoint
68
71
  def service_url(service, action, version)
69
- if service == "Checkout" || service == "CheckoutUtility"
72
+ if service == "Checkout" || service == "CheckoutUtility" || service == "Terminal"
70
73
  "#{service_url_base(service)}/v#{version}/#{action}"
71
74
  else
72
75
  "#{service_url_base(service)}/#{service}/v#{version}/#{action}"
@@ -187,5 +190,9 @@ module Adyen
187
190
  def marketpay
188
191
  @marketpay ||= Adyen::Marketpay::Marketpay.new(self)
189
192
  end
193
+
194
+ def postfmapi
195
+ @postfmapi ||= Adyen::PosTerminalManagement.new(self)
196
+ end
190
197
  end
191
198
  end
@@ -21,6 +21,10 @@ module Adyen
21
21
  def notification
22
22
  @notification ||= Adyen::Marketpay::Notification.new(@client)
23
23
  end
24
+
25
+ def hop
26
+ @hop ||= Adyen::Marketpay::Hop.new(@client)
27
+ end
24
28
  end
25
29
 
26
30
  class Account < Service
@@ -88,5 +92,19 @@ module Adyen
88
92
  super(client, version, service, method_names)
89
93
  end
90
94
  end
95
+
96
+ class Hop < Service
97
+ attr_accessor :version
98
+ DEFAULT_VERSION = 1
99
+
100
+ def initialize(client, version = DEFAULT_VERSION)
101
+ service = 'Hop'
102
+ method_names = [
103
+ :get_onboarding_url
104
+ ]
105
+
106
+ super(client, version, service, method_names)
107
+ end
108
+ end
91
109
  end
92
110
  end
@@ -0,0 +1,19 @@
1
+ require_relative 'service'
2
+
3
+ module Adyen
4
+ class PosTerminalManagement < Service
5
+ attr_accessor :version
6
+ DEFAULT_VERSION = 1
7
+
8
+ def initialize(client, version = DEFAULT_VERSION)
9
+ service = 'Terminal'
10
+ method_names = [
11
+ :assign_terminals,
12
+ :find_terminal,
13
+ :get_terminals_under_account
14
+ ]
15
+
16
+ super(client, version, service, method_names)
17
+ end
18
+ end
19
+ end
data/lib/adyen/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Adyen
2
2
  NAME = "adyen-ruby-api-library"
3
- VERSION = "4.0.2".freeze
3
+ VERSION = "4.1.0".freeze
4
4
  end
data/spec/hop_spec.rb ADDED
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Adyen::Payments, service: "marketpay hop service" do
4
+ # client instance to be used in dynamically generated tests
5
+ client = create_client(:basic)
6
+
7
+ # methods / values to test for
8
+ # format is defined in spec_helper
9
+ test_sets = [
10
+ ["get_onboarding_url", "pspReference", "8815850625171183"]
11
+ ]
12
+
13
+ generate_tests(client, "Hop", test_sets, client.marketpay.hop)
14
+ end
@@ -0,0 +1,4 @@
1
+ {
2
+ "accountHolderCode": "YourUniqueAccountHolderCode",
3
+ "returnUrl": "https://your.return-url.com/?submerchant=123"
4
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "companyAccount": "TestCompany",
3
+ "merchantAccount": "TestMerchant",
4
+ "merchantInventory": false,
5
+ "terminals": ["e285-123456789"]
6
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "terminal": "e285-123456789"
3
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "companyAccount" : "TestCompany",
3
+ "merchantAccount" : "TestMerchant"
4
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "pspReference": "8815850625171183",
3
+ "resultCode": "Success",
4
+ "submittedAsync": "false",
5
+ "invalidFields": [],
6
+ "redirectUrl": "https://hop-test.adyen.com/hop/view/?token=BQABAQANDBQftSiV8pqlYYFRjIZmBIhE3Ls%2FgdLQ3kcTbflt4FDPves0B9kq7aSZUqKwRciwBEN3PX23ZPqGmYXTb7QklLY5YdEXvUdEgtFnJl9uDWK09texQ3djnTPW6JKrok5svw%2FGZyGHqF1NAbuqPPPLF8o5Jzzri8AqyQKig%2BtMmEibuCuZrIvMbJjcINfDk0OBHir8bNjHgMGFiDBOXdkiww%2FB1VXP2MMqSB1yqcXiKL1o%2B12czdB9wJ5wwsQLGlcuE2Z0%2BZNIQL3MdRomkphpkIWBPFN9YmyGS0Wel6trve6ghBl4q4e1C%2B9BMQKc4P0jrC9FrkBZvhtBYoN%2BfUfrEDbgXpXjXYa1tlfU53XoD%2FsAAA1n2PuQSyfTxEf8qpwAcB9oDN%2BrbpwxYwIk42kCGztAQShTwZzx%2B4VifKpjBdtHA4bSHEqOzGPvpQ6bk4viluLn9Ealv0ylf%2FC3w%2BZCmThg8%2B2EIiABmMK8Jbfijl%2FM%2FqE43F0QN9SveJjwkN5IYGra5QbErUdAPDMfDksPjy%2FY8j%2B2XT1kMwSOLbWTCfhP%2FM%2F68Ll50RuhfJOkgfdP%2BfSxbK9i9uAmEsJ980cABWPpB4MH27asGfZ17mCM3TavaiI9d9Gs3X1HIoEZehFKWEhoaGsEaoSBQ6ut6VnZoOCCBsvssg9aqi1LJKpwwWg4CjS9Ygrw1dnSYjyFO2HeKGXf4TUS7DSCF7tpUJlBen69Xaqbwg%2BHfNfmgcCoZwSgvg%3D%3D"
7
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "results": {
3
+ "e285-123456789": "Done"
4
+ }
5
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "companyAccount": "TestCompany",
3
+ "merchantAccount": "TestMerchant",
4
+ "merchantInventory": false,
5
+ "terminal": "e285-123456789"
6
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "companyAccount": "TestCompany",
3
+ "merchantAccounts": [
4
+ {
5
+ "merchantAccount": "TestMerchant",
6
+ "inStoreTerminals": [
7
+ "P400Plus-123456789"
8
+ ]
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,16 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Adyen::PosTerminalManagement, service: "POS Terminal Management service" do
4
+ # client instance to be used in dynamically generated tests
5
+ client = create_client(:basic)
6
+
7
+ # methods / values to test for
8
+ # format is defined in spec_helper
9
+ test_sets = [
10
+ ["find_terminal", "merchantAccount", "TestMerchant"],
11
+ ["get_terminals_under_account", "merchantAccounts", [{ "merchantAccount" => "TestMerchant", "inStoreTerminals" => ["P400Plus-123456789"] }]],
12
+ ["assign_terminals", "results", { "e285-123456789" => "Done" }]
13
+ ]
14
+
15
+ generate_tests(client, "Terminal", test_sets, client.postfmapi)
16
+ end
data/spec/service_spec.rb CHANGED
@@ -38,6 +38,7 @@ RSpec.describe Adyen::Service do
38
38
  expect(described_class.action_for_method_name(:update_account_holder)).to eq 'updateAccountHolder'
39
39
  expect(described_class.action_for_method_name(:update_account_holder_state)).to eq 'updateAccountHolderState'
40
40
  expect(described_class.action_for_method_name(:upload_document)).to eq 'uploadDocument'
41
+ expect(described_class.action_for_method_name(:get_onboarding_url)).to eq 'getOnboardingUrl'
41
42
  end
42
43
  end
43
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adyen-ruby-api-library
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-11 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -112,6 +112,7 @@ files:
112
112
  - lib/adyen/services/marketpay.rb
113
113
  - lib/adyen/services/payments.rb
114
114
  - lib/adyen/services/payouts.rb
115
+ - lib/adyen/services/postfmapi.rb
115
116
  - lib/adyen/services/recurring.rb
116
117
  - lib/adyen/services/service.rb
117
118
  - lib/adyen/utils/hmac_validator.rb
@@ -124,6 +125,7 @@ files:
124
125
  - spec/errors_spec.rb
125
126
  - spec/fund_spec.rb
126
127
  - spec/hash_with_accessors_spec.rb
128
+ - spec/hop_spec.rb
127
129
  - spec/mocks/requests/Account/close_account.json
128
130
  - spec/mocks/requests/Account/close_account_holder.json
129
131
  - spec/mocks/requests/Account/create_account.json
@@ -152,6 +154,7 @@ files:
152
154
  - spec/mocks/requests/Fund/refund_not_paid_out_transfers.json
153
155
  - spec/mocks/requests/Fund/setup_beneficiary.json
154
156
  - spec/mocks/requests/Fund/transfer_funds.json
157
+ - spec/mocks/requests/Hop/get_onboarding_url.json
155
158
  - spec/mocks/requests/Notification/create_notification_configuration.json
156
159
  - spec/mocks/requests/Notification/delete_notification_configurations.json
157
160
  - spec/mocks/requests/Notification/get_notification_configuration.json
@@ -174,6 +177,9 @@ files:
174
177
  - spec/mocks/requests/Recurring/disable.json
175
178
  - spec/mocks/requests/Recurring/list_recurring_details.json
176
179
  - spec/mocks/requests/Recurring/store_token.json
180
+ - spec/mocks/requests/Terminal/assign_terminals.json
181
+ - spec/mocks/requests/Terminal/find_terminal.json
182
+ - spec/mocks/requests/Terminal/get_terminals_under_account.json
177
183
  - spec/mocks/responses/Account/close_account.json
178
184
  - spec/mocks/responses/Account/close_account_holder.json
179
185
  - spec/mocks/responses/Account/create_account.json
@@ -202,6 +208,7 @@ files:
202
208
  - spec/mocks/responses/Fund/refund_not_paid_out_transfers.json
203
209
  - spec/mocks/responses/Fund/setup_beneficiary.json
204
210
  - spec/mocks/responses/Fund/transfer_funds.json
211
+ - spec/mocks/responses/Hop/get_onboarding_url.json
205
212
  - spec/mocks/responses/Notification/create_notification_configuration.json
206
213
  - spec/mocks/responses/Notification/delete_notification_configurations.json
207
214
  - spec/mocks/responses/Notification/get_notification_configuration.json
@@ -224,9 +231,13 @@ files:
224
231
  - spec/mocks/responses/Recurring/disable.json
225
232
  - spec/mocks/responses/Recurring/list_recurring_details.json
226
233
  - spec/mocks/responses/Recurring/store_token.json
234
+ - spec/mocks/responses/Terminal/assign_terminals.json
235
+ - spec/mocks/responses/Terminal/find_terminal.json
236
+ - spec/mocks/responses/Terminal/get_terminals_under_account.json
227
237
  - spec/notification_spec.rb
228
238
  - spec/payments_spec.rb
229
239
  - spec/payouts_spec.rb
240
+ - spec/postfmapi_spec.rb
230
241
  - spec/recurring_spec.rb
231
242
  - spec/service_spec.rb
232
243
  - spec/spec_helper.rb