>红包钩子使用场景:当有商户给用户发送红包成功后,会触发该钩子 | 标题 | 名称 | 钩子描述 | | --- | --- | --- | | 微信红包 | wechat_redpack| 当有用户发送红包成功后,会触发该钩子 | ``` function functionName($data) ``` >[info]$data 当发放红包成功后返回的参数, | 字段名 | 变量名 | 示例值 | 类型 | 描述 | | --- | --- | --- | --- | --- | --- | | 商户订单号 | mch\_billno | 10000098201411111234567890 | String(28) | 商户使用查询API填写的商户单号的原路返回 | | 商户号 | mch\_id | 10000098 | String(32) | 微信支付分配的商户号 | | 红包单号 | detail\_id | 1000000000201503283103439304 | String(32) | 使用API发放现金红包时返回的红包单号 | | 红包状态 | status | RECEIVED | string(16) | SENDING:发放中 SENT:已发放待领取 FAILED:发放失败 RECEIVED:已领取 RFUND\_ING:退款中 REFUND:已退款 | | 发放类型 | send\_type | API | String(32) | API:通过API接口发放 UPLOAD:通过上传文件方式发放 ACTIVITY:通过活动方式发放 | | 红包类型 | hb\_type | GROUP | String(32) | GROUP:裂变红包 NORMAL:普通红包 | | 红包个数 | total\_num | 1 | int | 红包个数 | | 红包金额 | total\_amount | 5000 | int | 红包总金额(单位分) | | 失败原因 | reason | 余额不足 | String(32) | 发送失败原因 | | 红包发送时间 | send\_time | 2015-04-21 20:00:00 | String(32) |   | | 红包退款时间 | refund\_time | 2015-04-21 23:03:00 | String(32) | 红包的退款时间(如果其未领取的退款) | | 红包退款金额 | refund\_amount | 8000 | Int | 红包退款金额 | | 祝福语 | wishing | 新年快乐 | String(128) | 祝福语 | | 活动描述 | remark | 新年红包 | String(256) | 活动描述,低版本微信可见 | | 活动名称 | act\_name | 新年红包 | String(32) | 发红包的活动名称 | | 裂变红包领取列表 | hblist | 内容如下表 |   | 裂变红包的领取列表 | | 领取红包的Openid | openid | ohO4GtzOAAYMp2yapORH3dQB3W18 | String(32) | 领取红包的openid | | 金额 | amount | 100 | int | 领取金额 | | 接收时间 | rcv\_time | | 2015-04-21 20:00:00 | String(32) | 领取红包的时间 | ### 普通红包数据: ~~~ array(15) { ["return_code"] => string(7) "SUCCESS" ["return_msg"] => string(2) "OK" ["result_code"] => string(7) "SUCCESS" ["err_code"] => string(7) "SUCCESS" ["err_code_des"] => string(2) "OK" ["mch_billno"] => string(20) "cowcms20190320182200" ["mch_id"] => string(10) "1225084602" ["detail_id"] => string(31) "1000041701201903203000126887405" ["status"] => string(8) "RECEIVED" ["send_type"] => string(3) "API" ["hb_type"] => string(6) "NORMAL" ["total_num"] => string(1) "1" ["total_amount"] => string(3) "100" ["send_time"] => string(19) "2019-03-20 18:26:24" ["hblist"] => array(1) { ["hbinfo"] => array(3) { ["openid"] => string(28) "o4KFnuLOwsQR9tDusUk0ZBherrrr" ["amount"] => string(3) "100" ["rcv_time"] => string(19) "2019-03-20 18:58:02" } } } ~~~ #### 裂变红包数据 ~~~ array(15) { ["return_code"] => string(7) "SUCCESS" ["return_msg"] => string(2) "OK" ["result_code"] => string(7) "SUCCESS" ["err_code"] => string(7) "SUCCESS" ["err_code_des"] => string(2) "OK" ["mch_billno"] => string(20) "cowcms20190320185925" ["mch_id"] => string(10) "1225084602" ["detail_id"] => string(31) "1000041701201903203000133811326" ["status"] => string(8) "RECEIVED" ["send_type"] => string(3) "API" ["hb_type"] => string(5) "GROUP" ["total_num"] => string(1) "3" ["total_amount"] => string(3) "300" ["send_time"] => string(19) "2019-03-20 19:03:50" ["hblist"] => array(1) { ["hbinfo"] => array(3) { ["openid"] => string(28) "o4KFnuLOwsQR9tDusUk0ZBherrrr" ["amount"] => string(3) "142" ["rcv_time"] => string(19) "2019-03-20 19:04:04" } } } ~~~