Payment providers
The framework never hard-codes a processor. Swap the backend without touching your routes.
Built in
MockProvider (dev)Stripe PaddleLemon Squeezy PaystackPayPal GemVaultDodoCrypto
All via stdlib urllib โ no SDKs, no dependencies.
class=kw>from larz.providers class=kw>import StripeProvider
money.enable(app, provider=StripeProvider(api_key="sk_live_...",
webhook_secret="whsec_..."),
base_url="https://yourapp.com")
Point the provider's webhook at /larz/webhook/<provider> โ Larz verifies
the signature, grants the entitlement, and records the invoice. No webhook code to write.
Write your own
Implement two methods:
class=kw>from larz.providers class=kw>import PaymentProvider
class MyProvider(PaymentProvider):
name = "myprovider"
class=kw>def create_checkout(self, subject, sku, cents, success_url, cancel_url):
class=kw>return hosted_checkout_url
class=kw>def parse_webhook(self, req):
class=com># verify signature, then:
class=kw>return {"subject": ..., "sku": ..., "cents": ..., "payment_id": ...}
Accept crypto too: the LarzCoin chain plugs in as a
provider so
@app.paid can take LARZ.