#!/usr/bin/env bash

set -euo pipefail

KEY=$1
shift

DOMAIN=$1
shift

curl \
    https://api.stripe.com/v1/webhook_endpoints \
    -u "${KEY}:" \
    -d url="https://payments.${DOMAIN}/v1/stripe/webhook" \
    -d "enabled_events[]"="checkout.session.completed"