Skip to main content

Create, update and delete stripe webhooks with your app deployment

Project description

cloudcomponents Logo

@cloudcomponents/cdk-stripe-webhook

Build Status cdkdx typescript python

Create, update and delete stripe webhooks with your app deployment

Install

TypeScript/JavaScript:

npm i @cloudcomponents/cdk-stripe-webhook

Python:

pip install cloudcomponents.cdk-stripe-webhook

How to use

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from aws_cdk.core import Construct, Stack, StackProps
from aws_cdk.aws_apigateway import RestApi
from cloudcomponents.cdk_stripe_webhook import StripeWebhook

class StripeWebhookStack(Stack):
    def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, synthesizer=None, terminationProtection=None):
        super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, synthesizer=synthesizer, terminationProtection=terminationProtection)

        api = RestApi(self, "Endpoint")
        api.root.add_method("POST")

        secret_key = process.env.SECRET_KEY

        events = ["charge.failed", "charge.succeeded"]

        StripeWebhook(self, "StripeWebhook",
            secret_key=secret_key,
            url=api.url,
            events=events,
            log_level="debug"
        )

API Reference

See API.md.

Example

See more complete examples.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cloudcomponents.cdk-stripe-webhook, version 1.0.56
Filename, size File type Python version Upload date Hashes
Filename, size cloudcomponents.cdk_stripe_webhook-1.0.56-py3-none-any.whl (379.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size cloudcomponents.cdk-stripe-webhook-1.0.56.tar.gz (380.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page