## Build Locally ### Prepare Query Checks After making changes to the database schema you need to prepare the query checks. ```shell # Start a database docker run -d --name postgres -e POSTGRES_PASSWORD=1234567890 -p 5432:5432 postgres # Set environment variable export DATABASE_URL="postgres://postgres:1234567890@127.0.0.1:5432/stripe" ``` ```shell # Install SQLX CLI (if not already installed) cargo install sqlx_cli # Create database sqlx database create # Run migrations sqlx migrate run --source src/database/migrations ``` ```shell # Dump the schema file cargo sqlx prepare ``` ### Compile binary ```shell cargo build --release ``` ### Test Webhooks To test the webhook implementation you can install the [Stripe CLI](https://stripe.com/docs/stripe-cli). ```shell stripe listen --forward-to localhost:8080/webhooks # Copy the webhook signing secret and set it as environment variable export STRYPE__STRIPE__WEBHOOK_SECRET="whsec_..." # Trigger some events stripe trigger checkout.session.completed ```