Skip to content

Commit 11e7a9f

Browse files
authored
Upgrade Checkout to v71 (#272)
* Upgrade Checkout to v71 * Update README.md * Fix commit link
1 parent 3e4cfcb commit 11e7a9f

File tree

10 files changed

+68
-50
lines changed

10 files changed

+68
-50
lines changed

.github/workflows/services.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- name: Set PR variables
1313
id: vars
1414
run: |
15+
cd build/spec
1516
echo ::set-output name=pr_title::"Update services"
1617
echo ::set-output name=pr_body::"OpenAPI spec or templates produced new services on $(date +%d-%m-%Y) \
1718
by [commit](https://github.com/Adyen/adyen-openapi/commit/$(git rev-parse HEAD))."

Adyen/services/checkout/classic_checkout_sdk_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ClassicCheckoutSDKApi(AdyenServiceBase):
1111
def __init__(self, client=None):
1212
super(ClassicCheckoutSDKApi, self).__init__(client=client)
1313
self.service = "checkout"
14-
self.baseUrl = "https://checkout-test.adyen.com/v70"
14+
self.baseUrl = "https://checkout-test.adyen.com/v71"
1515

1616
def payment_session(self, request, idempotency_key=None, **kwargs):
1717
"""

Adyen/services/checkout/modifications_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ModificationsApi(AdyenServiceBase):
1111
def __init__(self, client=None):
1212
super(ModificationsApi, self).__init__(client=client)
1313
self.service = "checkout"
14-
self.baseUrl = "https://checkout-test.adyen.com/v70"
14+
self.baseUrl = "https://checkout-test.adyen.com/v71"
1515

1616
def cancel_authorised_payment(self, request, idempotency_key=None, **kwargs):
1717
"""

Adyen/services/checkout/orders_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class OrdersApi(AdyenServiceBase):
1111
def __init__(self, client=None):
1212
super(OrdersApi, self).__init__(client=client)
1313
self.service = "checkout"
14-
self.baseUrl = "https://checkout-test.adyen.com/v70"
14+
self.baseUrl = "https://checkout-test.adyen.com/v71"
1515

1616
def orders(self, request, idempotency_key=None, **kwargs):
1717
"""

Adyen/services/checkout/payment_links_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PaymentLinksApi(AdyenServiceBase):
1111
def __init__(self, client=None):
1212
super(PaymentLinksApi, self).__init__(client=client)
1313
self.service = "checkout"
14-
self.baseUrl = "https://checkout-test.adyen.com/v70"
14+
self.baseUrl = "https://checkout-test.adyen.com/v71"
1515

1616
def get_payment_link(self, linkId, idempotency_key=None, **kwargs):
1717
"""

Adyen/services/checkout/payments_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PaymentsApi(AdyenServiceBase):
1111
def __init__(self, client=None):
1212
super(PaymentsApi, self).__init__(client=client)
1313
self.service = "checkout"
14-
self.baseUrl = "https://checkout-test.adyen.com/v70"
14+
self.baseUrl = "https://checkout-test.adyen.com/v71"
1515

1616
def get_result_of_payment_session(self, sessionId, idempotency_key=None, **kwargs):
1717
"""

Adyen/services/checkout/recurring_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class RecurringApi(AdyenServiceBase):
1111
def __init__(self, client=None):
1212
super(RecurringApi, self).__init__(client=client)
1313
self.service = "checkout"
14-
self.baseUrl = "https://checkout-test.adyen.com/v70"
14+
self.baseUrl = "https://checkout-test.adyen.com/v71"
1515

1616
def delete_token_for_stored_payment_details(self, storedPaymentMethodId, idempotency_key=None, **kwargs):
1717
"""

Adyen/services/checkout/utility_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class UtilityApi(AdyenServiceBase):
1111
def __init__(self, client=None):
1212
super(UtilityApi, self).__init__(client=client)
1313
self.service = "checkout"
14-
self.baseUrl = "https://checkout-test.adyen.com/v70"
14+
self.baseUrl = "https://checkout-test.adyen.com/v71"
1515

1616
def get_apple_pay_session(self, request, idempotency_key=None, **kwargs):
1717
"""

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ smallServices:=binlookup dataProtection recurring storedValue terminal disputes
2020
all: $(services) $(smallServices)
2121

2222
binlookup: spec=BinLookupService-v52
23-
checkout: spec=CheckoutService-v70
23+
checkout: spec=CheckoutService-v71
2424
dataProtection: spec=DataProtectionService-v1
2525
storedValue: spec=StoredValueService-v46
2626
terminal: spec=TfmAPIService-v1

README.md

Lines changed: 59 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
This is the officially supported Python library for using Adyen's APIs.
88

99
## Supported API versions
10+
1011
| API | Description | Service Name | Supported version |
1112
|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|-------------------|
1213
| [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/52/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | binLookup | **v52** |
1314
| [Balance Platform API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Balance Platform API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | balancePlatform | **v2** |
14-
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview) | Our latest integration for accepting online payments. | checkout | **v70** |
15+
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | Our latest integration for accepting online payments. | checkout | **v71** |
1516
| [Data Protection API](https://docs.adyen.com/development-resources/data-protection-api) | Endpoint for requesting data erasure. | dataProtection | **v1** |
1617
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | Endpoint to manage legal entities | legalEntityManagement | **v3** |
1718
| [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management | **v3** |
@@ -25,37 +26,33 @@ This is the officially supported Python library for using Adyen's APIs.
2526

2627
For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/).
2728

28-
29-
30-
31-
3229
## Prerequisites
3330

34-
- [Adyen test account](https://docs.adyen.com/get-started-with-adyen)
35-
- [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles).
31+
- [Adyen test account](https://docs.adyen.com/get-started-with-adyen)
32+
- [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles).
3633
- Python 3.6 or higher
3734
- Packages (optional): requests or pycurl
38-
3935

40-
## Installation
36+
## Installation
4137

42-
### For development purposes
38+
### For development purpose
4339

4440
Clone this repository and run
41+
4542
~~~~ bash
4643
make install
4744
~~~~
4845

49-
### For usage propose
46+
### For usage purpose
5047

5148
Use pip command:
49+
5250
~~~~ bash
5351
pip install Adyen
5452
~~~~
5553

5654
## Using the library
5755

58-
5956
### General use with API key
6057

6158
~~~~ python
@@ -67,84 +64,104 @@ adyen.payment.client.xapikey = "YourXapikey"
6764
adyen.payment.client.hmac = "YourHMACkey"
6865
adyen.payment.client.platform = "test" # Environment to use the library in.
6966
~~~~
67+
7068
### Consuming Services
69+
7170
Every API the library supports is represented by a service object. The name of the service matching the corresponding API is listed in the [Integrations](#supported-api-versions) section of this document.
71+
7272
#### Using all services
73+
7374
~~~~python
7475
import Adyen
76+
7577
adyen = Adyen.Adyen()
7678
adyen.payment.client.xapikey = "YourXapikey"
7779
adyen.payment.client.platform = "test" # change to live for production
7880
request = {
79-
"amount": {
81+
"amount": {
8082
"currency": "USD",
81-
"value": 1000 # value in minor units
82-
},
83-
"reference": "Your order number",
84-
"paymentMethod": {
83+
"value": 1000 # value in minor units
84+
},
85+
"reference": "Your order number",
86+
"paymentMethod": {
8587
"type": "visa",
8688
"encryptedCardNumber": "test_4111111111111111",
8789
"encryptedExpiryMonth": "test_03",
8890
"encryptedExpiryYear": "test_2030",
8991
"encryptedSecurityCode": "test_737"
90-
},
91-
"shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
92-
"returnUrl": "https://your-company.com/...",
93-
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
94-
}
92+
},
93+
"shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
94+
"returnUrl": "https://your-company.com/...",
95+
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
96+
}
9597
result = adyen.checkout.payments_api.payments(request)
9698
~~~~
99+
97100
#### Using one of the services
101+
98102
~~~~python
99103
from Adyen import checkout
104+
100105
checkout.client.xapikey = "YourXapikey"
101106
checkout.client.platform = "test" # change to live for production
102107
request = {
103-
"amount": {
108+
"amount": {
104109
"currency": "USD",
105-
"value": 1000 # value in minor units
106-
},
107-
"reference": "Your order number",
108-
"paymentMethod": {
110+
"value": 1000 # value in minor units
111+
},
112+
"reference": "Your order number",
113+
"paymentMethod": {
109114
"type": "visa",
110115
"encryptedCardNumber": "test_4111111111111111",
111116
"encryptedExpiryMonth": "test_03",
112117
"encryptedExpiryYear": "test_2030",
113118
"encryptedSecurityCode": "test_737"
114-
},
115-
"shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
116-
"returnUrl": "https://your-company.com/...",
117-
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
118-
}
119+
},
120+
"shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
121+
"returnUrl": "https://your-company.com/...",
122+
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
123+
}
119124
result = checkout.payments_api.payments(request)
120125
~~~~
126+
121127
#### Force HTTP library
128+
122129
~~~~python
123130
import Adyen
131+
124132
adyen = Adyen.Adyen()
125133
adyen.client.http_force = 'requests' # or 'pycurl'
126134
~~~~
135+
127136
### Using query parameters (management API only)
137+
128138
Define a dictionary with query parameters that you want to use.
139+
129140
~~~~ python
130141
query_parameters = {
131-
'pageSize':10,
132-
'pageNumber':3
133-
}
142+
'pageSize': 10,
143+
'pageNumber': 3
144+
}
134145
~~~~
146+
135147
pass the dictionary to the method as an additional argument.
148+
136149
~~~~ python
137150
adyen.management.account_company_level_api.get_companies(query_parameters=query_parameters)
138151
~~~~
152+
139153
### Handling exceptions
154+
140155
Adyen service exceptions extend the AdyenError class. After you catch this exception, you can access the
141156
class arguments for the specifics around this error or use the debug method which prints all the arguments.
157+
142158
~~~~python
143159
try:
144-
adyen.checkout.payments(request)
145-
except Adyen.exceptions.AdyenErorr as error:
146-
error.debug()
160+
adyen.checkout.payments_api.payments(request)
161+
except Adyen.exceptions.AdyenError as error:
162+
print(error.debug())
147163
~~~~
164+
148165
<details><summary>List of exceptions</summary>
149166
<p>AdyenInvalidRequestError</p>
150167
<p>AdyenAPIResponseError</p>
@@ -162,27 +179,27 @@ except Adyen.exceptions.AdyenErorr as error:
162179
For a closer look at how our Python library works, clone our [example integration](https://github.com/adyen-examples/adyen-python-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
163180

164181
## Feedback
182+
165183
We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas.
166184

167185
## Contributing
168186

169187
We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements.
170188

171-
172189
Have a look at our [contributing guidelines](https://github.com/Adyen/adyen-python-api-library/blob/develop/CONTRIBUTING.md) to find out how to raise a pull request.
173190

174-
175191
## Support
192+
176193
If you have a feature request, or spotted a bug or a technical problem, [create an issue here](https://github.com/Adyen/adyen-web/issues/new/choose).
177194

178195
For other questions, [contact our Support Team](https://www.adyen.help/hc/en-us/requests/new?ticket_form_id=360000705420).
179196

180-
181197
## Licence
198+
182199
This repository is available under the [MIT license](https://github.com/Adyen/adyen-python-api-library/blob/main/LICENSE.md).
183200

184-
185201
## See also
202+
186203
* [Example integration](https://github.com/adyen-examples/adyen-python-online-payments)
187204
* [Adyen docs](https://docs.adyen.com/)
188205
* [API Explorer](https://docs.adyen.com/api-explorer/)

0 commit comments

Comments
 (0)