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 +4 -4
- data/VERSION +1 -1
- data/lib/adyen/services/checkout.rb +0 -5
- data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +9 -0
- data/lib/adyen/version.rb +1 -1
- data/spec/checkout-oauth_spec.rb +0 -33
- data/spec/checkout_spec.rb +0 -36
- metadata +2 -3
- data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2865a115b0e79760a1474e7b831bfdbb1ae7763fdac6b0a91776fa00c9157c8d
|
4
|
+
data.tar.gz: db6c5efbb981585a354ca660c03405b0bc565584a47d5dfed18f885108a33fe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 167c6d4fce56baa7d0e2bbd6671e62d50f192c2f23ec36f585878eb8b9749fe00ab496317f914a155d6b9c4516d33fa641dc1d99860c1f5788e9ba6cd8571eaa
|
7
|
+
data.tar.gz: b4039cbd29e30ee35a9fdea3c937f189a9fbd6984f522c7dd0357e2adc2c1e91db03e554e9852b9bbfe481f41afd9d86e1355d2b0de6d4afc8dc0cec81f31a82
|
data/VERSION
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
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
data/spec/checkout-oauth_spec.rb
CHANGED
@@ -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"))
|
data/spec/checkout_spec.rb
CHANGED
@@ -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:
|
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-
|
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
|