Skip to content

Commit 42cb7e4

Browse files
committed
Intoduce API_PAYMENT_VERSION and API_PAYOUT_VERSION deprecate API_VERSION
1 parent 768c84b commit 42cb7e4

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

Adyen/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ def _determine_api_url(self, platform, service, action):
105105
base_uri = settings.BASE_PAL_URL.format(platform)
106106
if service == "Recurring":
107107
api_version = settings.API_RECURRING_VERSION
108-
else:
108+
elif service == "Payout":
109109
api_version = settings.API_PAYOUT_VERSION
110+
else:
111+
api_version = settings.API_PAYMENT_VERSION
110112
return '/'.join([base_uri, service, api_version, action])
111113

112114
def _determine_hpp_url(self, platform, action):

Adyen/settings.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55
".adyenpayments.com/checkout"
66
API_CHECKOUT_VERSION = "v40"
77
API_CHECKOUT_UTILITY_VERSION = "v1"
8-
API_PAYOUT_VERSION = "v30"
98
API_RECURRING_VERSION = "v25"
9+
API_PAYMENT_VERSION = "v30"
10+
API_PAYOUT_VERSION = "v30"
1011

11-
12-
@property
13-
def API_VERSION():
14-
import warnings
15-
warnings.warn("this constant is deprecated use API_PAYOUT_VERSION",
16-
DeprecationWarning)
17-
return "v30"
12+
# Deprecated
13+
API_VERSION = "v30"

test/CheckoutUtilityTest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import unittest
33
from BaseTest import BaseTest
44

5+
from Adyen import settings
6+
57

68
class TestCheckoutUtility(unittest.TestCase):
79
ady = Adyen.Adyen()
@@ -20,6 +22,7 @@ def test_origin_keys_success_mocked(self):
2022
"https://www.your-domain3.com"
2123
}
2224
}
25+
2326
self.ady.client = self.test.create_client_from_file(200, request,
2427
"test/mocks/"
2528
"checkoututility/"

0 commit comments

Comments
 (0)