Skip to content

Commit

Permalink
removed and adjusted test after removal of classic sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
DjoykeAbyah committed Nov 11, 2024
1 parent 934b831 commit 5a80654
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 72 deletions.
71 changes: 1 addition & 70 deletions test/CheckoutTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestCheckout(unittest.TestCase):
test = BaseTest(adyen)
client.xapikey = "YourXapikey"
client.platform = "test"
baseUrl = adyen.checkout.classic_checkout_sdk_api.baseUrl
baseUrl = adyen.checkout.payments_api.baseUrl
lib_version = settings.LIB_VERSION

def test_payment_methods_success_mocked(self):
Expand Down Expand Up @@ -165,75 +165,6 @@ def test_payments_details_error_mocked(self):
self.assertEqual("Invalid card number", result.message['message'])
self.assertEqual("validation", result.message['errorType'])

def test_payments_session_success_mocked(self):
request = {"reference": "Your order number",
"shopperReference": "yourShopperId_IOfW3k9G2PvXFu2j",
"channel": "iOS",
"token": "TOKEN_YOU_GET_FROM_CHECKOUT_SDK",
"returnUrl": "app://", "countryCode": "NL",
"shopperLocale": "nl_NL",
"sessionValidity": "2017-04-06T13:09:13Z",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
'amount': {"value": "17408", "currency": "EUR"}}

self.adyen.client = self.test.create_client_from_file(200, request,
"test/mocks/"
"checkout/"
"paymentsession"
"-success.json")
result = self.adyen.checkout.classic_checkout_sdk_api.payment_session(request)
self.assertIsNotNone(result.message['paymentSession'])

def test_payments_session_error_mocked(self):
request = {"reference": "Your wro order number",
"shopperReference": "yourShopperId_IOfW3k9G2PvXFu2j",
"channel": "iOS",
"token": "WRONG_TOKEN",
"returnUrl": "app://", "countryCode": "NL",
"shopperLocale": "nl_NL",
"sessionValidity": "2017-04-06T13:09:13Z",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
'amount': {"value": "17408", "currency": "EUR"}}

self.adyen.client = self.test.create_client_from_file(200, request,
"test/mocks/"
"checkout/"
"paymentsession"
"-error-invalid-"
"data-422.json")
result = self.adyen.checkout.classic_checkout_sdk_api.payment_session(request)
self.assertEqual(422, result.message['status'])
self.assertEqual("14_012", result.message['errorCode'])
self.assertEqual("The provided SDK token could not be parsed.",
result.message['message'])
self.assertEqual("validation", result.message['errorType'])

def test_payments_result_success_mocked(self):
request = {"payload": "VALUE_YOU_GET_FROM_CHECKOUT_SDK"}
self.adyen.client = self.test.create_client_from_file(200, request,
"test/mocks/"
"checkout/"
"paymentsresult"
"-success.json")
result = self.adyen.checkout.classic_checkout_sdk_api.verify_payment_result(request)
self.assertEqual("8535253563623704", result.message['pspReference'])
self.assertEqual("Authorised", result.message['resultCode'])

def test_payments_result_error_mocked(self):
request = {"payload": "VALUE_YOU_GET_FROM_CHECKOUT_SDK"}
self.adyen.client = self.test.create_client_from_file(200, request,
"test/mocks/"
"checkout/"
"paymentsresult"
"-error-invalid-"
"data-payload-"
"422.json")
result = self.adyen.checkout.classic_checkout_sdk_api.verify_payment_result(request)
self.assertEqual(422, result.message['status'])
self.assertEqual("14_018", result.message['errorCode'])
self.assertEqual("Invalid payload provided", result.message['message'])
self.assertEqual("validation", result.message['errorType'])

def test_payments_cancels_without_reference(self):
requests = {
"paymentReference": "Payment123",
Expand Down
2 changes: 1 addition & 1 deletion test/CheckoutUtilityTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestCheckoutUtility(unittest.TestCase):
test = BaseTest(ady)
client.xapikey = "YourXapikey"
client.platform = "test"
checkout_url = ady.checkout.classic_checkout_sdk_api.baseUrl
checkout_url = ady.checkout.utility_api.baseUrl

def test_origin_keys_success_mocked(self):
request = {
Expand Down
2 changes: 1 addition & 1 deletion test/DetermineEndpointTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestDetermineUrl(unittest.TestCase):
client = adyen.client
test = BaseTest(adyen)
client.xapikey = "YourXapikey"
checkout_url = adyen.checkout.classic_checkout_sdk_api.baseUrl
checkout_url = adyen.checkout.payments_api.baseUrl
checkout_version = checkout_url.split('/')[-1]
payment_url = adyen.payment.payments_api.baseUrl
payment_version = payment_url.split('/')[-1]
Expand Down

0 comments on commit 5a80654

Please sign in to comment.