xinetzone/SpecWeave / .agents/skills/alipay-payment-integration
alipay-payment-integration
Flagged支付宝开放平台支付产品接入最佳实践。涵盖当面付、订单码支付、App 支付、JSAPI 支付、手机网站支付、电脑网站支付、预授权支付、商家扣款等全场景产品选型与集成指导。 当用户提到"接入支付宝"、"集成支付宝支付"、"对接支付"、"支付宝收款"、"加个支付功能"、"支付宝下单"、"H5 支付"、"小程序支付"、"预授权"、"付款码"、"扫码支付"、"网页支付"、"PC 支付"、"周期扣款"、"自动续费"、"会员订阅"、"连续包月"、"代扣"时,或咨询支付产品相关报错、排查问题时使用此 Skill。
references/code-examples/python/1_通用接口/收单退款冲退完成通知接口代码示例.md
View on GitHub# 收单退款冲退完成通知接口 - PYTHON 示例
## 请求示例
```python
import json
from flask import Flask, request
from alipay.aop.api.util.SignatureUtils import verify_with_rsa
app = Flask(__name__)
# 支付宝公钥
alipay_public_key = "<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->"
# 商户服务端接收支付宝异步通知(alipay.trade.refund.depositback.completed)的处理示例
@app.route("/notify", methods=["POST"])
def notify():
params = request.form.to_dict()
# 从参数中提取签名信息
sign = params.pop("sign", None)
params.pop("sign_type", None)
# 构造待验签字符串
sorted_params = sorted([(k, v) for k, v in params.items() if v])
message = "&".join(f"{k}={v}" for k, v in sorted_params)
# 使用支付宝公钥验签
sign_verified = verify_with_rsa(alipay_public_key, message, sign)
if sign_verified:
# 验签通过,解析业务参数
biz_content = json.loads(params.get("biz_content", "{}"))
# 处理业务逻辑...
# 必须返回纯文本 success 给支付宝,否则支付宝会重发通知
return "success"
else:
# 验签失败
return "fail"
if __name__ == "__main__":
print("服务已启动,监听端口 3000")
app.run(host="0.0.0.0", port=3000)
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |