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
- Stripe account with the relevant features enabled.
- For MPP: @stripe/link-cli or Tempo wallet
- For x402: Wallet with USDC on Base
- 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:
make install- Common repository-wide commands:
make install— install dependencies for every sample in the repomake lint— run each sample's linter and formatting checksmake format— apply automatic formatting fixes in each samplemake typecheck— run type checking or build validation for each samplemake test— run the automated test suite for each samplemake ci— run the full per-sample CI command (install,lint,typecheck, andtest)
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 runcommand and test request:
MIT