Metadata-Version: 2.5
Name: render-lab-tasks-stripe
Version: 0.1.0
Summary: stripe tasks for Render Workflows
Project-URL: Repository, https://github.com/render-lab/render-tasks-python
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: render-lab-tasks-core<0.2,>=0.1.1
Requires-Dist: render-lab-triggers<0.2,>=0.1.0
Requires-Dist: render==1.0.1
Description-Content-Type: text/markdown

# Stripe tasks for Python

Install `render-lab-tasks-stripe`. Import wrapped tasks and raw `*_impl` functions
from `render_lab_tasks_stripe.tasks`, and register its `app` with your workflow.
Pass `Deps(stripe=...)` to raw implementations for hermetic tests.

## Environment

`STRIPE_API_KEY` is read lazily for REST operations. `STRIPE_WEBHOOK_SECRET` is
used by `verify_webhook` when `secret` is omitted. Verification needs no API key.
Requests make one attempt; durable task retries own retry policy.

The pack covers invoices, dunning, refunds, customers, subscriptions, payment
intents, Checkout sessions, and webhook HMAC verification. Dunning reads then
attempts payment once; its result uses the post-attempt invoice. Signature
verification checks a 300-second age tolerance and accepts rotated v1 signatures.
No live payment or refund has been performed for this port.

## Webhook adapter

`render_lab_tasks_stripe.webhooks.stripe_adapter(on_event, ...)` returns a
registration-free adapter for `render_lab_triggers`. The callback receives the
verified event and returns `{"task": "namespace.task", "args": [event]}` or `None`.
The signing credential `STRIPE_WEBHOOK_SECRET` is read inside verification unless
provided explicitly. Importing this module does not register tasks. Signature
checks use the raw body; live delivery remains in the testing backlog.

## Installation

```sh
pip install render-lab-tasks-stripe==0.1.0
```
