This repository demonstrates how to implement machine-to-machine payments using different protocols:
- MPP — The Machine Payments Protocol using both Shared Payment Tokens for card payments as well as on-chain crypto payments
- x402 — The x402 HTTP payment protocol using on-chain crypto payments
- Clone this repository:
git clone https://github.com/stripe-samples/machine-payments
cd machine-payments
- Copy the environment template:
cp .env.template .env
# Edit .env with your credentials
- Install dependencies for all samples:
- Common repository-wide commands:
- make install — install dependencies for every sample in the repo
- make lint — run each sample's linter and formatting checks
- make format — apply automatic formatting fixes in each sample
- make typecheck — run type checking or build validation for each sample
- make test — run the automated test suite for each sample
- make ci — run the full per-sample CI command (install, lint, typecheck, and test)
make install
make lint
make format
make typecheck
make test
make ci
- Follow the README in your chosen integration directory for the sample-specific make run command and test request:
MIT