{"id":34172341,"url":"https://github.com/chrislzg/wxpayv3","last_synced_at":"2025-12-15T11:49:31.101Z","repository":{"id":57539365,"uuid":"256195117","full_name":"chrislzg/wxpayv3","owner":"chrislzg","description":"微信支付的v3版本，GO语言实现 The v3 version of WeChat Pay, implemented in GO language","archived":false,"fork":false,"pushed_at":"2021-06-11T02:07:14.000Z","size":43,"stargazers_count":34,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-20T05:27:29.379Z","etag":null,"topics":["go","golang","sdk","sdk-go","v3","wechat-pay","wechatpay","weixin","wxpay"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrislzg.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}},"created_at":"2020-04-16T11:29:24.000Z","updated_at":"2024-06-20T05:27:29.380Z","dependencies_parsed_at":"2022-08-30T05:05:11.176Z","dependency_job_id":null,"html_url":"https://github.com/chrislzg/wxpayv3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrislzg/wxpayv3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrislzg%2Fwxpayv3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrislzg%2Fwxpayv3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrislzg%2Fwxpayv3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrislzg%2Fwxpayv3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrislzg","download_url":"https://codeload.github.com/chrislzg/wxpayv3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrislzg%2Fwxpayv3/sbom","scorecard":{"id":280288,"data":{"date":"2025-08-11","repo":{"name":"github.com/chrislzg/wxpayv3","commit":"2580af4b95f8bfe41996a2c2b33ca65d9d55a0e1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/12 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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"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":"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":"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: MIT License: 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":"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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3372 / GHSA-6wxm-mpqj-6jpf"],"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-17T15:37:00.375Z","repository_id":57539365,"created_at":"2025-08-17T15:37:00.376Z","updated_at":"2025-08-17T15:37:00.376Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27750470,"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-12-15T02:00:09.782Z","response_time":96,"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":["go","golang","sdk","sdk-go","v3","wechat-pay","wechatpay","weixin","wxpay"],"created_at":"2025-12-15T11:49:30.502Z","updated_at":"2025-12-15T11:49:31.096Z","avatar_url":"https://github.com/chrislzg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WxPayV3\n微信支付的v3版本，GO语言实现\n\nThe v3 version of WeChat Pay, implemented in GO language\n\n## Install\n`go get -v github.com/chrislzg/wxpayv3`\n\n## Initialize\n```go\npackage main\n\nimport (\n\"wxpay.v3/core\"\n\"wxpay.v3/dto\"\n\"wxpay.v3/ecommerce\"\n)\n\nfunc Test() (core.Client,error) {\n    client, err := ecommerce.NewClient(\u0026core.ClientConf{\n    AppId:    map[dto.TradeType]string{dto.TradeTypeApp: \"${AppId}\", dto.TradeTypeJsApi: \"${AppId}\", dto.TradeTypeXCX: \"${AppId}\", dto.TradeTypeH5: \"${AppId}\"},\n    MchId:    \"${MchId}\",\n    ApiV3Key: \"${APIKEY}\",\n    ApiCert: \u0026core.ApiCert{\n        ApiSerialNo:      \"${APISerialNo}\",\n        ApiPrivateKeyStr: \"${apiPrivateKey}\",\n        ApiCertKey:       \"${apiPublickCert}\",\n    },\n    // 该项是可选项，获取平台证书前可不填\n    PlatCert: \u0026core.PlatformCert{\n        PlatformSerialNo: \"${PlatformSerialNo}\",\n        PlatformCertKey:  \"${platformPublicCert}\",\n    },\n    HttpClient: nil,\n    })\n    if err != nil {\n        return nil, err\n    }\n    return client, nil\n}\n```\n\n## Usage\n```\n/// 获取签名Authorization，由认证类型和签名信息组成\nAuthorization(httpMethod string, urlString string, body []byte) (string, error)\n// 获取签名信息\nToken(httpMethod string, rawUrl string, body []byte) (string, error)\n// 更新平台证书,获取到证书后调用该方法更新平台证书\nUpdatePlatformCert(cert *PlatformCert) error\n// 合单支付\nCombineTransactions(req *dto.CombineTransactionsReq) (*dto.CombineTransactionsResp, error)\n// 提现\nWithdrawFund(req *dto.WithdrawFundReq) (*dto.WithdrawFundResp, error)\n// 提现状态查询\nQueryWithdrawalStatus(req *dto.QueryWithdrawalStatusReq) (*dto.QueryWithdrawalStatusResp, error)\n// 查询账户余额\nQueryFundBalance(req *dto.QueryFundBalanceReq) (*dto.QueryFundBalanceResp, error)\n// 分账\nProfitSharing(req *dto.ProfitSharingReq) (*dto.ProfitSharingResp, error)\n// 分账退回\nReturnProfitSharing(req *dto.ReturnProfitSharingReq) (*dto.ReturnProfitSharingResp, error)\n// 退款\nRefund(req *dto.RefundReq) (*dto.RefundResp, error)\n// 验证Response\nVerifyResponse(httpStatus int, header *http.Header, body []byte) error\n// 验证回调\nVerifyNotify(header *http.Header, body []byte) error\n// 证书和报文解密\nDecrypt(algorithm string, cipherText string, associatedData string, nonce string) ([]byte, error)\n// 下载平台证书\nCertificate() (*dto.CertificateResp, error)\n// 利用api证书私钥对签名串进行签名得到签名值\nSign(message []byte) (string, error)\n// 对支付成功通知进行验签和解密\nHandlePaymentNotify(headerSerial string, headerSignature string, headerTimestamp string, headerNonce string, body []byte) (*dto.PaymentNotifyResp, error)\n// 对分账对账通知验签和解密\nHandleProfitSharingNotify(headerSerial string, headerSignature string, headerTimestamp string, headerNonce string, body []byte) (*dto.ProfitSharingNotifyResp, error)\n// 对退款通知验签和解密\nHandleRefundNotify(headerSerial string, headerSignature string, headerTimestamp string, headerNonce string, body []byte) (*dto.RefundNotifyResp, error)\n// 获取客户端调起支付时请求参数\nBuildTurnUpPaymentArgumentBody(tradeType dto.TradeType, prepayId string) (string, error)\n// 查询分账状态\nQueryProfitSharingStatus(req *dto.QueryProfitSharingStatusReq) (*dto.QueryProfitSharingStatusResp, error)\n```\n## Platform Certification\n在获取平台证书前，初始化client可先不传`PlatCert`配置，调用`Certificate()`获取平台证书后，调用`UpdatePlatformCert`方法更新client的证书\n\n## Contact\n`email: lzg635935643@qq.com`\n\n## Licence\n```\nMIT License\n\nCopyright (c) 2020 chrislzg\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrislzg%2Fwxpayv3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrislzg%2Fwxpayv3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrislzg%2Fwxpayv3/lists"}