Skip to content

Commit a1d3efa

Browse files
Update all services (#274)
* false[adyen-sdk-automation] automated change * removed classic sdk tests --------- Co-authored-by: Djoyke Reijans <[email protected]>
1 parent c8e2ff1 commit a1d3efa

File tree

5 files changed

+9
-103
lines changed

5 files changed

+9
-103
lines changed

lib/adyen/services/checkout.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
require_relative 'checkout/classic_checkout_sdk_api'
21
require_relative 'checkout/donations_api'
32
require_relative 'checkout/modifications_api'
43
require_relative 'checkout/orders_api'
@@ -18,10 +17,6 @@ def initialize(client, version = DEFAULT_VERSION)
1817
@version = version
1918
end
2019

21-
def classic_checkout_sdk_api
22-
@classic_checkout_sdk_api ||= Adyen::ClassicCheckoutSDKApi.new(@client, @version)
23-
end
24-
2520
def donations_api
2621
@donations_api ||= Adyen::DonationsApi.new(@client, @version)
2722
end

lib/adyen/services/checkout/classic_checkout_sdk_api.rb

Lines changed: 0 additions & 29 deletions
This file was deleted.

lib/adyen/services/legalEntityManagement/terms_of_service_api.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ def accept_terms_of_service(request, id, termsofservicedocumentid, headers: {})
1616
@client.call_adyen_api(@service, action, request, headers, @version)
1717
end
1818

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+
1928
def get_terms_of_service_document(request, id, headers: {})
2029
endpoint = '/legalEntities/{id}/termsOfService'.gsub(/{.+?}/, '%s')
2130
endpoint = endpoint.gsub(%r{^/}, '')

spec/checkout-oauth_spec.rb

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -105,39 +105,6 @@
105105
to eq("RedirectShopper")
106106
end
107107

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-
141108
# must be created manually due to paymentsLinks format
142109
it "makes a paymentLinks call" do
143110
request_body = JSON.parse(json_from_file("mocks/requests/Checkout/payment_links.json"))

spec/checkout_spec.rb

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -112,42 +112,6 @@
112112
.to eq('RedirectShopper')
113113
end
114114

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-
151115
# must be created manually due to paymentsLinks format
152116
it 'makes a paymentLinks call' do
153117
request_body = JSON.parse(json_from_file('mocks/requests/Checkout/payment_links.json'))

0 commit comments

Comments
 (0)