A collection of Cloudflare Workers for various automation tasks
简体中文 • Features • Workers • Deployment • Contributing • License
- 🚀 Serverless: Powered by Cloudflare Workers
- ⚡ Fast: Edge computing with global distribution
- 🔒 Secure: Built-in signature verification
- 🎯 Lightweight: Minimal dependencies
- 🛠️ Easy to Deploy: Simple configuration and deployment
A Cloudflare Worker that receives epay payment callbacks and forwards them to webhook endpoints (e.g., WeCom/DingTalk).
Features:
- ✅ MD5 signature verification
- ✅ Support for GET/POST requests
- ✅ Multiple content-type support (JSON, form-urlencoded, multipart/form-data)
- ✅ Customizable webhook fields
- ✅ Markdown formatted notifications
Environment Variables:
| Variable | Required | Description | Example |
|---|---|---|---|
EPAY_SECRET |
✅ | Epay secret key for signature verification | your_secret_key |
EPAY_PID |
✅ | Epay partner ID | 1001 |
WEBHOOK_URL |
✅ | Webhook URL for notifications | https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx |
WEBHOOK_TITLE |
❌ | Custom notification title | 支付通知 (default) |
WEBHOOK_FIELDS |
❌ | Comma-separated fields to include | name,money (default) |
Usage Example:
# Callback URL (replace with your worker URL)
https://your-worker.your-subdomain.workers.dev
# The worker will:
# 1. Verify the signature
# 2. Check the PID
# 3. Forward to your webhook with formatted message- Node.js (v16 or higher)
- Wrangler CLI
- Cloudflare account
- Clone the repository
git clone https://github.com/OVINC-CN/CFWorker.git
cd CFWorker- Navigate to the worker directory
cd epay-callback-notify- Configure environment variables
# Set up secrets using Wrangler
wrangler secret put EPAY_SECRET
wrangler secret put EPAY_PID
wrangler secret put WEBHOOK_URL
# Optional: Set custom title and fields
wrangler secret put WEBHOOK_TITLE
wrangler secret put WEBHOOK_FIELDS- Deploy
wrangler deploy- Copy the code from
epay-callback-notify/index.js - Go to Cloudflare Dashboard
- Navigate to Workers & Pages > Create application
- Paste the code and configure environment variables
- Deploy
# Install Wrangler
npm install -g wrangler
# Start local dev server
wrangler dev
# Test the endpoint
curl -X POST http://localhost:8787 \
-H "Content-Type: application/json" \
-d '{"pid":"1001","name":"test","money":"100","sign":"..."}'CFWorker/
├── LICENSE
├── README.md
└── epay-callback-notify/
└── index.js # Worker implementation
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Cloudflare Workers
- All contributors who help improve this project
Made with ❤️ by OVINC-CN