{"id":13598892,"url":"https://github.com/notadd/nt-addon-pay","last_synced_at":"2025-10-25T20:44:57.884Z","repository":{"id":33267328,"uuid":"155672953","full_name":"notadd/nt-addon-pay","owner":"notadd","description":"Notadd 支付插件","archived":false,"fork":false,"pushed_at":"2024-12-13T05:48:09.000Z","size":1472,"stargazers_count":78,"open_issues_count":23,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-30T05:51:55.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notadd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-01T06:41:53.000Z","updated_at":"2025-05-24T16:32:23.000Z","dependencies_parsed_at":"2025-03-23T16:07:13.193Z","dependency_job_id":"4ce4f5de-3319-476e-be5c-84f38ea0dba2","html_url":"https://github.com/notadd/nt-addon-pay","commit_stats":{"total_commits":161,"total_committers":4,"mean_commits":40.25,"dds":0.03105590062111796,"last_synced_commit":"d7ab0b01a6f84dda0a78304464f20bc4293354ad"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/notadd/nt-addon-pay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-addon-pay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-addon-pay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-addon-pay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-addon-pay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notadd","download_url":"https://codeload.github.com/notadd/nt-addon-pay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notadd%2Fnt-addon-pay/sbom","scorecard":{"id":694867,"data":{"date":"2025-08-11","repo":{"name":"github.com/notadd/nt-addon-pay","commit":"d7ab0b01a6f84dda0a78304464f20bc4293354ad"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"84 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cj7v-w2c7-cp7c","Warn: Project is vulnerable to: GHSA-4jpv-8r57-pv7j","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-42xw-2xvc-qx8m","Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99","Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-qx4v-6gc5-f2vv","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-44fp-w29j-9vj5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-332q-7ff2-57h2","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T03:23:19.476Z","repository_id":33267328,"created_at":"2025-08-22T03:23:19.476Z","updated_at":"2025-08-22T03:23:19.476Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001290,"owners_count":26083058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T17:00:57.825Z","updated_at":"2025-10-09T11:18:01.609Z","avatar_url":"https://github.com/notadd.png","language":"TypeScript","readme":"# Notadd 支付插件\n\n整合微信支付API、支付宝支付API，基于 Nest.js 框架构建的一个支付插件。\n\n## 使用说明\n\n使用前，请确保了解微信支付、支付宝支付的各类支付流程，且具备基本的 `debug` 能力。\n\n### 安装\n\n`npm install @notadd/addon-pay`\n\n### 配置 PayAddon\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { PayAddon } from '@notadd/addon-pay';\n\n@Module({\n  imports: [\n    PayAddon.forRoot({\n        wechatConfig: {\n            appid: 'appid',     // 公众号appi/应用appid/小程序appid\n            mch_id: 'mch_id',   // 商户号\n            secretKey: 'secretKey', // 商户交易秘钥\n            sign_type: 'MD5',       // 微信支付签名类型('MD5' | 'HMAC-SHA256')，默认MD5，配置后，所有接口参数均会使用这个签名类型\n            pfx: fs.readFileSync('path_to_p12_file'),   // p12文件\n            sandbox: true   // 是否启用沙箱环境，默认不启用，用于商户支付验收测试\n        }\n    })\n  ]\n})\nexport class ApplicationModule {}\n```\n\n### 微信支付\n\n接口使用前的必要声明：\n\n1. 所有的接口请求参数和接口返回结果中的属性名全部使用的是 **`snake_case`**，其中属性名结尾带 **`?`** 的代表这个属性是可选的(非必填)。\n2. 所有与金额相关的数据全部是 **`number`** 类型且单位为 **`分`**，需自行转换。\n3. 所有接口参数中的 `mch_id`、`appid/wxappid`、`nonce_str`、`sign_type`、`sign` 数据均由插件自动填入，无需手动传入。\n4. 所有请求的返回结果若有 `sign`，插件会自动验签。\n5. 支付通知结果插件会自动验签，退款通知结果插件会自动解密 `req_info` 数据。\n6. 微信 `接口` 调用的返回结果、`回调通知` 的返回结果中的 **金额**、**数量** 的类型会因 `xml2js` 工具解析后全部转换为字符串，需开发者手动转换类型。\n\n#### 使用 WeChat`XXX`PayService 调用 API\n\nWeChat`XXX`PayService 类包含当前支付方式的支付、订单、退款相关 API，各支付类说明：\n\n- WeChatAppPayService —— APP支付\n- WeChatAppletPayService —— 小程序支付\n- WeChatJSAPIPayService —— JSAPI支付（用户通过微信扫码、关注公众号等方式进入商家H5页面，并在微信内调用JSSDK完成支付）\n- WeChatMicroPayService —— 付款码支付（用户打开微信钱包-付款码的界面，商户扫码后提交完成支付）\n- WeChatNativePayService —— Native支付（扫码支付）\n- WeChatWapPayService —— H5支付（用户在微信以外的手机浏览器请求微信支付的场景唤起微信支付）\n- WeChatRedpackService —— 现金红包\n- WeChatTransferService —— 企业付款\n\n例子：Native支付（扫码支付）调用方式如下\n\n```typescript\nimport { Injectable, Inject } from '@nestjs/common';\nimport { WeChatNativePayService, WeChatTradeType } from '@notadd/addon-pay';\n\n@Injectable()\nexport class TestPay {\n    constructor(@Inject(WeChatNativePayService) private readonly weChatNativePayService: WeChatNativePayService) { }\n\n    async nativePay() {\n        const ressult = await this.weChatNativePayService.pay({\n            body: '支付一下',\n            out_trade_no: '201811271512000001',\n            total_fee: 301,\n            spbill_create_ip: '127.0.0.1',  // 支付请求方IP\n            notify_url: 'your.domain.com/payment/wechat_order_notify',  // 服务端支付通知地址\n            trade_type: WeChatTradeType.JSAPI\n        });\n    }\n}\n```\n\n#### 使用 WeChatNotifyParserUtil 解析支付/退款通知\n\n支付/退款完成后，微信会把相关支付/退款结果和用户信息发送给商户，商户需要接收处理，并返回应答。\n\n对后台通知交互时，如果微信收到商户的应答不是成功或超时，微信认为通知失败，微信会通过一定的策略定期重新发起通知，尽可能提高通知的成功率，但微信不保证通知最终能成功。（通知频率为15/15/30/180/1800/1800/1800/1800/3600，单位：秒）\n\n注意：同样的通知可能会多次发送给商户系统。商户系统必须能够正确处理重复的通知。\n\n推荐的做法是，当收到通知进行处理时，首先检查对应业务数据的状态，判断该通知是否已经处理过，如果没有处理过再进行处理，如果处理过直接返回结果成功。在对业务数据进行状态检查和处 理前，要采用数据锁进行并发控制，以避免函数重入造成的数据混乱。\n\n```typescript\nimport { Controller, Inject, Post, Req, Res } from '@nestjs/common';\n\nimport { WeChatNotifyParserUtil } from '@notadd/addon-pay';\n\n@Controller('payment')\nexport class PaymentNotifyController {\n    constructor(\n        @Inject(WeChatNotifyParserUtil) private readonly weChatNotifyParserUtil: WeChatNotifyParserUtil\n    ) { }\n\n    /**\n     * 微信支付统一下单通知路由\n     *\n     * 特别提醒：商户系统对于支付结果通知的内容一定要做签名验证,并校验返回的订单金额是否与商户侧的订单金额一致，防止数据泄漏导致出现“假通知”，造成资金损失。\n     *\n     * 技术人员可登进微信商户后台扫描加入接口报警群。\n     *\n     * @param req 通知请求\n     */\n    @Post('wechat_order_notify')\n    async weChatOrderNotify(@Req() req, @Res() res) {   // 必须使用 @Res() 注解向微信返回结果\n        // 当 data 为 undefined 时，表示通知请求中的 sign 验签失败\n        const data = await this.weChatNotifyParserUtil.parsePayNotify(req);\n\n        // 验签失败时\n        if (!data) {\n            // 微信会重新发起通知\n            res.end(this.weChatNotifyParserUtil.generateFailMessage('验签失败'));   // 必须使用 res.end() 向微信返回当前业务结果;\n        }\n\n        // 判断返回状态，失败时\n        if(data.return_code === 'FAIL') {\n            // 处理业务数据\n            // ......\n\n            // 根据情况返回成功或失败消息\n        }\n\n        // 判断业务状态，失败时\n        if(data.result_code === 'FAIL') {\n            // 处理业务数据\n            // ......\n\n            // 根据情况返回成功或失败消息\n        }\n\n        // 成功时返回\n        res.end(this.weChatNotifyParserUtil.generateSuccessMessage());  // 必须使用 res.end() 向微信返回当前业务结果;\n    }\n\n    /**\n     * 微信支付退款通知路由\n     *\n     * 特别说明：退款结果对重要的数据进行了加密，商户需要用商户秘钥进行解密后才能获得结果通知的内容。\n     *\n     * @param req 通知请求\n     */\n    @Post('wechat_refund_notify')\n    async weChatRefundNotify(@Req() req) {\n        // 当 data 为 undefined 时，表示通知请求中的 req_info 解密失败\n        const data = await this.weChatNotifyParserUtil.parseRefundNotify(req);\n\n        // 解密失败时\n        if (!data) {\n            // 微信会重新发起通知\n            return this.weChatNotifyParserUtil.generateFailMessage('解密失败');\n        }\n\n        // 判断返回状态，失败时\n        if(data.return_code === 'FAIL') {\n            // 处理业务数据\n            // ......\n\n            // 根据情况返回成功或失败消息\n        }\n\n        // 成功时返回\n        return this.weChatNotifyParserUtil.generateSuccessMessage();\n    }\n}\n```\n\n#### 使用 WeChatSignUtil 计算签名\n\n在个别支付方式中，需要服务端计算签名并返回给客户端时，使用插件提供的 `WeChatSignUtil` 工具类即可计算签名:\n\n```typescript\nimport { Injectable, Inject } from '@nestjs/common';\nimport { WeChatSignUtil } from '@notadd/addon-pay';\n\n@Injectable()\nexport class TestSign {\n    constructor(@Inject(WeChatSignUtil) private readonly weChatSignUtil: WeChatSignUtil) { }\n\n    async testWechatSign() {\n        const params = { appid: 'xxxxx', openid: 'xxxxx' };\n        const sign = await this.weChatSignUtil.sign(params);\n    }\n}\n```\n\n#### 如何使用支付验收 case ？\n\n两种方式，如下：\n\n1. 关注微信公众号：微信支付商户接入验收助手，并查阅相应支付验收 case 示例。\n2. 下载支付验收case示例 pdf 文档。地址：[免充值产品测试验收用例](https://pay.weixin.qq.com/wiki/doc/api/download/mczyscsyl.pdf) 。\n\n### 支付宝支付\n\n*TODO*\n\n### 随机字符生成工具\n\n支付插件内使用了 [nanoid](https://github.com/ai/nanoid) 作为随机字符生成工具，开发者可以通过注入 `RandomUtil`，即可使用该工具。\n\n```typescript\nimport { Injectable, Inject } from '@nestjs/common';\nimport { RandomUtil } from '@notadd/addon-pay';\n\n@Injectable()\nexport class TestSign {\n    constructor(@Inject(RandomUtil) private readonly randomUtil: RandomUtil) { }\n\n    async testRandomStr() {\n        /**\n         * genRandomStr(pool?: string, length?: number) 接受两个参数：\n         *\n         * pool 随机字符池，默认：ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\n         *\n         * length 随机字符长度，默认：32\n         */\n        const randomStr = await this.randomUtil.genRandomStr();\n    }\n}\n```\n\n## 贡献说明\n\n我们欢迎 Nest.js 使用者来参与这个插件的开发，作为一个贡献者，请您遵循以下原则：\n\n- 代码提交规范，参考 [Git Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#)\n- 始终从 develop checkout 一个新分支，命名规范为 feature/xxx，xxx 必须具有可读性，如：微信-普通商户版-扫码支付 =\u003e feature/wechat-native-pay\n- 在 checkout 新分支前，先在本地 develop 分支拉取远程 develop 分支的最新代码\n- 文件命名规则请参考项目目前的命名规则，如：微信支付中，order.interface.ts 代表所有订单相关的请求参数和返回结果的定义，micro.pay.service.ts 代表付款码支付的业务逻辑\n\n## 功能开发\n\n请先查阅 Roadmap，确保你想贡献的功能没有正在被实现。然后在 **issue** 里提交一个贡献请求，注明想要贡献的功能。\n\n## 发现 Bug ？\n\n如果你在源码中发现bug，请你先在本仓库的 **issue** 提交一个bug问题。在你提交完bug问题后，我们很乐意接受你提交一个 **PR** 来帮助我们修复这个bug。\n\n## QQ 交流群\n\n322247106，请注明加群目的！\n\n## Roadmap\n\n- [x] **0.0.1** 贡献说明\n- [x] **0.1.0** 微信-普通商户版-APP支付\n- [x] **0.2.0** 微信-普通商户版-JSAPI支付、微信-普通商户版-Native支付、微信-普通商户版-H5支付、微信-普通商户版-小程序支付\n- [x] **0.3.0** 微信-普通商户版-付款码支付\n- [x] **0.4.0** 微信-普通商户版-现金红包\n- [x] **0.5.0** 微信-普通商户版-企业付款\n- [ ] **0.6.0** 支付宝-APP支付\n- [ ] **0.7.0** 支付宝-当面付\n- [ ] **0.8.0** 支付宝-手机网站支付\n- [ ] **0.9.0** 支付宝-电脑网站支付\n- [ ] **1.0.0** 完善使用说明、发布正式版v1.0.0","funding_links":[],"categories":["资源"],"sub_categories":["集成"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotadd%2Fnt-addon-pay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotadd%2Fnt-addon-pay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotadd%2Fnt-addon-pay/lists"}