Skip to content

ShijayHuo/OpenCashier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

OpenCashier

OpenCashier is an open-source hosted checkout and payment orchestration platform for teams that want one backend to manage merchant APIs, cashier pages, order/refund flows, and provider-specific integrations.

Chinese documentation: README.zh-CN.md

Status: pre-1.0. Current channel status:

  • Alipay: available
  • Stripe: available
  • WeChat Pay: in testing
  • PayPal: not available yet

Why OpenCashier

  • Hosted cashier entry with signed token URLs instead of exposing platform order numbers directly
  • Unified merchant-facing APIs for orders, order queries, cancellations, refunds, and webhook callbacks
  • Platform-managed provider webhooks with downstream merchant notification forwarding and retry backoff
  • Multi-provider abstraction layer that prefers official Node SDKs and falls back to direct API calls when needed
  • pnpm workspace monorepo built with NestJS, Prisma, PostgreSQL, React, and Ant Design

Current Status

Area Status Notes
Merchant API Available Supports create order, query order, close order, refund, and notification retry flows
Hosted cashier Available Signed-token hosted cashier entry with persisted channel session data
Alipay Available Covers real payment creation, query, close, refund, and webhook signature verification
WeChat Pay In testing Mostly reserved scaffolding and direct API integration placeholders
Stripe Available Supports Stripe Hosted Checkout, order query, session expiration or close, refund, and webhook signature verification. Card-only for now
PayPal Not available yet Official Node SDK slot is reserved, but the real transaction flow is not finished

Quick Start

  1. Install dependencies
pnpm install
  1. Start infrastructure
docker compose -f docker-compose.infrastructure.yml up -d
  1. Copy environment variables
cp .env.example .env
  1. Generate Prisma Client and sync the schema
pnpm prisma:generate
pnpm prisma:db:push
  1. Start the development workspace
pnpm dev
  1. Run the merchant-side smoke test
pnpm smoke:merchant

For environment setup, local tunnel usage, default endpoints, seeded demo data, and provider-specific keys, use the docs below instead of the README.

Merchant Quickstart Example

If you want a runnable merchant-side reference instead of the full workspace, try examples/merchant-quickstart/README.md. It shows the Node SDK path for create-order requests, cashierUrl redirect, notification verification, and result-page query fallback in one small app.

If you only need the merchant SDK in your own service, use the npm package path for @opencashier/sdk once the target version is published, and start with the Node SDK guide instead of cloning this monorepo.

It can now provision provider config into the merchant app scope through the admin API, so the default alipay_page path no longer requires apps/web up front. Start pnpm dev:web only if you switch to QR-based channels or prefer managing providers in the UI.

pnpm dev:api
pnpm dev:merchant-quickstart

Then open http://127.0.0.1:4100.

Project Layout

apps/
  api/   # API
  web/   # Cashier admin management
examples/
  merchant-quickstart/  # Runnable merchant-side integration reference
packages/
  sdk/           # Merchant Node/TypeScript SDK
  shared/        # Shared types and constants
  wechatpay-sdk  # WeChat Pay SDK wrapper
docs/            # Internal plans and notes
skills/

Documentation

Most deep-dive docs are currently Chinese-first. English and bilingual documentation contributions are welcome.

Community

About

An open-source unified payment cashier system supporting WeChat Pay, Alipay, Stripe and extensible payment gateways.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors