@deploybaseline/paypal
v0.14.0
Published
PayPal emulator for local development and tests: OAuth client credentials, Orders v2, Payments v2, a hosted approval page with sandbox buyers, and Webhooks v1 with SHA256withRSA signatures.
Readme
@deploybaseline/paypal
PayPal emulator for local development and tests: OAuth client credentials, Orders v2, Payments v2, a hosted approval page with sandbox buyers, and Webhooks v1 with SHA256withRSA signatures.
Part of Baseline: local drop-in replacement services for CI and no-network sandboxes.
Usage
npx @deploybaseline/cli start --service paypalPayPal starts only when named in config or with --service. In tests, start it from code:
import { createEmulator } from "@deploybaseline/cli";
const paypal = await createEmulator({ service: "paypal" });
// Point your client at paypal.url
await paypal.close();@paypal/paypal-server-sdk always calls api-m.sandbox.paypal.com, so give it axios' fetch adapter with a fetch that swaps the origin for paypal.url; the docs show the full setup. The default app is baseline-paypal-client-id / baseline-paypal-client-secret.
Documentation
- PayPal docs: SDK setup, auth, orders, the approval page, payments, the emulator clock, failure triggers, webhooks, and seed config
- API reference:
http://localhost:3999/docs/paypalwhile the CLI runs (how it works)
License
Apache-2.0
