adyen-ruby-api-library 9.9.0 → 10.0.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: 1ef3a90aa8ea0a335d165930451be4eb77cfd6514391883420bae5d1ba3a8ff6
4
- data.tar.gz: 8fe108f6f5937d50971a446cbebeab82f867ed97318453534891d962930d7d33
3
+ metadata.gz: 2865a115b0e79760a1474e7b831bfdbb1ae7763fdac6b0a91776fa00c9157c8d
4
+ data.tar.gz: db6c5efbb981585a354ca660c03405b0bc565584a47d5dfed18f885108a33fe9
5
5
  SHA512:
6
- metadata.gz: 44565077d05a1836a79b608a74dbf1de8c348e629b68d6c7001415fc1257a03ac9f24d5b982f9434f511695524557345b73b7a35391f733f01e997a30483d112
7
- data.tar.gz: ccd923da598991c3d3fbbb1bd6ca639173b5e5e342b63d7137dbb579315f08cdaac92be53328ba08031cafbf7297c028c5ff7f420a8039e4cec76811cf926325
6
+ metadata.gz: 167c6d4fce56baa7d0e2bbd6671e62d50f192c2f23ec36f585878eb8b9749fe00ab496317f914a155d6b9c4516d33fa641dc1d99860c1f5788e9ba6cd8571eaa
7
+ data.tar.gz: b4039cbd29e30ee35a9fdea3c937f189a9fbd6984f522c7dd0357e2adc2c1e91db03e554e9852b9bbfe481f41afd9d86e1355d2b0de6d4afc8dc0cec81f31a82
data/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- 9.9.0
1
+ 10.0.0
2
2
 
@@ -1,4 +1,3 @@
1
- require_relative 'checkout/classic_checkout_sdk_api'
2
1
  require_relative 'checkout/donations_api'
3
2
  require_relative 'checkout/modifications_api'
4
3
  require_relative 'checkout/orders_api'
@@ -18,10 +17,6 @@ module Adyen
18
17
  @version = version
19
18
  end
20
19
 
21
- def classic_checkout_sdk_api
22
- @classic_checkout_sdk_api ||= Adyen::ClassicCheckoutSDKApi.new(@client, @version)
23
- end
24
-
25
20
  def donations_api
26
21
  @donations_api ||= Adyen::DonationsApi.new(@client, @version)
27
22
  end
@@ -16,6 +16,15 @@ module Adyen
16
16
  @client.call_adyen_api(@service, action, request, headers, @version)
17
17
  end
18
18
 
19
+ def get_accepted_terms_of_service_document(id, termsofserviceacceptancereference, headers: {}, query_params: {})
20
+ endpoint = '/legalEntities/{id}/acceptedTermsOfServiceDocument/{termsofserviceacceptancereference}'.gsub(/{.+?}/, '%s')
21
+ endpoint = endpoint.gsub(%r{^/}, '')
22
+ endpoint = format(endpoint, id, termsofserviceacceptancereference)
23
+ endpoint += create_query_string(query_params)
24
+ action = { method: 'get', url: endpoint }
25
+ @client.call_adyen_api(@service, action, {}, headers, @version)
26
+ end
27
+
19
28
  def get_terms_of_service_document(request, id, headers: {})
20
29
  endpoint = '/legalEntities/{id}/termsOfService'.gsub(/{.+?}/, '%s')
21
30
  endpoint = endpoint.gsub(%r{^/}, '')
data/lib/adyen/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Adyen
2
2
  NAME = 'adyen-ruby-api-library'.freeze
3
- VERSION = '9.9.0'.freeze
3
+ VERSION = '10.0.0'.freeze
4
4
  end
@@ -105,39 +105,6 @@ RSpec.describe "Adyen::Checkout OAuth authentication", service: "checkout" do
105
105
  to eq("RedirectShopper")
106
106
  end
107
107
 
108
- # must be created manually due to payments/result format
109
- it "makes a payments/result call" do
110
- request_body = JSON.parse(json_from_file("mocks/requests/Checkout/payment-result.json"))
111
-
112
- response_body = json_from_file("mocks/responses/Checkout/payment-result.json")
113
-
114
- url = @shared_values[:client].service_url(@shared_values[:service], "payments/result", @shared_values[:client].checkout.version)
115
- WebMock.stub_request(:post, url).
116
- with(
117
- body: request_body,
118
- headers: @auth_header
119
- ).
120
- to_return(
121
- body: response_body
122
- )
123
-
124
- result = @shared_values[:client].checkout.classic_checkout_sdk_api.verify_payment_result(request_body)
125
- response_hash = result.response
126
-
127
- expect(result.status).
128
- to eq(200)
129
- expect(response_hash).
130
- to eq(JSON.parse(response_body))
131
- expect(response_hash).
132
- to be_a Adyen::HashWithAccessors
133
- expect(response_hash).
134
- to be_a_kind_of Hash
135
- expect(response_hash["resultCode"]).
136
- to eq("Authorised")
137
- expect(response_hash.resultCode).
138
- to eq("Authorised")
139
- end
140
-
141
108
  # must be created manually due to paymentsLinks format
142
109
  it "makes a paymentLinks call" do
143
110
  request_body = JSON.parse(json_from_file("mocks/requests/Checkout/payment_links.json"))
@@ -112,42 +112,6 @@ RSpec.describe Adyen::Checkout, service: 'checkout' do
112
112
  .to eq('RedirectShopper')
113
113
  end
114
114
 
115
- # must be created manually due to payments/result format
116
- it 'makes a payments/result call' do
117
- request_body = JSON.parse(json_from_file('mocks/requests/Checkout/payment-result.json'))
118
-
119
- response_body = json_from_file('mocks/responses/Checkout/payment-result.json')
120
-
121
- url = @shared_values[:client].service_url(@shared_values[:service], 'payments/result',
122
- @shared_values[:client].checkout.version)
123
- WebMock.stub_request(:post, url)
124
- .with(
125
- body: request_body,
126
- headers: {
127
- 'x-api-key' => @shared_values[:client].api_key
128
- }
129
- )
130
- .to_return(
131
- body: response_body
132
- )
133
-
134
- result = @shared_values[:client].checkout.classic_checkout_sdk_api.verify_payment_result(request_body)
135
- response_hash = result.response
136
-
137
- expect(result.status)
138
- .to eq(200)
139
- expect(response_hash)
140
- .to eq(JSON.parse(response_body))
141
- expect(response_hash)
142
- .to be_a Adyen::HashWithAccessors
143
- expect(response_hash)
144
- .to be_a_kind_of Hash
145
- expect(response_hash['resultCode'])
146
- .to eq('Authorised')
147
- expect(response_hash.resultCode)
148
- .to eq('Authorised')
149
- end
150
-
151
115
  # must be created manually due to paymentsLinks format
152
116
  it 'makes a paymentLinks call' do
153
117
  request_body = JSON.parse(json_from_file('mocks/requests/Checkout/payment_links.json'))
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: 9.9.0
4
+ version: 10.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-21 00:00:00.000000000 Z
11
+ date: 2024-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -124,7 +124,6 @@ files:
124
124
  - lib/adyen/services/balancePlatform/transfer_routes_api.rb
125
125
  - lib/adyen/services/binLookup.rb
126
126
  - lib/adyen/services/checkout.rb
127
- - lib/adyen/services/checkout/classic_checkout_sdk_api.rb
128
127
  - lib/adyen/services/checkout/donations_api.rb
129
128
  - lib/adyen/services/checkout/modifications_api.rb
130
129
  - lib/adyen/services/checkout/orders_api.rb
@@ -1,29 +0,0 @@
1
- require_relative '../service'
2
- module Adyen
3
- class ClassicCheckoutSDKApi < Service
4
- attr_accessor :service, :version
5
-
6
- def initialize(client, version = DEFAULT_VERSION)
7
- super(client, version, 'Checkout')
8
- end
9
-
10
- def payment_session(request, headers: {})
11
- endpoint = '/paymentSession'.gsub(/{.+?}/, '%s')
12
- endpoint = endpoint.gsub(%r{^/}, '')
13
- endpoint = format(endpoint)
14
-
15
- action = { method: 'post', url: endpoint }
16
- @client.call_adyen_api(@service, action, request, headers, @version)
17
- end
18
-
19
- def verify_payment_result(request, headers: {})
20
- endpoint = '/payments/result'.gsub(/{.+?}/, '%s')
21
- endpoint = endpoint.gsub(%r{^/}, '')
22
- endpoint = format(endpoint)
23
-
24
- action = { method: 'post', url: endpoint }
25
- @client.call_adyen_api(@service, action, request, headers, @version)
26
- end
27
-
28
- end
29
- end