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
> Once this package is [published to PyPI](https://app.stainless.com/docs/guides/publish), this will become: `pip install --pre zbd_payments`
21
+
> Once this package is [published to PyPI](https://app.stainless.com/docs/guides/publish), this will become: `pip install --pre zbdpay_payments_sdk`
22
22
23
23
## Usage
24
24
25
25
The full API of this library can be found in [api.md](api.md).
26
26
27
27
```python
28
28
import os
29
-
fromzbd_paymentsimport ZbdPayments
29
+
fromzbdpay_payments_sdkimport ZbdPayments
30
30
31
31
client = ZbdPayments(
32
32
apikey=os.environ.get("ZBD_PAYMENTS_API_KEY"), # This is the default and can be omitted
@@ -51,7 +51,7 @@ Simply import `AsyncZbdPayments` instead of `ZbdPayments` and use `await` with e
51
51
```python
52
52
import os
53
53
import asyncio
54
-
fromzbd_paymentsimport AsyncZbdPayments
54
+
fromzbdpay_payments_sdkimport AsyncZbdPayments
55
55
56
56
client = AsyncZbdPayments(
57
57
apikey=os.environ.get("ZBD_PAYMENTS_API_KEY"), # This is the default and can be omitted
@@ -82,16 +82,16 @@ Typed requests and responses provide autocomplete and documentation within your
82
82
83
83
## Handling errors
84
84
85
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `zbd_payments.APIConnectionError` is raised.
85
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `zbdpay_payments_sdk.APIConnectionError` is raised.
86
86
87
87
When the API returns a non-success status code (that is, 4xx or 5xx
88
-
response), a subclass of `zbd_payments.APIStatusError` is raised, containing `status_code` and `response` properties.
88
+
response), a subclass of `zbdpay_payments_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
89
89
90
-
All errors inherit from `zbd_payments.APIError`.
90
+
All errors inherit from `zbdpay_payments_sdk.APIError`.
91
91
92
92
```python
93
-
importzbd_payments
94
-
fromzbd_paymentsimport ZbdPayments
93
+
importzbdpay_payments_sdk
94
+
fromzbdpay_payments_sdkimport ZbdPayments
95
95
96
96
client = ZbdPayments()
97
97
@@ -101,12 +101,12 @@ try:
101
101
comment="Instant global payments",
102
102
ln_address="andreneves@zbd.gg",
103
103
)
104
-
exceptzbd_payments.APIConnectionError as e:
104
+
exceptzbdpay_payments_sdk.APIConnectionError as e:
105
105
print("The server could not be reached")
106
106
print(e.__cause__) # an underlying Exception, likely raised within httpx.
107
-
exceptzbd_payments.RateLimitError as e:
107
+
exceptzbdpay_payments_sdk.RateLimitError as e:
108
108
print("A 429 status code was received; we should back off a bit.")
109
-
exceptzbd_payments.APIStatusError as e:
109
+
exceptzbdpay_payments_sdk.APIStatusError as e:
110
110
print("Another non-200-range status code was received")
111
111
print(e.status_code)
112
112
print(e.response)
@@ -134,7 +134,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
134
134
You can use the `max_retries` option to configure or disable retry settings:
135
135
136
136
```python
137
-
fromzbd_paymentsimport ZbdPayments
137
+
fromzbdpay_payments_sdkimport ZbdPayments
138
138
139
139
# Configure the default for all requests:
140
140
client = ZbdPayments(
@@ -156,7 +156,7 @@ By default requests time out after 1 minute. You can configure this with a `time
156
156
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
157
157
158
158
```python
159
-
fromzbd_paymentsimport ZbdPayments
159
+
fromzbdpay_payments_sdkimport ZbdPayments
160
160
161
161
# Configure the default for all requests:
162
162
client = ZbdPayments(
@@ -212,7 +212,7 @@ if response.my_field is None:
212
212
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
@@ -226,9 +226,9 @@ lightning_address = response.parse() # get the object that `lightning_address.s
226
226
print(lightning_address)
227
227
```
228
228
229
-
These methods return an [`APIResponse`](https://github.com/stainless-sdks/zbd-payments-python/tree/main/src/zbd_payments/_response.py) object.
229
+
These methods return an [`APIResponse`](https://github.com/stainless-sdks/zbd-payments-python/tree/main/src/zbdpay_payments_sdk/_response.py) object.
230
230
231
-
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/zbd-payments-python/tree/main/src/zbd_payments/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
231
+
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/zbd-payments-python/tree/main/src/zbdpay_payments_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
232
232
233
233
#### `.with_streaming_response`
234
234
@@ -294,7 +294,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
318
318
319
319
```py
320
-
fromzbd_paymentsimport ZbdPayments
320
+
fromzbdpay_payments_sdkimport ZbdPayments
321
321
322
322
with ZbdPayments() as client:
323
323
# make requests here
@@ -345,8 +345,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
345
345
You can determine the version that is being used at runtime with:
0 commit comments