Files
taiji-AI-PAD/scripts/start_ngrok_tunnel.sh
2026-03-15 15:30:24 +00:00

39 lines
1.1 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# PayPal Webhook 测试 - 使用 ngrok 创建 HTTPS 隧道
#
# 使用方法:
# 1. 首次使用需要注册 ngrok 账号并配置 authtoken:
# ngrok config add-authtoken <your-authtoken>
#
# 2. 运行此脚本:
# ./scripts/start_ngrok_tunnel.sh
#
# 3. 复制 ngrok 生成的 HTTPS URL,在 PayPal Developer Dashboard 配置 Webhook:
# https://xxxx.ngrok-free.app/whitelist/payment/callback/paypal
set -e
# MCP Server 端口(Docker 映射端口为 8002)
MCP_PORT=${MCP_PORT:-8002}
echo ""
echo "=========================================="
echo "PayPal Webhook 测试 - ngrok HTTPS 隧道"
echo "=========================================="
echo ""
echo "正在为本地端口 $MCP_PORT 创建 HTTPS 隧道..."
echo ""
echo "启动后,请在 PayPal Developer Dashboard 配置 Webhook URL:"
echo " https://<ngrok-url>/whitelist/payment/callback/paypal"
echo ""
echo "选择以下事件类型:"
echo " - PAYMENT.CAPTURE.COMPLETED"
echo " - PAYMENT.CAPTURE.DENIED"
echo " - PAYMENT.CAPTURE.REFUNDED"
echo ""
echo "=========================================="
echo ""
# 启动 ngrok
ngrok http $MCP_PORT