Metadata-Version: 2.5
Name: boilpayment-polar
Version: 0.1.0
Summary: boilpayment — polar
Project-URL: Homepage, https://github.com/schift-io/boilpayment#readme
Project-URL: Repository, https://github.com/schift-io/boilpayment.git
Project-URL: Issues, https://github.com/schift-io/boilpayment/issues
Author: boilpayment contributors
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: boilpayment-core<0.2,>=0.1.0
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# boilpayment-polar

Polar implementation of `boilpayment-core`'s `PaymentProvider` protocol: checkout, native
subscriptions, refunds, Standard Webhooks verification, and normalizers from Polar's REST API
responses to the kit's `Payment`/`Subscription`/`Refund` types.

## Install

```
pip install boilpayment-polar
```

## Usage

```python
from boilpayment_polar import PolarProvider
from boilpayment_core import CreateCheckoutInput

provider = PolarProvider(
    access_token=os.environ["POLAR_ACCESS_TOKEN"],
    webhook_secret=os.environ["POLAR_WEBHOOK_SECRET"],
    server="sandbox",
)

checkout = await provider.create_checkout(CreateCheckoutInput(
    customer_ref="cust_123", plan=plan, price=price, mode="subscription",
    success_url="https://app.example.com/success", cancel_url="https://app.example.com/cancel",
    idempotency_key="checkout-1",
))
```

`PolarProvider` is passed as the `provider` dependency to `boilpayment-lifecycle`,
`boilpayment-refund`, `boilpayment-usage`, and `boilpayment-webhook`.
