xinetzone/SpecWeave / .agents/skills/alipay-payment-integration
alipay-payment-integration
Flagged支付宝开放平台支付产品接入最佳实践。涵盖当面付、订单码支付、App 支付、JSAPI 支付、手机网站支付、电脑网站支付、预授权支付、商家扣款等全场景产品选型与集成指导。 当用户提到"接入支付宝"、"集成支付宝支付"、"对接支付"、"支付宝收款"、"加个支付功能"、"支付宝下单"、"H5 支付"、"小程序支付"、"预授权"、"付款码"、"扫码支付"、"网页支付"、"PC 支付"、"周期扣款"、"自动续费"、"会员订阅"、"连续包月"、"代扣"时,或咨询支付产品相关报错、排查问题时使用此 Skill。
references/code-examples/nodejs/3_订单码支付/统一收单线下交易预创建接口代码示例.md
View on GitHub# 统一收单线下交易预创建接口 - NODEJS 示例
## 请求示例
```javascript
const { AlipaySdk } = require("alipay-sdk");
const alipaySdk = new AlipaySdk({
appId: "<-- 请填写您的AppId,例如:2019091767145019 -->",
privateKey: "<-- 请填写您的应用私钥,例如:MIIEvQIBADANB ... ... -->",
alipayPublicKey: "<-- 请填写您的支付宝公钥,例如:MIIBIjANBg... -->",
gateway: "https://openapi.alipay.com/gateway.do",
appAuthToken: "<-- 请填写应用授权令牌 -->",
});
const result = await alipaySdk.exec("alipay.trade.precreate", {
bizContent: {
out_trade_no: "20150320010101001",
total_amount: "88.88",
subject: "Iphone6 16G",
product_code: "FACE_TO_FACE_PAYMENT",
seller_id: "2088102146225135",
body: "Iphone6 16G",
timeout_express: "90m",
time_expire: "2016-12-31+10:05:01",
goods_detail: [
{
goods_name: "ipad",
alipay_goods_id: "20010001",
quantity: 1,
price: "2000",
goods_id: "apple-01",
goods_category: "34543238",
categories_tree: "124868003|126232002|126252004",
show_url: "http://www.alipay.com/xxx.jpg",
},
],
extend_params: {
sys_service_provider_id: "2088511833207846",
hb_fq_seller_percent: "100",
hb_fq_num: "3",
industry_reflux_info:
'{"scene_code":"metro_tradeorder","channel":"xxxx","scene_data":{"asset_name":"ALIPAY"}}',
royalty_freeze: "true",
card_type: "S0JP0000",
},
business_params: '{"mc_create_trade_ip":"127.0.0.1"}',
store_id: "NJ_001",
operator_id: "yx_001",
terminal_id: "NJ_T_001",
merchant_order_no: "20161008001",
ext_user_info: {
cert_type: "IDENTITY_CARD",
cert_no: "362334768769238881",
mobile: "16587658765",
name: "李明",
min_age: "18",
need_check_info: "F",
identity_hash:
"27bfcd1dee4f22c8fe8a2374af9b660419d1361b1c207e9b41a754a113f38fcc",
},
query_options: ["discount_goods_detail"],
},
});
```
## 响应示例
### 正常示例
```json
{
"alipay_trade_precreate_response": {
"code": "10000",
"msg": "Success",
"out_trade_no": "6823789339978248",
"qr_code": "https://qr.alipay.com/bavh4wjlxf12tper3a"
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}
```
### 异常示例
```json
{
"alipay_trade_precreate_response": {
"code": "20000",
"msg": "Service Currently Unavailable",
"sub_code": "isp.unknow-error",
"sub_msg": "系统繁忙"
},
"sign": "ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}
```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 |