{"id":20144171,"url":"https://github.com/quansitech/easy-get-flower","last_synced_at":"2025-03-02T23:44:04.213Z","repository":{"id":57698280,"uuid":"503305007","full_name":"quansitech/easy-get-flower","owner":"quansitech","description":"腾讯公益小红花API","archived":false,"fork":false,"pushed_at":"2023-12-04T07:17:22.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T10:50:09.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/quansitech.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":"2022-06-14T10:06:11.000Z","updated_at":"2022-09-02T07:57:37.000Z","dependencies_parsed_at":"2025-01-13T10:42:00.646Z","dependency_job_id":"9b9ff508-1437-40f2-be74-9579f7cf4bfd","html_url":"https://github.com/quansitech/easy-get-flower","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"a71026bfdf96f013ec92fe3e6f237305ecc7c9c8"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quansitech%2Feasy-get-flower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quansitech%2Feasy-get-flower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quansitech%2Feasy-get-flower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quansitech%2Feasy-get-flower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quansitech","download_url":"https://codeload.github.com/quansitech/easy-get-flower/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241587914,"owners_count":19986627,"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-13T22:09:03.903Z","updated_at":"2025-03-02T23:44:04.191Z","avatar_url":"https://github.com/quansitech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quansitech/easy-get-flower\n```text\n腾讯公益小红花API\n```\n\n#### 安装\n\n```php\ncomposer require quansitech/easy-get-flower\n```\n\n\n####  实例化类\n```php\n// 参数说明\n// array $config 腾讯公益小红花相关配置项\n$config = [\n    'appid' =\u003e 'xxx',\n    'key' =\u003e 'xxx',\n    'et' =\u003e 'xxx',\n];\n$get_flower = new \\EasyGetFlower\\Application($config);\n```\n\n#### getUserXhhNum\n```text\n查询用户累计获取小红花数量\n```\n```php\n// 参数说明\n// $openid 用户微信openid\n$openid = 'xxx';\n$get_flower-\u003egetUserXhhNum($openid);\n\n// 返回值说明\n// 返回用户累计小红花数量\n```\n  \n#### hasBillUsed\n```text\n判断业务订单是否已使用\n```\n```php\n// 参数说明\n// $openid 用户微信openid\n// $trans_code 业务订单号，需要以YYYYMMDD开头，不能超过32位\n$openid = 'xxx';\n$trans_code = date('Ymd').'1';\n$get_flower-\u003ehasBillUsed($openid,$trans_code);\n\n// 返回值说明\n// 0 未使用\n// 1 已使用\n```\n  \n#### buildLink\n```text\n生成领花页链接\n```\n```php\n// 参数说明\n// $openid 用户微信openid\n// $trans_code 业务订单号，需要以YYYYMMDD开头，不能超过32位\n// $xhh_num 期望派发的小红花数量\n// $time_expire 订单重试结束时间，格式为YYYY-MM-DD HH:mm:SS，不能超过10分钟，若为空则是当前时间加10分钟\n// jump_type 跳转类型，目前支持H5和MP小程序，默认为H5\n$openid = 'xxx';\n$trans_code = date('Ymd').'1';\n$xhh_num = '1';\n$time_expire = '';\n$jump_type = 'H5';\n$get_flower-\u003ebuildLink($openid,$trans_code,$xhh_num,$time_expire,$jump_type);\n\n// 返回值说明\n// link 领花页链接\n// exchange_id 业务的预发花id\n```\n\n#### 返回错误统一说明\n```php\n// 若接口返回false，说明是正常的业务错误\n// 获取具体错误\n$get_flower-\u003egetError();\n\n// 其它非业务错误直接抛出异常\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquansitech%2Feasy-get-flower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquansitech%2Feasy-get-flower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquansitech%2Feasy-get-flower/lists"}