stableops 1.1.0__tar.gz → 1.2.0__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.
- {stableops-1.1.0 → stableops-1.2.0}/PKG-INFO +1 -1
- {stableops-1.1.0 → stableops-1.2.0}/pyproject.toml +1 -1
- {stableops-1.1.0 → stableops-1.2.0}/stableops/__init__.py +1 -1
- {stableops-1.1.0 → stableops-1.2.0}/stableops/types.py +10 -2
- {stableops-1.1.0 → stableops-1.2.0}/stableops/webhooks.py +16 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_webhooks.py +11 -1
- {stableops-1.1.0 → stableops-1.2.0}/.github/workflows/publish.yml +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/.gitignore +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/.pylintrc +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/LICENSE +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/README.md +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/README.zh-CN.md +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/examples/README.md +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/examples/async_example.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/examples/create_order.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/examples/webhook_handler.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/addresses.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/agents.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/checkout_sessions.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/client.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/errors.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/http.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/merchant_subscriptions.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/payment_links.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/payment_orders.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/py.typed +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/stableops/refunds.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_addresses.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_agents.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_checkout_sessions.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_http.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_merchant_subscriptions.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_payment_orders.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_refunds_and_payment_links.py +0 -0
- {stableops-1.1.0 → stableops-1.2.0}/tests/test_types.py +0 -0
|
@@ -245,6 +245,8 @@ class WebhookDelivery(BaseModel):
|
|
|
245
245
|
"""Webhook delivery record."""
|
|
246
246
|
|
|
247
247
|
id: str
|
|
248
|
+
# 直接来源投递。首次投递和历史无关联记录为空。
|
|
249
|
+
replay_of_delivery_id: Optional[str] = None
|
|
248
250
|
webhook_endpoint_id: str
|
|
249
251
|
event_id: str
|
|
250
252
|
event_type: WebhookEventType
|
|
@@ -593,7 +595,10 @@ class CreatePaymentLinkInput(BaseModel):
|
|
|
593
595
|
"""Input for creating a reusable payment link."""
|
|
594
596
|
|
|
595
597
|
title: str
|
|
596
|
-
amount: str
|
|
598
|
+
amount: Optional[str] = None
|
|
599
|
+
amount_type: Optional[Literal["fixed", "custom"]] = None
|
|
600
|
+
min_amount: Optional[str] = None
|
|
601
|
+
suggested_amounts: Optional[List[str]] = None
|
|
597
602
|
accepted_assets: List[AcceptedAssetInput]
|
|
598
603
|
description: Optional[str] = None
|
|
599
604
|
amount_mode: Optional[AmountMode] = None
|
|
@@ -624,7 +629,10 @@ class PaymentLink(BaseModel):
|
|
|
624
629
|
slug: str
|
|
625
630
|
title: str
|
|
626
631
|
description: Optional[str]
|
|
627
|
-
amount: str
|
|
632
|
+
amount: Optional[str]
|
|
633
|
+
amount_type: Optional[Literal["fixed", "custom"]] = None
|
|
634
|
+
min_amount: Optional[str] = None
|
|
635
|
+
suggested_amounts: Optional[List[str]] = None
|
|
628
636
|
amount_mode: AmountMode
|
|
629
637
|
settlement_asset: Optional[Asset]
|
|
630
638
|
accepted_assets: List[AcceptedAssetInput]
|
|
@@ -242,6 +242,8 @@ class WebhooksApi:
|
|
|
242
242
|
payment_order_id: Optional[str] = None,
|
|
243
243
|
limit: Optional[int] = None,
|
|
244
244
|
offset: Optional[int] = None,
|
|
245
|
+
delivery_id: Optional[str] = None,
|
|
246
|
+
replay_of_delivery_id: Optional[str] = None,
|
|
245
247
|
) -> List[WebhookDelivery]:
|
|
246
248
|
"""List webhook deliveries."""
|
|
247
249
|
return self.list_deliveries_page(
|
|
@@ -250,6 +252,8 @@ class WebhooksApi:
|
|
|
250
252
|
payment_order_id=payment_order_id,
|
|
251
253
|
limit=limit,
|
|
252
254
|
offset=offset,
|
|
255
|
+
delivery_id=delivery_id,
|
|
256
|
+
replay_of_delivery_id=replay_of_delivery_id,
|
|
253
257
|
).items
|
|
254
258
|
|
|
255
259
|
def list_deliveries_page(
|
|
@@ -259,6 +263,8 @@ class WebhooksApi:
|
|
|
259
263
|
payment_order_id: Optional[str] = None,
|
|
260
264
|
limit: Optional[int] = None,
|
|
261
265
|
offset: Optional[int] = None,
|
|
266
|
+
delivery_id: Optional[str] = None,
|
|
267
|
+
replay_of_delivery_id: Optional[str] = None,
|
|
262
268
|
) -> WebhookDeliveryList:
|
|
263
269
|
"""List webhook deliveries with pagination metadata."""
|
|
264
270
|
response = self.http.request(
|
|
@@ -270,6 +276,8 @@ class WebhooksApi:
|
|
|
270
276
|
"payment_order_id": payment_order_id,
|
|
271
277
|
"limit": limit,
|
|
272
278
|
"offset": offset,
|
|
279
|
+
"delivery_id": delivery_id,
|
|
280
|
+
"replay_of_delivery_id": replay_of_delivery_id,
|
|
273
281
|
},
|
|
274
282
|
)
|
|
275
283
|
return WebhookDeliveryList(**response)
|
|
@@ -407,6 +415,8 @@ class AsyncWebhooksApi:
|
|
|
407
415
|
payment_order_id: Optional[str] = None,
|
|
408
416
|
limit: Optional[int] = None,
|
|
409
417
|
offset: Optional[int] = None,
|
|
418
|
+
delivery_id: Optional[str] = None,
|
|
419
|
+
replay_of_delivery_id: Optional[str] = None,
|
|
410
420
|
) -> List[WebhookDelivery]:
|
|
411
421
|
"""List webhook deliveries (async)."""
|
|
412
422
|
page = await self.list_deliveries_page(
|
|
@@ -415,6 +425,8 @@ class AsyncWebhooksApi:
|
|
|
415
425
|
payment_order_id=payment_order_id,
|
|
416
426
|
limit=limit,
|
|
417
427
|
offset=offset,
|
|
428
|
+
delivery_id=delivery_id,
|
|
429
|
+
replay_of_delivery_id=replay_of_delivery_id,
|
|
418
430
|
)
|
|
419
431
|
return page.items
|
|
420
432
|
|
|
@@ -425,6 +437,8 @@ class AsyncWebhooksApi:
|
|
|
425
437
|
payment_order_id: Optional[str] = None,
|
|
426
438
|
limit: Optional[int] = None,
|
|
427
439
|
offset: Optional[int] = None,
|
|
440
|
+
delivery_id: Optional[str] = None,
|
|
441
|
+
replay_of_delivery_id: Optional[str] = None,
|
|
428
442
|
) -> WebhookDeliveryList:
|
|
429
443
|
"""List webhook deliveries with pagination metadata (async)."""
|
|
430
444
|
response = await self.http.request(
|
|
@@ -436,6 +450,8 @@ class AsyncWebhooksApi:
|
|
|
436
450
|
"payment_order_id": payment_order_id,
|
|
437
451
|
"limit": limit,
|
|
438
452
|
"offset": offset,
|
|
453
|
+
"delivery_id": delivery_id,
|
|
454
|
+
"replay_of_delivery_id": replay_of_delivery_id,
|
|
439
455
|
},
|
|
440
456
|
)
|
|
441
457
|
return WebhookDeliveryList(**response)
|
|
@@ -166,6 +166,7 @@ def test_list_deliveries_filters_and_parses() -> None:
|
|
|
166
166
|
"items": [
|
|
167
167
|
{
|
|
168
168
|
"id": "wd_1",
|
|
169
|
+
"replay_of_delivery_id": "wd_original",
|
|
169
170
|
"webhook_endpoint_id": "we_1",
|
|
170
171
|
"event_id": "evt_1",
|
|
171
172
|
"event_type": "payment.finalized",
|
|
@@ -189,7 +190,13 @@ def test_list_deliveries_filters_and_parses() -> None:
|
|
|
189
190
|
)
|
|
190
191
|
api = WebhooksApi(http) # type: ignore[arg-type]
|
|
191
192
|
|
|
192
|
-
deliveries = api.list_deliveries(
|
|
193
|
+
deliveries = api.list_deliveries(
|
|
194
|
+
status="failed",
|
|
195
|
+
endpoint_id="we_1",
|
|
196
|
+
limit=20,
|
|
197
|
+
delivery_id="wd_1",
|
|
198
|
+
replay_of_delivery_id="wd_original",
|
|
199
|
+
)
|
|
193
200
|
|
|
194
201
|
assert http.last_request["query"] == {
|
|
195
202
|
"status": "failed",
|
|
@@ -197,7 +204,10 @@ def test_list_deliveries_filters_and_parses() -> None:
|
|
|
197
204
|
"payment_order_id": None,
|
|
198
205
|
"limit": 20,
|
|
199
206
|
"offset": None,
|
|
207
|
+
"delivery_id": "wd_1",
|
|
208
|
+
"replay_of_delivery_id": "wd_original",
|
|
200
209
|
}
|
|
210
|
+
assert deliveries[0].replay_of_delivery_id == "wd_original"
|
|
201
211
|
assert deliveries[0].attempts == 3
|
|
202
212
|
assert deliveries[0].payload == {"type": "payment.finalized"}
|
|
203
213
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|