hexpay 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {hexpay-0.0.2 → hexpay-0.0.3}/PKG-INFO +3 -3
  2. {hexpay-0.0.2 → hexpay-0.0.3}/README.md +1 -1
  3. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/payment_methods/list_payment_methods.py +28 -12
  4. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/payments/cancel_payment.py +8 -4
  5. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/payments/create_payment.py +36 -32
  6. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/payments/list_payments.py +4 -8
  7. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/__init__.py +16 -6
  8. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/chain_response.py +1 -1
  9. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/coin_response.py +1 -1
  10. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/create_payment_request.py +42 -24
  11. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/create_payment_request_metadata.py +2 -1
  12. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/error.py +4 -4
  13. hexpay-0.0.2/hexpay/models/method_filter.py → hexpay-0.0.3/hexpay/models/method_restriction.py +14 -14
  14. hexpay-0.0.2/hexpay/models/method_filter_chain.py → hexpay-0.0.3/hexpay/models/method_restriction_chain.py +1 -1
  15. hexpay-0.0.2/hexpay/models/method_filter_coin.py → hexpay-0.0.3/hexpay/models/method_restriction_coin.py +1 -1
  16. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_cancel_response.py +3 -2
  17. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_details.py +6 -3
  18. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_list_response.py +16 -16
  19. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_method_list_response.py +3 -3
  20. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_method_response.py +1 -1
  21. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_options.py +14 -11
  22. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_response.py +32 -10
  23. hexpay-0.0.3/hexpay/models/payment_response_metadata.py +55 -0
  24. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_status_response.py +2 -2
  25. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_timer_response.py +3 -2
  26. hexpay-0.0.3/hexpay/models/webhook_payload.py +123 -0
  27. hexpay-0.0.3/hexpay/models/webhook_payload_metadata_type_0.py +55 -0
  28. hexpay-0.0.3/hexpay/models/webhook_payload_status.py +8 -0
  29. hexpay-0.0.3/hexpay/models/webhook_request.py +86 -0
  30. {hexpay-0.0.2 → hexpay-0.0.3}/pyproject.toml +1 -1
  31. {hexpay-0.0.2 → hexpay-0.0.3}/.gitignore +0 -0
  32. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/__init__.py +0 -0
  33. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/__init__.py +0 -0
  34. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/payment_methods/__init__.py +0 -0
  35. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/payments/__init__.py +0 -0
  36. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/payments/get_payment.py +0 -0
  37. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/api/payments/get_payment_status.py +0 -0
  38. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/client.py +0 -0
  39. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/errors.py +0 -0
  40. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/chain_response_symbol.py +0 -0
  41. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/coin_response_symbol.py +0 -0
  42. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/error_response.py +0 -0
  43. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/error_type.py +0 -0
  44. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/models/payment_status.py +0 -0
  45. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/py.typed +0 -0
  46. {hexpay-0.0.2 → hexpay-0.0.3}/hexpay/types.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: hexpay
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: Official Python SDK for the HexPay Merchant API (TON cryptocurrency payments).
5
5
  Project-URL: Homepage, https://hexpay.io
6
6
  Project-URL: Documentation, https://docs.hexpay.io
@@ -86,7 +86,7 @@ from environment variables, a secrets manager, or your config layer.
86
86
 
87
87
  ## Idempotency
88
88
 
89
- Every `POST` request requires a UUID v4 `X-Idempotency-Key`. The SDK exposes it as
89
+ `POST` requests accept an optional `X-Idempotency-Key` (UUID). The SDK exposes it as
90
90
  the `x_idempotency_key` argument on every mutating operation.
91
91
 
92
92
  **Reuse the same key when retrying** a failed request — the server returns the
@@ -60,7 +60,7 @@ from environment variables, a secrets manager, or your config layer.
60
60
 
61
61
  ## Idempotency
62
62
 
63
- Every `POST` request requires a UUID v4 `X-Idempotency-Key`. The SDK exposes it as
63
+ `POST` requests accept an optional `X-Idempotency-Key` (UUID). The SDK exposes it as
64
64
  the `x_idempotency_key` argument on every mutating operation.
65
65
 
66
66
  **Reuse the same key when retrying** a failed request — the server returns the
@@ -64,11 +64,15 @@ def sync_detailed(
64
64
  ) -> Response[ErrorResponse | PaymentMethodListResponse]:
65
65
  """List payment methods
66
66
 
67
- Retrieves all payment methods enabled for your store. Each entry represents
68
- a unique coin + chain combination that your store accepts.
67
+ Retrieves the payment methods enabled for your store. Each entry represents
68
+ a unique coin + chain combination that your store accepts. Use it, for example,
69
+ to show available payment options on your website.
70
+
71
+ Only your store's enabled methods are returned, not every coin supported by
72
+ HexPay.
69
73
 
70
74
  Use `coin.symbol` and `chain.symbol` values from this response as inputs for
71
- the `coin` and `chain` fields in `payment_options.methods` when creating a payment.
75
+ the `coin` and `chain` fields in `paymentOptions.methods` when creating a payment.
72
76
 
73
77
  Raises:
74
78
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -93,11 +97,15 @@ def sync(
93
97
  ) -> ErrorResponse | PaymentMethodListResponse | None:
94
98
  """List payment methods
95
99
 
96
- Retrieves all payment methods enabled for your store. Each entry represents
97
- a unique coin + chain combination that your store accepts.
100
+ Retrieves the payment methods enabled for your store. Each entry represents
101
+ a unique coin + chain combination that your store accepts. Use it, for example,
102
+ to show available payment options on your website.
103
+
104
+ Only your store's enabled methods are returned, not every coin supported by
105
+ HexPay.
98
106
 
99
107
  Use `coin.symbol` and `chain.symbol` values from this response as inputs for
100
- the `coin` and `chain` fields in `payment_options.methods` when creating a payment.
108
+ the `coin` and `chain` fields in `paymentOptions.methods` when creating a payment.
101
109
 
102
110
  Raises:
103
111
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -118,11 +126,15 @@ async def asyncio_detailed(
118
126
  ) -> Response[ErrorResponse | PaymentMethodListResponse]:
119
127
  """List payment methods
120
128
 
121
- Retrieves all payment methods enabled for your store. Each entry represents
122
- a unique coin + chain combination that your store accepts.
129
+ Retrieves the payment methods enabled for your store. Each entry represents
130
+ a unique coin + chain combination that your store accepts. Use it, for example,
131
+ to show available payment options on your website.
132
+
133
+ Only your store's enabled methods are returned, not every coin supported by
134
+ HexPay.
123
135
 
124
136
  Use `coin.symbol` and `chain.symbol` values from this response as inputs for
125
- the `coin` and `chain` fields in `payment_options.methods` when creating a payment.
137
+ the `coin` and `chain` fields in `paymentOptions.methods` when creating a payment.
126
138
 
127
139
  Raises:
128
140
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -145,11 +157,15 @@ async def asyncio(
145
157
  ) -> ErrorResponse | PaymentMethodListResponse | None:
146
158
  """List payment methods
147
159
 
148
- Retrieves all payment methods enabled for your store. Each entry represents
149
- a unique coin + chain combination that your store accepts.
160
+ Retrieves the payment methods enabled for your store. Each entry represents
161
+ a unique coin + chain combination that your store accepts. Use it, for example,
162
+ to show available payment options on your website.
163
+
164
+ Only your store's enabled methods are returned, not every coin supported by
165
+ HexPay.
150
166
 
151
167
  Use `coin.symbol` and `chain.symbol` values from this response as inputs for
152
- the `coin` and `chain` fields in `payment_options.methods` when creating a payment.
168
+ the `coin` and `chain` fields in `paymentOptions.methods` when creating a payment.
153
169
 
154
170
  Raises:
155
171
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -88,7 +88,8 @@ def sync_detailed(
88
88
  ) -> Response[ErrorResponse | PaymentCancelResponse]:
89
89
  """Cancel a payment
90
90
 
91
- Cancels a payment and returns the updated status `cancelled`.
91
+ Cancels a payment. The response contains only the new status, `cancelled`.
92
+ Use `GET /v1/payments/{paymentId}` if you need the full payment object.
92
93
 
93
94
  Cancellation is permitted from `created` or `pending` status only. Payments
94
95
  already in a terminal state (`completed`, `expired`, or `cancelled`) cannot
@@ -126,7 +127,8 @@ def sync(
126
127
  ) -> ErrorResponse | PaymentCancelResponse | None:
127
128
  """Cancel a payment
128
129
 
129
- Cancels a payment and returns the updated status `cancelled`.
130
+ Cancels a payment. The response contains only the new status, `cancelled`.
131
+ Use `GET /v1/payments/{paymentId}` if you need the full payment object.
130
132
 
131
133
  Cancellation is permitted from `created` or `pending` status only. Payments
132
134
  already in a terminal state (`completed`, `expired`, or `cancelled`) cannot
@@ -159,7 +161,8 @@ async def asyncio_detailed(
159
161
  ) -> Response[ErrorResponse | PaymentCancelResponse]:
160
162
  """Cancel a payment
161
163
 
162
- Cancels a payment and returns the updated status `cancelled`.
164
+ Cancels a payment. The response contains only the new status, `cancelled`.
165
+ Use `GET /v1/payments/{paymentId}` if you need the full payment object.
163
166
 
164
167
  Cancellation is permitted from `created` or `pending` status only. Payments
165
168
  already in a terminal state (`completed`, `expired`, or `cancelled`) cannot
@@ -195,7 +198,8 @@ async def asyncio(
195
198
  ) -> ErrorResponse | PaymentCancelResponse | None:
196
199
  """Cancel a payment
197
200
 
198
- Cancels a payment and returns the updated status `cancelled`.
201
+ Cancels a payment. The response contains only the new status, `cancelled`.
202
+ Use `GET /v1/payments/{paymentId}` if you need the full payment object.
199
203
 
200
204
  Cancellation is permitted from `created` or `pending` status only. Payments
201
205
  already in a terminal state (`completed`, `expired`, or `cancelled`) cannot
@@ -105,19 +105,20 @@ def sync_detailed(
105
105
  ---
106
106
 
107
107
  ### Preselected
108
- Pass `payment_options.methods` with **exactly one entry** containing **both** `coin`
109
- and `chain`. The server resolves the address immediately and returns the payment in
110
- `pending` status with `paymentDetails` populated. The customer proceeds straight to
111
- the deposit screen without any method selection step.
108
+ Pass `paymentOptions.methods` with **exactly one entry** containing **both** `coin`
109
+ and `chain`. HexPay selects this method on behalf of the customer, resolves the
110
+ address immediately and returns the payment in `pending` status with
111
+ `paymentDetails` populated. The customer proceeds straight to the deposit screen
112
+ without any method selection step.
112
113
 
113
114
  ### Customer Choice
114
- Omit `payment_options`. All store-enabled payment methods are offered to the customer
115
+ Omit `paymentOptions`. All store-enabled payment methods are offered to the customer
115
116
  at checkout. The payment starts in `created` status.
116
117
 
117
118
  ---
118
119
 
119
120
  ### Supported combinations
120
- | `currency` | `payment_options.methods` | Initial status | `paymentDetails` |
121
+ | `currency` | `paymentOptions.methods` | Initial status | `paymentDetails` |
121
122
  |------------|------------------------------------|----------------|------------------|
122
123
  | `USD` | *(omitted)* | `created` | absent |
123
124
  | `TON` | *(omitted)* | `created` | absent |
@@ -130,8 +131,8 @@ def sync_detailed(
130
131
  body (CreatePaymentRequest): Request body for creating a new payment. The body is
131
132
  intentionally flat:
132
133
  `amount`, `currency`, and all optional fields are top-level. The only nested
133
- structure is `payment_options.methods`, which describes an allowlist of
134
- acceptable payment methods.
134
+ structure is `paymentOptions.methods`, which restricts the payment methods
135
+ offered to the customer.
135
136
 
136
137
  Raises:
137
138
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -170,19 +171,20 @@ def sync(
170
171
  ---
171
172
 
172
173
  ### Preselected
173
- Pass `payment_options.methods` with **exactly one entry** containing **both** `coin`
174
- and `chain`. The server resolves the address immediately and returns the payment in
175
- `pending` status with `paymentDetails` populated. The customer proceeds straight to
176
- the deposit screen without any method selection step.
174
+ Pass `paymentOptions.methods` with **exactly one entry** containing **both** `coin`
175
+ and `chain`. HexPay selects this method on behalf of the customer, resolves the
176
+ address immediately and returns the payment in `pending` status with
177
+ `paymentDetails` populated. The customer proceeds straight to the deposit screen
178
+ without any method selection step.
177
179
 
178
180
  ### Customer Choice
179
- Omit `payment_options`. All store-enabled payment methods are offered to the customer
181
+ Omit `paymentOptions`. All store-enabled payment methods are offered to the customer
180
182
  at checkout. The payment starts in `created` status.
181
183
 
182
184
  ---
183
185
 
184
186
  ### Supported combinations
185
- | `currency` | `payment_options.methods` | Initial status | `paymentDetails` |
187
+ | `currency` | `paymentOptions.methods` | Initial status | `paymentDetails` |
186
188
  |------------|------------------------------------|----------------|------------------|
187
189
  | `USD` | *(omitted)* | `created` | absent |
188
190
  | `TON` | *(omitted)* | `created` | absent |
@@ -195,8 +197,8 @@ def sync(
195
197
  body (CreatePaymentRequest): Request body for creating a new payment. The body is
196
198
  intentionally flat:
197
199
  `amount`, `currency`, and all optional fields are top-level. The only nested
198
- structure is `payment_options.methods`, which describes an allowlist of
199
- acceptable payment methods.
200
+ structure is `paymentOptions.methods`, which restricts the payment methods
201
+ offered to the customer.
200
202
 
201
203
  Raises:
202
204
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -230,19 +232,20 @@ async def asyncio_detailed(
230
232
  ---
231
233
 
232
234
  ### Preselected
233
- Pass `payment_options.methods` with **exactly one entry** containing **both** `coin`
234
- and `chain`. The server resolves the address immediately and returns the payment in
235
- `pending` status with `paymentDetails` populated. The customer proceeds straight to
236
- the deposit screen without any method selection step.
235
+ Pass `paymentOptions.methods` with **exactly one entry** containing **both** `coin`
236
+ and `chain`. HexPay selects this method on behalf of the customer, resolves the
237
+ address immediately and returns the payment in `pending` status with
238
+ `paymentDetails` populated. The customer proceeds straight to the deposit screen
239
+ without any method selection step.
237
240
 
238
241
  ### Customer Choice
239
- Omit `payment_options`. All store-enabled payment methods are offered to the customer
242
+ Omit `paymentOptions`. All store-enabled payment methods are offered to the customer
240
243
  at checkout. The payment starts in `created` status.
241
244
 
242
245
  ---
243
246
 
244
247
  ### Supported combinations
245
- | `currency` | `payment_options.methods` | Initial status | `paymentDetails` |
248
+ | `currency` | `paymentOptions.methods` | Initial status | `paymentDetails` |
246
249
  |------------|------------------------------------|----------------|------------------|
247
250
  | `USD` | *(omitted)* | `created` | absent |
248
251
  | `TON` | *(omitted)* | `created` | absent |
@@ -255,8 +258,8 @@ async def asyncio_detailed(
255
258
  body (CreatePaymentRequest): Request body for creating a new payment. The body is
256
259
  intentionally flat:
257
260
  `amount`, `currency`, and all optional fields are top-level. The only nested
258
- structure is `payment_options.methods`, which describes an allowlist of
259
- acceptable payment methods.
261
+ structure is `paymentOptions.methods`, which restricts the payment methods
262
+ offered to the customer.
260
263
 
261
264
  Raises:
262
265
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -293,19 +296,20 @@ async def asyncio(
293
296
  ---
294
297
 
295
298
  ### Preselected
296
- Pass `payment_options.methods` with **exactly one entry** containing **both** `coin`
297
- and `chain`. The server resolves the address immediately and returns the payment in
298
- `pending` status with `paymentDetails` populated. The customer proceeds straight to
299
- the deposit screen without any method selection step.
299
+ Pass `paymentOptions.methods` with **exactly one entry** containing **both** `coin`
300
+ and `chain`. HexPay selects this method on behalf of the customer, resolves the
301
+ address immediately and returns the payment in `pending` status with
302
+ `paymentDetails` populated. The customer proceeds straight to the deposit screen
303
+ without any method selection step.
300
304
 
301
305
  ### Customer Choice
302
- Omit `payment_options`. All store-enabled payment methods are offered to the customer
306
+ Omit `paymentOptions`. All store-enabled payment methods are offered to the customer
303
307
  at checkout. The payment starts in `created` status.
304
308
 
305
309
  ---
306
310
 
307
311
  ### Supported combinations
308
- | `currency` | `payment_options.methods` | Initial status | `paymentDetails` |
312
+ | `currency` | `paymentOptions.methods` | Initial status | `paymentDetails` |
309
313
  |------------|------------------------------------|----------------|------------------|
310
314
  | `USD` | *(omitted)* | `created` | absent |
311
315
  | `TON` | *(omitted)* | `created` | absent |
@@ -318,8 +322,8 @@ async def asyncio(
318
322
  body (CreatePaymentRequest): Request body for creating a new payment. The body is
319
323
  intentionally flat:
320
324
  `amount`, `currency`, and all optional fields are top-level. The only nested
321
- structure is `payment_options.methods`, which describes an allowlist of
322
- acceptable payment methods.
325
+ structure is `paymentOptions.methods`, which restricts the payment methods
326
+ offered to the customer.
323
327
 
324
328
  Raises:
325
329
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -108,8 +108,7 @@ def sync_detailed(
108
108
 
109
109
  Args:
110
110
  limit (int | Unset): Default: 10. Example: 20.
111
- cursor (str | Unset): Example:
112
- eyJpZCI6IjAxOTMyN2M2LTIwNTgtNzkwMS1iMjM0LTU2Nzg5YWJjZGVmZiJ9.
111
+ cursor (str | Unset): Example: 019327c6-1234-7901-b234-56789abcde00.
113
112
  status (list[PaymentStatus] | Unset): Example: ['pending', 'completed'].
114
113
 
115
114
  Raises:
@@ -153,8 +152,7 @@ def sync(
153
152
 
154
153
  Args:
155
154
  limit (int | Unset): Default: 10. Example: 20.
156
- cursor (str | Unset): Example:
157
- eyJpZCI6IjAxOTMyN2M2LTIwNTgtNzkwMS1iMjM0LTU2Nzg5YWJjZGVmZiJ9.
155
+ cursor (str | Unset): Example: 019327c6-1234-7901-b234-56789abcde00.
158
156
  status (list[PaymentStatus] | Unset): Example: ['pending', 'completed'].
159
157
 
160
158
  Raises:
@@ -193,8 +191,7 @@ async def asyncio_detailed(
193
191
 
194
192
  Args:
195
193
  limit (int | Unset): Default: 10. Example: 20.
196
- cursor (str | Unset): Example:
197
- eyJpZCI6IjAxOTMyN2M2LTIwNTgtNzkwMS1iMjM0LTU2Nzg5YWJjZGVmZiJ9.
194
+ cursor (str | Unset): Example: 019327c6-1234-7901-b234-56789abcde00.
198
195
  status (list[PaymentStatus] | Unset): Example: ['pending', 'completed'].
199
196
 
200
197
  Raises:
@@ -236,8 +233,7 @@ async def asyncio(
236
233
 
237
234
  Args:
238
235
  limit (int | Unset): Default: 10. Example: 20.
239
- cursor (str | Unset): Example:
240
- eyJpZCI6IjAxOTMyN2M2LTIwNTgtNzkwMS1iMjM0LTU2Nzg5YWJjZGVmZiJ9.
236
+ cursor (str | Unset): Example: 019327c6-1234-7901-b234-56789abcde00.
241
237
  status (list[PaymentStatus] | Unset): Example: ['pending', 'completed'].
242
238
 
243
239
  Raises:
@@ -9,9 +9,9 @@ from .create_payment_request_metadata import CreatePaymentRequestMetadata
9
9
  from .error import Error
10
10
  from .error_response import ErrorResponse
11
11
  from .error_type import ErrorType
12
- from .method_filter import MethodFilter
13
- from .method_filter_chain import MethodFilterChain
14
- from .method_filter_coin import MethodFilterCoin
12
+ from .method_restriction import MethodRestriction
13
+ from .method_restriction_chain import MethodRestrictionChain
14
+ from .method_restriction_coin import MethodRestrictionCoin
15
15
  from .payment_cancel_response import PaymentCancelResponse
16
16
  from .payment_details import PaymentDetails
17
17
  from .payment_list_response import PaymentListResponse
@@ -19,9 +19,14 @@ from .payment_method_list_response import PaymentMethodListResponse
19
19
  from .payment_method_response import PaymentMethodResponse
20
20
  from .payment_options import PaymentOptions
21
21
  from .payment_response import PaymentResponse
22
+ from .payment_response_metadata import PaymentResponseMetadata
22
23
  from .payment_status import PaymentStatus
23
24
  from .payment_status_response import PaymentStatusResponse
24
25
  from .payment_timer_response import PaymentTimerResponse
26
+ from .webhook_payload import WebhookPayload
27
+ from .webhook_payload_metadata_type_0 import WebhookPayloadMetadataType0
28
+ from .webhook_payload_status import WebhookPayloadStatus
29
+ from .webhook_request import WebhookRequest
25
30
 
26
31
  __all__ = (
27
32
  "ChainResponse",
@@ -33,9 +38,9 @@ __all__ = (
33
38
  "Error",
34
39
  "ErrorResponse",
35
40
  "ErrorType",
36
- "MethodFilter",
37
- "MethodFilterChain",
38
- "MethodFilterCoin",
41
+ "MethodRestriction",
42
+ "MethodRestrictionChain",
43
+ "MethodRestrictionCoin",
39
44
  "PaymentCancelResponse",
40
45
  "PaymentDetails",
41
46
  "PaymentListResponse",
@@ -43,7 +48,12 @@ __all__ = (
43
48
  "PaymentMethodResponse",
44
49
  "PaymentOptions",
45
50
  "PaymentResponse",
51
+ "PaymentResponseMetadata",
46
52
  "PaymentStatus",
47
53
  "PaymentStatusResponse",
48
54
  "PaymentTimerResponse",
55
+ "WebhookPayload",
56
+ "WebhookPayloadMetadataType0",
57
+ "WebhookPayloadStatus",
58
+ "WebhookRequest",
49
59
  )
@@ -21,7 +21,7 @@ class ChainResponse:
21
21
  Attributes:
22
22
  name (str): Human-readable name of the blockchain network. Example: TON.
23
23
  symbol (ChainResponseSymbol): Ticker symbol. Use this value as the `chain` field in
24
- `payment_options.methods` when creating payments.
24
+ `paymentOptions.methods` when creating payments.
25
25
  Example: TON.
26
26
  img_url (str): URL of the chain logo image. Example: https://assets.hexpay.io/chains/ton.svg.
27
27
  """
@@ -21,7 +21,7 @@ class CoinResponse:
21
21
  Attributes:
22
22
  name (str): Human-readable name of the cryptocurrency. Example: Tether.
23
23
  symbol (CoinResponseSymbol): Ticker symbol. Use this value as the `coin` field in
24
- `payment_options.methods` when creating payments.
24
+ `paymentOptions.methods` when creating payments.
25
25
  Example: USDT.
26
26
  img_url (str): URL of the coin logo image. Example: https://assets.hexpay.io/coins/usdt.svg.
27
27
  """
@@ -23,26 +23,26 @@ T = TypeVar("T", bound="CreatePaymentRequest")
23
23
  class CreatePaymentRequest:
24
24
  """Request body for creating a new payment. The body is intentionally flat:
25
25
  `amount`, `currency`, and all optional fields are top-level. The only nested
26
- structure is `payment_options.methods`, which describes an allowlist of
27
- acceptable payment methods.
26
+ structure is `paymentOptions.methods`, which restricts the payment methods
27
+ offered to the customer.
28
28
 
29
29
  Attributes:
30
- amount (str): The payment value as a positive decimal string. No leading zeros are
31
- permitted on the integer part (`"007"` is invalid; use `"7"`).
30
+ amount (str): The payment value as a positive decimal string. Zero is not allowed.
31
+ No leading zeros are permitted on the integer part (`"007"` is invalid; use `"7"`).
32
32
  For fiat currencies up to 2 decimal places are recommended.
33
33
  For crypto tickers precision depends on the coin.
34
34
  Example: 100.00.
35
- currency (str): Ticker symbol for the denomination. Accepts fiat codes (e.g. `USD`, `EUR`,
36
- `RUB`) or TON-ecosystem coin tickers (e.g. `TON`, `USDT`).
35
+ currency (str): Ticker symbol for the denomination. Accepts fiat codes (`USD`, `EUR`, `RUB`)
36
+ or TON-ecosystem coin tickers (`TON`, `USDT`, `NOT`, `DOGS`, `BUILD`, `BLUM`,
37
+ `DUST`, `DYOR`, `STON`, `XAUt0`).
37
38
 
38
39
  This field defines the **unit of value** — it does not determine the coin
39
- the customer pays with. Payment coin is controlled by `payment_options.methods`.
40
+ the customer pays with. Payment coin is controlled by `paymentOptions.methods`.
40
41
 
41
- For the full list of accepted values use `GET /v1/payment-methods` (coins)
42
- or refer to the supported fiat codes in your store settings.
42
+ Any supported ticker is accepted, regardless of which payment methods are
43
+ enabled for your store.
43
44
  Example: USD.
44
- payment_options (PaymentOptions | Unset): Optional constraints on which payment methods are available at
45
- checkout.
45
+ payment_options (PaymentOptions | Unset): Optional restriction on which payment methods are offered at checkout.
46
46
  When omitted entirely, all payment methods enabled for your store are shown
47
47
  and the payment is created in `created` status.
48
48
  ttl (int | Unset): Time-to-live in seconds. Defines how long the payment remains active
@@ -54,27 +54,37 @@ class CreatePaymentRequest:
54
54
  Default: 3600. Example: 3600.
55
55
  order_id (str | Unset): Merchant-defined external order identifier. Use this to correlate a HexPay
56
56
  payment with your internal order or invoice system. Returned on all payment
57
- objects and included in webhook payloads.
57
+ objects and included in the webhook payload.
58
58
  Example: order-2026-00123.
59
59
  description (str | Unset): Human-readable description of the payment purpose. May be displayed to
60
60
  the customer on the payment page.
61
61
  Example: Premium subscription — 1 year.
62
62
  metadata (CreatePaymentRequestMetadata | Unset): Arbitrary key-value pairs for merchant use. All values must be
63
63
  strings.
64
- Returned on all payment objects and included in webhook payloads.
64
+ Returned on all payment objects and included in the webhook payload.
65
65
  Maximum 10 keys; key names up to 64 characters, values up to 512 characters.
66
+ Keys are stored as provided and are not renamed.
66
67
  Example: {'customer_id': 'cust_abc123', 'customer_email': 'customer@example.com'}.
67
- webhook_url (str | Unset): HTTPS URL to which HexPay will POST webhook notifications for this
68
- payment's lifecycle events (e.g., transitions to `pending` or `completed`).
68
+ webhook_url (str | Unset): HTTPS URL to which HexPay will POST a webhook notification when this
69
+ payment reaches `completed` status. No webhooks are sent for other statuses.
69
70
 
70
71
  Requirements:
71
72
  - Must use HTTPS. Plain HTTP URLs are rejected.
72
- - Must be publicly reachable from the internet. Loopback addresses
73
- (`localhost`, `127.x.x.x`) and private network ranges (`10.x.x.x`,
74
- `192.168.x.x`, `172.16–31.x.x`) are not allowed.
73
+ - Must be publicly reachable from the internet. Non-public addresses are
74
+ rejected, and host names that resolve to them are blocked at delivery time.
75
75
  - Make sure your server is configured to accept POST requests at this URL
76
76
  before creating payments.
77
77
  Example: https://merchant.com/webhooks/hexpay.
78
+ redirect_url (str | Unset): HTTPS URL of your page (e.g. the order page) that the checkout page links to
79
+ once the payment is finished (`completed`, `expired` or `cancelled`), so the
80
+ customer can return to your store.
81
+
82
+ Requirements:
83
+ - Must be an absolute HTTPS URL. Plain HTTP and other schemes are rejected.
84
+ - Maximum 512 characters.
85
+
86
+ If omitted, the checkout page uses the default HexPay URL.
87
+ Example: https://merchant.com/orders/order-2026-00123.
78
88
  """
79
89
 
80
90
  amount: str
@@ -85,6 +95,7 @@ class CreatePaymentRequest:
85
95
  description: str | Unset = UNSET
86
96
  metadata: CreatePaymentRequestMetadata | Unset = UNSET
87
97
  webhook_url: str | Unset = UNSET
98
+ redirect_url: str | Unset = UNSET
88
99
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
89
100
 
90
101
  def to_dict(self) -> dict[str, Any]:
@@ -111,6 +122,8 @@ class CreatePaymentRequest:
111
122
 
112
123
  webhook_url = self.webhook_url
113
124
 
125
+ redirect_url = self.redirect_url
126
+
114
127
  field_dict: dict[str, Any] = {}
115
128
  field_dict.update(self.additional_properties)
116
129
  field_dict.update(
@@ -120,17 +133,19 @@ class CreatePaymentRequest:
120
133
  }
121
134
  )
122
135
  if payment_options is not UNSET:
123
- field_dict["payment_options"] = payment_options
136
+ field_dict["paymentOptions"] = payment_options
124
137
  if ttl is not UNSET:
125
138
  field_dict["ttl"] = ttl
126
139
  if order_id is not UNSET:
127
- field_dict["order_id"] = order_id
140
+ field_dict["orderId"] = order_id
128
141
  if description is not UNSET:
129
142
  field_dict["description"] = description
130
143
  if metadata is not UNSET:
131
144
  field_dict["metadata"] = metadata
132
145
  if webhook_url is not UNSET:
133
- field_dict["webhookURL"] = webhook_url
146
+ field_dict["webhookUrl"] = webhook_url
147
+ if redirect_url is not UNSET:
148
+ field_dict["redirectUrl"] = redirect_url
134
149
 
135
150
  return field_dict
136
151
 
@@ -144,7 +159,7 @@ class CreatePaymentRequest:
144
159
 
145
160
  currency = d.pop("currency")
146
161
 
147
- _payment_options = d.pop("payment_options", UNSET)
162
+ _payment_options = d.pop("paymentOptions", UNSET)
148
163
  payment_options: PaymentOptions | Unset
149
164
  if isinstance(_payment_options, Unset):
150
165
  payment_options = UNSET
@@ -153,7 +168,7 @@ class CreatePaymentRequest:
153
168
 
154
169
  ttl = d.pop("ttl", UNSET)
155
170
 
156
- order_id = d.pop("order_id", UNSET)
171
+ order_id = d.pop("orderId", UNSET)
157
172
 
158
173
  description = d.pop("description", UNSET)
159
174
 
@@ -164,7 +179,9 @@ class CreatePaymentRequest:
164
179
  else:
165
180
  metadata = CreatePaymentRequestMetadata.from_dict(_metadata)
166
181
 
167
- webhook_url = d.pop("webhookURL", UNSET)
182
+ webhook_url = d.pop("webhookUrl", UNSET)
183
+
184
+ redirect_url = d.pop("redirectUrl", UNSET)
168
185
 
169
186
  create_payment_request = cls(
170
187
  amount=amount,
@@ -175,6 +192,7 @@ class CreatePaymentRequest:
175
192
  description=description,
176
193
  metadata=metadata,
177
194
  webhook_url=webhook_url,
195
+ redirect_url=redirect_url,
178
196
  )
179
197
 
180
198
  create_payment_request.additional_properties = d
@@ -15,8 +15,9 @@ T = TypeVar("T", bound="CreatePaymentRequestMetadata")
15
15
  @_attrs_define
16
16
  class CreatePaymentRequestMetadata:
17
17
  """Arbitrary key-value pairs for merchant use. All values must be strings.
18
- Returned on all payment objects and included in webhook payloads.
18
+ Returned on all payment objects and included in the webhook payload.
19
19
  Maximum 10 keys; key names up to 64 characters, values up to 512 characters.
20
+ Keys are stored as provided and are not renamed.
20
21
 
21
22
  Example:
22
23
  {'customer_id': 'cust_abc123', 'customer_email': 'customer@example.com'}
@@ -26,14 +26,14 @@ class Error:
26
26
  type_ (ErrorType): High-level error category. Use this to determine the general class of
27
27
  the error without parsing `code`.
28
28
  Example: invalid_request_error.
29
- message (str): Human-readable description of the error, intended for developers. Example: Amount must be a
30
- positive decimal number.
29
+ message (str): Human-readable description of the error, intended for developers. Example: Invalid amount (must
30
+ be a valid positive number).
31
31
  code (str): Machine-readable error identifier. Use this in conditional logic to branch
32
- on specific error conditions (e.g., retry on `rate_limit_exceeded`,
32
+ on specific error conditions (e.g., retry on `payment_concurrent_limit_exceeded`,
33
33
  surface to user on `payment_not_cancellable`).
34
34
  Example: invalid_amount.
35
35
  param (str | Unset): The name of the request field that caused the error, using dot notation
36
- for nested fields (e.g., `currency`, `payment_options.methods[0]`).
36
+ for nested fields (e.g., `currency`, `paymentOptions.methods`).
37
37
  Present only when the error is attributable to a specific parameter.
38
38
  Example: amount.
39
39
  """