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
+34-42Lines changed: 34 additions & 42 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.
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
103
99
104
-
~~~~python
105
-
from Adyen import checkout
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.
106
101
107
-
checkout.client.xapikey ="YourXapikey"
108
-
checkout.client.platform ="test"# change to live for production
0 commit comments