Skip to content

stripe-samples/machine-payments

Machine payments

This repository demonstrates how to implement machine-to-machine payments using different protocols:

  • MPP — The Machine Payments Protocol using using on-chain crypto payments
  • x402 — The x402 HTTP payment protocol using on-chain crypto payments

Prerequisites

  • Stripe account with the relevant features enabled. Reach out to machine-payments@stripe.com to get setup.
  • For MPP: Wallet with testnet funds (Tempo Moderato)
  • For x402: Wallet with testnet USDC (Base Sepolia)

Getting Started

  1. Clone this repository:
git clone https://github.com/stripe-samples/machine-payments
cd machine-payments
  1. Copy the environment template:
cp .env.template .env
# Edit .env with your credentials
  1. Install dependencies for all samples:
make install
  1. 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
  1. Follow the README in your chosen integration directory for the sample-specific make run command and test request:

Support

License

MIT