{"id":19001721,"url":"https://github.com/ledccn/wechatpay-profit-sharing","last_synced_at":"2025-04-22T17:48:44.962Z","repository":{"id":257825439,"uuid":"872299681","full_name":"ledccn/wechatpay-profit-sharing","owner":"ledccn","description":"微信支付普通直连分账","archived":false,"fork":false,"pushed_at":"2024-11-29T08:26:28.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T17:23:57.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ledccn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-14T07:44:37.000Z","updated_at":"2024-11-29T08:26:06.000Z","dependencies_parsed_at":"2024-10-17T13:57:18.977Z","dependency_job_id":null,"html_url":"https://github.com/ledccn/wechatpay-profit-sharing","commit_stats":null,"previous_names":["ledccn/wechatpay-profit-sharing"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledccn%2Fwechatpay-profit-sharing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledccn%2Fwechatpay-profit-sharing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledccn%2Fwechatpay-profit-sharing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ledccn%2Fwechatpay-profit-sharing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ledccn","download_url":"https://codeload.github.com/ledccn/wechatpay-profit-sharing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249283006,"owners_count":21243658,"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","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-11-08T18:12:27.574Z","updated_at":"2025-04-16T22:31:22.864Z","avatar_url":"https://github.com/ledccn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 微信支付普通直连分账\n\n## 安装\n\n`composer require ledc/wechatpay-profit-sharing`\n\n## 使用说明\n\n开箱即用，只需要传入一个配置，初始化一个实例即可：\n\n```php\nuse Ledc\\WechatPayProfitSharing\\Config;\nuse Ledc\\WechatPayProfitSharing\\ProfitService;\n\n$config = [\n    'mch_id' =\u003e 1360649000,\n    'appid' =\u003e 1360649000,\n\n    // 商户证书\n    'private_key' =\u003e __DIR__ . '/certs/apiclient_key.pem',\n    'certificate' =\u003e __DIR__ . '/certs/apiclient_cert.pem',\n\n     // v3 API 秘钥\n    'secret_key' =\u003e '43A03299A3C3FED3D8CE7B820Fxxxxx',\n\n    // v2 API 秘钥\n    'v2_secret_key' =\u003e '26db3e15cfedb44abfbb5fe94fxxxxx',\n\n    // 平台证书：微信支付 APIv3 平台证书，需要使用工具下载\n    // 下载工具：https://github.com/wechatpay-apiv3/CertificateDownloader\n    'platform_certs' =\u003e [\n        // 请使用绝对路径\n        // '/path/to/wechatpay/cert.pem',\n    ],\n];\n\n$profitService = new ProfitService(new Config($config));\n```\n\n在创建实例后，所有的方法都可以有IDE自动补全；例如：\n\n```php\n// 添加分账接收方\n$profitService-\u003eaddReceiver();\n// 删除分账接收方\n$profitService-\u003eremoveReceiver();\n// 请求单次分账（请求需要双向证书）\n$profitService-\u003esingle();\n// 请求多次分账（请求需要双向证书）\n$profitService-\u003emulti();\n// 查询分账结果\n$profitService-\u003equery();\n// 完结分账（请求需要双向证书）\n$profitService-\u003efinish();\n// 查询订单待分账金额\n$profitService-\u003eorderAmountQuery();\n// 分账回退（请求需要双向证书）\n$profitService-\u003ereturn();\n// 回退结果查询\n$profitService-\u003ereturnQuery();\n```\n\n## 官方文档\n\n- https://pay.weixin.qq.com/wiki/doc/api/allocation.php?chapter=26_1\n\n## 捐赠\n\n![reward](reward.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fledccn%2Fwechatpay-profit-sharing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fledccn%2Fwechatpay-profit-sharing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fledccn%2Fwechatpay-profit-sharing/lists"}