Skip to content

Commit fa38148

Browse files
Update all services (#341)
* false[adyen-sdk-automation] automated change * removed and adjusted test after removal of classic sdk --------- Co-authored-by: Djoyke Reijans <[email protected]>
1 parent 61f9194 commit fa38148

File tree

6 files changed

+11
-109
lines changed

6 files changed

+11
-109
lines changed

Adyen/services/checkout/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from ..base import AdyenServiceBase
2-
from .classic_checkout_sdk_api import ClassicCheckoutSDKApi
32
from .donations_api import DonationsApi
43
from .modifications_api import ModificationsApi
54
from .orders_api import OrdersApi
@@ -18,7 +17,6 @@ class AdyenCheckoutApi(AdyenServiceBase):
1817

1918
def __init__(self, client=None):
2019
super(AdyenCheckoutApi, self).__init__(client=client)
21-
self.classic_checkout_sdk_api = ClassicCheckoutSDKApi(client=client)
2220
self.donations_api = DonationsApi(client=client)
2321
self.modifications_api = ModificationsApi(client=client)
2422
self.orders_api = OrdersApi(client=client)

Adyen/services/checkout/classic_checkout_sdk_api.py

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

Adyen/services/legalEntityManagement/terms_of_service_api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ def accept_terms_of_service(self, request, id, termsofservicedocumentid, idempot
2121
method = "PATCH"
2222
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
2323

24+
def get_accepted_terms_of_service_document(self, id, termsofserviceacceptancereference, idempotency_key=None, **kwargs):
25+
"""
26+
Get accepted Terms of Service document
27+
"""
28+
endpoint = self.baseUrl + f"/legalEntities/{id}/acceptedTermsOfServiceDocument/{termsofserviceacceptancereference}"
29+
method = "GET"
30+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
31+
2432
def get_terms_of_service_document(self, request, id, idempotency_key=None, **kwargs):
2533
"""
2634
Get Terms of Service document

test/CheckoutTest.py

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TestCheckout(unittest.TestCase):
1515
test = BaseTest(adyen)
1616
client.xapikey = "YourXapikey"
1717
client.platform = "test"
18-
baseUrl = adyen.checkout.classic_checkout_sdk_api.baseUrl
18+
baseUrl = adyen.checkout.payments_api.baseUrl
1919
lib_version = settings.LIB_VERSION
2020

2121
def test_payment_methods_success_mocked(self):
@@ -165,75 +165,6 @@ def test_payments_details_error_mocked(self):
165165
self.assertEqual("Invalid card number", result.message['message'])
166166
self.assertEqual("validation", result.message['errorType'])
167167

168-
def test_payments_session_success_mocked(self):
169-
request = {"reference": "Your order number",
170-
"shopperReference": "yourShopperId_IOfW3k9G2PvXFu2j",
171-
"channel": "iOS",
172-
"token": "TOKEN_YOU_GET_FROM_CHECKOUT_SDK",
173-
"returnUrl": "app://", "countryCode": "NL",
174-
"shopperLocale": "nl_NL",
175-
"sessionValidity": "2017-04-06T13:09:13Z",
176-
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
177-
'amount': {"value": "17408", "currency": "EUR"}}
178-
179-
self.adyen.client = self.test.create_client_from_file(200, request,
180-
"test/mocks/"
181-
"checkout/"
182-
"paymentsession"
183-
"-success.json")
184-
result = self.adyen.checkout.classic_checkout_sdk_api.payment_session(request)
185-
self.assertIsNotNone(result.message['paymentSession'])
186-
187-
def test_payments_session_error_mocked(self):
188-
request = {"reference": "Your wro order number",
189-
"shopperReference": "yourShopperId_IOfW3k9G2PvXFu2j",
190-
"channel": "iOS",
191-
"token": "WRONG_TOKEN",
192-
"returnUrl": "app://", "countryCode": "NL",
193-
"shopperLocale": "nl_NL",
194-
"sessionValidity": "2017-04-06T13:09:13Z",
195-
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
196-
'amount': {"value": "17408", "currency": "EUR"}}
197-
198-
self.adyen.client = self.test.create_client_from_file(200, request,
199-
"test/mocks/"
200-
"checkout/"
201-
"paymentsession"
202-
"-error-invalid-"
203-
"data-422.json")
204-
result = self.adyen.checkout.classic_checkout_sdk_api.payment_session(request)
205-
self.assertEqual(422, result.message['status'])
206-
self.assertEqual("14_012", result.message['errorCode'])
207-
self.assertEqual("The provided SDK token could not be parsed.",
208-
result.message['message'])
209-
self.assertEqual("validation", result.message['errorType'])
210-
211-
def test_payments_result_success_mocked(self):
212-
request = {"payload": "VALUE_YOU_GET_FROM_CHECKOUT_SDK"}
213-
self.adyen.client = self.test.create_client_from_file(200, request,
214-
"test/mocks/"
215-
"checkout/"
216-
"paymentsresult"
217-
"-success.json")
218-
result = self.adyen.checkout.classic_checkout_sdk_api.verify_payment_result(request)
219-
self.assertEqual("8535253563623704", result.message['pspReference'])
220-
self.assertEqual("Authorised", result.message['resultCode'])
221-
222-
def test_payments_result_error_mocked(self):
223-
request = {"payload": "VALUE_YOU_GET_FROM_CHECKOUT_SDK"}
224-
self.adyen.client = self.test.create_client_from_file(200, request,
225-
"test/mocks/"
226-
"checkout/"
227-
"paymentsresult"
228-
"-error-invalid-"
229-
"data-payload-"
230-
"422.json")
231-
result = self.adyen.checkout.classic_checkout_sdk_api.verify_payment_result(request)
232-
self.assertEqual(422, result.message['status'])
233-
self.assertEqual("14_018", result.message['errorCode'])
234-
self.assertEqual("Invalid payload provided", result.message['message'])
235-
self.assertEqual("validation", result.message['errorType'])
236-
237168
def test_payments_cancels_without_reference(self):
238169
requests = {
239170
"paymentReference": "Payment123",

test/CheckoutUtilityTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TestCheckoutUtility(unittest.TestCase):
1515
test = BaseTest(ady)
1616
client.xapikey = "YourXapikey"
1717
client.platform = "test"
18-
checkout_url = ady.checkout.classic_checkout_sdk_api.baseUrl
18+
checkout_url = ady.checkout.utility_api.baseUrl
1919

2020
def test_origin_keys_success_mocked(self):
2121
request = {

test/DetermineEndpointTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TestDetermineUrl(unittest.TestCase):
1616
client = adyen.client
1717
test = BaseTest(adyen)
1818
client.xapikey = "YourXapikey"
19-
checkout_url = adyen.checkout.classic_checkout_sdk_api.baseUrl
19+
checkout_url = adyen.checkout.payments_api.baseUrl
2020
checkout_version = checkout_url.split('/')[-1]
2121
payment_url = adyen.payment.payments_api.baseUrl
2222
payment_version = payment_url.split('/')[-1]

0 commit comments

Comments
 (0)