wxpay-nodejs-sdk 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -22
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
微信支付 API V3 Node.js SDK,提供类型安全的支付接口封装,支持所有常用支付和分账接口。
|
|
4
4
|
|
|
5
|
+
> **⚠️ 免责声明:本项目为社区开源项目,非微信支付官方 SDK。使用本 SDK 产生的任何问题,本项目不承担任何责任。请以[微信支付官方文档](https://pay.weixin.qq.com/doc/v3/merchant/4012081606.md)为准。**
|
|
6
|
+
|
|
7
|
+
## 官方文档
|
|
8
|
+
|
|
9
|
+
- [微信支付商户平台文档中心](https://pay.weixin.qq.com/doc/v3/merchant/llms.txt)
|
|
10
|
+
- [APIv3 概述](https://pay.weixin.qq.com/doc/v3/merchant/4012081606.md)
|
|
11
|
+
- [签名认证](https://pay.weixin.qq.com/doc/v3/merchant/4012365342.md)
|
|
12
|
+
- [微信支付公钥](https://pay.weixin.qq.com/doc/v3/merchant/4012153196.md)
|
|
13
|
+
- [平台证书](https://pay.weixin.qq.com/doc/v3/merchant/4012068814.md)
|
|
14
|
+
|
|
5
15
|
## 特性
|
|
6
16
|
|
|
7
17
|
- 🚀 **完整的 TypeScript 支持** — 类型定义完善,开发体验友好
|
|
@@ -37,6 +47,7 @@ const client = new WxPayClient({
|
|
|
37
47
|
const jsapi = new JsapiService(client);
|
|
38
48
|
const order = await jsapi.createOrder({
|
|
39
49
|
appid: 'wx1234567890abcdef',
|
|
50
|
+
mchid: '1900000100',
|
|
40
51
|
description: '商品描述',
|
|
41
52
|
out_trade_no: '订单号',
|
|
42
53
|
amount: { total: 100, currency: 'CNY' },
|
|
@@ -49,28 +60,28 @@ console.log(order.data.prepay_id); // 用于前端调起支付
|
|
|
49
60
|
|
|
50
61
|
## 支持的 API
|
|
51
62
|
|
|
52
|
-
| Service
|
|
53
|
-
|
|
54
|
-
| `JsapiService`
|
|
55
|
-
| `AppService`
|
|
56
|
-
| `H5Service`
|
|
57
|
-
| `NativeService`
|
|
58
|
-
| `CombineService`
|
|
59
|
-
| `ProfitSharingService`
|
|
60
|
-
| `PayScoreService`
|
|
61
|
-
| `ParkingService`
|
|
62
|
-
| `BillService`
|
|
63
|
-
| `MerchantTransferService` | 商家转账
|
|
64
|
-
| `CouponService`
|
|
65
|
-
| `ComplaintService`
|
|
66
|
-
| `PartnershipService`
|
|
67
|
-
| `SmartGuideService`
|
|
68
|
-
| `BusinessCircleService`
|
|
69
|
-
| `PayGiftActivityService`
|
|
70
|
-
| `MedInsService`
|
|
71
|
-
| `MediaService`
|
|
72
|
-
| `SecurityService`
|
|
73
|
-
| `CallbackHandler`
|
|
63
|
+
| Service | 说明 |
|
|
64
|
+
| ------------------------- | -------------------------------------- |
|
|
65
|
+
| `JsapiService` | JSAPI 支付 / 小程序支付 |
|
|
66
|
+
| `AppService` | APP 支付 |
|
|
67
|
+
| `H5Service` | H5 支付 |
|
|
68
|
+
| `NativeService` | Native 支付 |
|
|
69
|
+
| `CombineService` | 合单支付(JSAPI/H5/APP/Native/小程序) |
|
|
70
|
+
| `ProfitSharingService` | 分账 |
|
|
71
|
+
| `PayScoreService` | 微信支付分 |
|
|
72
|
+
| `ParkingService` | 微信支付分停车服务 |
|
|
73
|
+
| `BillService` | 账单下载 |
|
|
74
|
+
| `MerchantTransferService` | 商家转账 |
|
|
75
|
+
| `CouponService` | 代金券 |
|
|
76
|
+
| `ComplaintService` | 消费者投诉 |
|
|
77
|
+
| `PartnershipService` | 委托营销 |
|
|
78
|
+
| `SmartGuideService` | 智慧导购 |
|
|
79
|
+
| `BusinessCircleService` | 商圈服务 |
|
|
80
|
+
| `PayGiftActivityService` | 支付有礼 |
|
|
81
|
+
| `MedInsService` | 医保服务 |
|
|
82
|
+
| `MediaService` | 文件上传 |
|
|
83
|
+
| `SecurityService` | 安全服务 |
|
|
84
|
+
| `CallbackHandler` | 回调通知验签与解密 |
|
|
74
85
|
|
|
75
86
|
## 回调通知处理
|
|
76
87
|
|
|
@@ -113,6 +124,25 @@ try {
|
|
|
113
124
|
- [支付流程](docs/flow.md) — 支付流程说明
|
|
114
125
|
- [常见问题](docs/faq.md) — FAQ
|
|
115
126
|
|
|
127
|
+
## 免责声明
|
|
128
|
+
|
|
129
|
+
1. 本项目为**社区开源项目**,由开发者个人维护,**非微信支付官方 SDK**。
|
|
130
|
+
2. 本项目仅提供对微信支付 API 的封装,不保证接口的完整性、准确性和时效性。
|
|
131
|
+
3. 使用本 SDK 前,请务必仔细阅读并遵守[微信支付官方文档](https://pay.weixin.qq.com/doc/v3/merchant/4012081606.md)中的相关规则和要求。
|
|
132
|
+
4. 因使用本 SDK 产生的任何直接或间接损失(包括但不限于资金损失、业务中断等),本项目及作者不承担任何责任。
|
|
133
|
+
5. 本项目不对微信支付 API 的变更、下线或其他调整做任何保证,开发者应及时关注官方文档更新。
|
|
134
|
+
6. 在生产环境使用前,请务必进行充分的测试验证。
|
|
135
|
+
|
|
136
|
+
如有疑问,请优先查阅[微信支付官方文档](https://pay.weixin.qq.com/doc/v3/merchant/4012081606.md)或联系微信支付技术支持。
|
|
137
|
+
|
|
116
138
|
## 许可证
|
|
117
139
|
|
|
118
140
|
MIT
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
**微信支付官方资源**
|
|
145
|
+
|
|
146
|
+
- [微信支付商户平台](https://pay.weixin.qq.com/)
|
|
147
|
+
- [微信支付开发者文档](https://pay.weixin.qq.com/doc/v3/merchant/4012081606.md)
|
|
148
|
+
- [微信支付 APIv3 SDK(官方)](https://github.com/wechatpay-apiv3)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wxpay-nodejs-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "微信支付 API V3 Node.js SDK",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -37,7 +37,9 @@
|
|
|
37
37
|
"release:minor": "standard-version --release-as minor",
|
|
38
38
|
"release:major": "standard-version --release-as major",
|
|
39
39
|
"release:patch": "standard-version --release-as patch",
|
|
40
|
-
"release:dry": "standard-version --dry-run"
|
|
40
|
+
"release:dry": "standard-version --dry-run",
|
|
41
|
+
"publish:npm": "standard-version --release-as minor && npm run build && npm publish --registry https://registry.npmjs.org/",
|
|
42
|
+
"publish:beta": "standard-version --prerelease beta && npm run build && npm publish --tag beta --registry https://registry.npmjs.org/"
|
|
41
43
|
},
|
|
42
44
|
"lint-staged": {
|
|
43
45
|
"*.ts": [
|