You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-41Lines changed: 41 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,32 +54,28 @@ pip install Adyen
54
54
~~~~
55
55
56
56
## Using the library
57
-
58
-
### General use with API key
59
-
60
-
~~~~python
61
-
import Adyen
62
-
63
-
adyen = Adyen.Adyen()
64
-
65
-
adyen.payment.client.xapikey ="YourXapikey"
66
-
adyen.payment.client.hmac ="YourHMACkey"
67
-
adyen.payment.client.platform ="test"# Environment to use the library in.
68
-
~~~~
69
-
70
-
### Consuming Services
71
57
72
58
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.
73
59
60
+
This library offers two ways to initialize and use the Adyen API services.
61
+
74
62
#### Using all services
75
63
64
+
For simple scripts or applications that only use a single set of API credentials, you can use the main `Adyen` object. This creates a convenient "facade" that loads and provides easy access to all available APIs. Keep in mind that different API keys will have different scopes so you may still need need more than one instance.
65
+
76
66
~~~~python
77
67
import Adyen
78
68
69
+
# Create the all-in-one client
79
70
adyen = Adyen.Adyen()
80
-
adyen.payment.client.xapikey ="YourXapikey"
81
-
adyen.payment.client.platform ="test"# change to live for production
71
+
72
+
# Configure the client
73
+
adyen.client.xapikey ="YourXapikey"
74
+
adyen.client.platform ="test"# change to "live" for production
result = adyen.checkout.payments_api.payments(request)
100
96
~~~~
101
97
102
-
#### Using one of the services
98
+
#### Using Individual Service Clients
99
+
100
+
For some web applications (e.g., using Flask or Django), multi-threaded environments, or any use case where you might need to manage multiple API credentials (for different merchant accounts, ECOM vs. POS, etc.), it is recommended to instantiate API clients directly.
103
101
104
102
~~~~python
105
-
from Adyen import checkout
103
+
# Import the core client and the service-level API class
0 commit comments