Skip to content

Commit 219817e

Browse files
Merge pull request #111 from Adyen/develop
Release 3.0.0
2 parents 04ffb98 + e269c0e commit 219817e

15 files changed

+44
-44
lines changed

Adyen/client.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self, username=None, password=None, xapikey=None,
7171
store_payout_username=None, store_payout_password=None,
7272
platform="test", merchant_account=None,
7373
merchant_specific_url=None, skin_code=None,
74-
hmac=None, app_name="",
74+
hmac=None,
7575
http_force=None, live_endpoint_prefix=None):
7676
self.username = username
7777
self.password = password
@@ -86,7 +86,6 @@ def __init__(self, username=None, password=None, xapikey=None,
8686
self.merchant_account = merchant_account
8787
self.skin_code = skin_code
8888
self.psp_list = []
89-
self.app_name = app_name
9089
self.LIB_VERSION = settings.LIB_VERSION
9190
self.USER_AGENT_SUFFIX = settings.LIB_NAME + "/"
9291
self.http_init = False
@@ -108,6 +107,8 @@ def _determine_api_url(platform, service, action):
108107
api_version = settings.API_RECURRING_VERSION
109108
elif service == "Payout":
110109
api_version = settings.API_PAYOUT_VERSION
110+
elif service == "BinLookup":
111+
api_version = settings.API_BIN_LOOKUP_VERSION
111112
else:
112113
api_version = settings.API_PAYMENT_VERSION
113114
return '/'.join([base_uri, service, api_version, action])
@@ -219,8 +220,7 @@ def call_api(self, request_data, service, action, idempotency=False,
219220
succesful.
220221
"""
221222
if not self.http_init:
222-
self.http_client = HTTPClient(self.app_name,
223-
self.USER_AGENT_SUFFIX,
223+
self.http_client = HTTPClient(self.USER_AGENT_SUFFIX,
224224
self.LIB_VERSION,
225225
self.http_force)
226226
self.http_init = True
@@ -358,8 +358,7 @@ def call_hpp(self, message, action, hmac_key="", **kwargs):
358358
:param hmac_key:
359359
"""
360360
if not self.http_init:
361-
self.http_client = HTTPClient(self.app_name,
362-
self.USER_AGENT_SUFFIX,
361+
self.http_client = HTTPClient(self.USER_AGENT_SUFFIX,
363362
self.LIB_VERSION,
364363
self.http_force)
365364
self.http_init = True
@@ -423,8 +422,7 @@ def call_checkout_api(self, request_data, action, **kwargs):
423422
action (str): The specific action of the API service to be called
424423
"""
425424
if not self.http_init:
426-
self.http_client = HTTPClient(self.app_name,
427-
self.USER_AGENT_SUFFIX,
425+
self.http_client = HTTPClient(self.USER_AGENT_SUFFIX,
428426
self.LIB_VERSION,
429427
self.http_force)
430428
self.http_init = True
@@ -495,8 +493,7 @@ def call_checkout_api(self, request_data, action, **kwargs):
495493
def hpp_payment(self, request_data, action, hmac_key="", **kwargs):
496494

497495
if not self.http_init:
498-
self.http_client = HTTPClient(self.app_name,
499-
self.USER_AGENT_SUFFIX,
496+
self.http_client = HTTPClient(self.USER_AGENT_SUFFIX,
500497
self.LIB_VERSION,
501498
self.http_force)
502499
self.http_init = True

Adyen/httpclient.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@
3535

3636

3737
class HTTPClient(object):
38-
def __init__(self, app_name, user_agent_suffix,
39-
lib_version, force_request=None):
38+
def __init__(self, user_agent_suffix, lib_version, force_request=None):
4039
# Check if requests already available, default to urllib
41-
self.user_agent = app_name + " " + user_agent_suffix + lib_version
42-
# In case the app_name is empty
43-
self.user_agent = self.user_agent.strip()
40+
self.user_agent = user_agent_suffix + lib_version
4441
if not force_request:
4542
if requests:
4643
self.request = self._requests_post

Adyen/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class AdyenBase(object):
99
def __setattr__(self, attr, value):
10-
client_attr = ["username", "password", "platform", "app_name"]
10+
client_attr = ["username", "password", "platform"]
1111
if attr in client_attr:
1212
if value:
1313
self.client[attr] = value

Adyen/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
ENDPOINT_CHECKOUT_TEST = "https://checkout-test.adyen.com"
55
ENDPOINT_CHECKOUT_LIVE_SUFFIX = "https://{}-checkout-live" \
66
".adyenpayments.com/checkout"
7+
API_BIN_LOOKUP_VERSION = "v50"
78
API_CHECKOUT_VERSION = "v49"
89
API_CHECKOUT_UTILITY_VERSION = "v1"
910
API_RECURRING_VERSION = "v25"
1011
API_PAYMENT_VERSION = "v49"
1112
API_PAYOUT_VERSION = "v30"
12-
LIB_VERSION = "2.3.0"
13+
LIB_VERSION = "3.0.0"
1314
LIB_NAME = "adyen-python-api-library"

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ ady.payment.client.hmac = "HMAC key for skin code"
4747
ady.payment.client.platform = "test" # Environment to use the library in.
4848
ady.payment.client.merchant_account = "merchant account name from CA"
4949
ady.payment.client.password = "webservice user password"
50-
ady.payment.client.app_name = "your app name"
5150
```
5251

5352
## Documentation

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name='Adyen',
55
packages=['Adyen'],
6-
version='2.3.0',
6+
version='3.0.0',
77
maintainer='Adyen',
88
maintainer_email='support@adyen.com',
99
description='Adyen Python Api',

test/CheckoutTest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class TestCheckout(unittest.TestCase):
1414
test = BaseTest(adyen)
1515
client.xapikey = "YourXapikey"
1616
client.platform = "test"
17-
client.app_name = "appname"
1817

1918
def test_payment_methods_success_mocked(self):
2019
request = {'merchantAccount': "YourMerchantAccount"}

test/CheckoutUtilityTest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class TestCheckoutUtility(unittest.TestCase):
1515
test = BaseTest(ady)
1616
client.xapikey = "YourXapikey"
1717
client.platform = "test"
18-
client.app_name = "appname"
1918

2019
def test_origin_keys_success_mocked(self):
2120
request = {

test/DetermineEndpointTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class TestDetermineUrl(unittest.TestCase):
1515
client = adyen.client
1616
test = BaseTest(adyen)
1717
client.xapikey = "YourXapikey"
18-
client.app_name = "appname"
1918

2019
def test_checkout_api_url_custom(self):
2120
self.client.live_endpoint_prefix = "1797a841fbb37ca7-AdyenDemo"
@@ -50,6 +49,7 @@ def test_payments_invalid_platform(self):
5049

5150
self.client.platform = "live"
5251
self.client.live_endpoint_prefix = None
52+
5353
try:
5454
self.adyen.checkout.payments(request)
5555
except AdyenEndpointInvalidFormat as error:

test/DirectoryLookupTest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class TestDirectoryLookup(unittest.TestCase):
2020
client.platform = "test"
2121
client.hmac = "DFB1EB5485895CFA84146406857104A" \
2222
"BB4CBCABDC8AAF103A624C8F6A3EAAB00"
23-
client.app_name = "appname"
2423

2524
def test_get_post_parameters(self):
2625
request = {

0 commit comments

Comments
 (0)