lanrion / weixin_authorize

微信 Ruby 高级API weixin_authorize http://github.com/lanrion/weixin_authorize .
MIT License
322 stars 116 forks source link

新增微信卡券接口 #66

Closed u0x01 closed 9 years ago

u0x01 commented 9 years ago

以下接口已经通过测试:

client.send_card_custom(openid, card_id)
=> <WeixinAuthorize::ResultHandler:0x00000007267d00 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={}> 
$weixin_client.card_send_preview(card_id, wxname)
=> <WeixinAuthorize::ResultHandler:0x00000007188380 @code=0, @en_msg="preview success", @cn_msg="请求成功", @result={}> 
$weixin_client.card_colors
=> <WeixinAuthorize::ResultHandler:0x000000071e91f8 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"colors"=>[]}> 
$weixin_client.card_datacube(Time.now - 2.days, Time.now - 1.day, 0)
=> <WeixinAuthorize::ResultHandler:0x0000000364ef30 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"list"=>[]}> 
$weixin_client.card_datacube_info(Time.now - 2.day, Time.now - 1.day, 0)
=> <WeixinAuthorize::ResultHandler:0x000000035a6da8 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"list"=>[]}>  
$weixin_client.card_datacube_info(Time.now - 2.day, Time.now - 1.day, 0)
=> <WeixinAuthorize::ResultHandler:0x00000006314e20 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"list"=>[]}> 
$weixin_client.card_testwhitelist(['zq9610'],[])
=> <WeixinAuthorize::ResultHandler:0x00000005c9fef0 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"white_list_size"=>1, "success_openid"=>[], "success_username"=>["zq9610"]}> 
$weixin_client.card_mpnews_html(card_id)
=> <WeixinAuthorize::ResultHandler:0x00000006182378 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"content"=>""}>
$weixin_client.card_code_deposit(card_id, ['1111111','2222222'])
=> <WeixinAuthorize::ResultHandler:0x00000003595ad0 @code=45030, @en_msg="limit cardid, not support this function", @cn_msg=nil, @result={}> 
$weixin_client.card_code_check(card_id, ['1111111','2222222'])
=> <WeixinAuthorize::ResultHandler:0x00000003595ad0 @code=45030, @en_msg="limit cardid, not support this function", @cn_msg=nil, @result={}> 
$weixin_client.card_code_qrcode_create(card_id)
=> <WeixinAuthorize::ResultHandler:0x000000055531d8 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"ticket"=>"gQGv8DoAAAAAAAAAASxodHRwOi8vd2VpeGluLnFbbmNvbS9xL0p6bWd0Vy1aaGNmY1VpYXRDQksxAAIEwTHWqQMEgDPhAQ==", "expire_seconds"=>31536000, "url"=>"http://weixin.qq.com/q/JzmgtW-spcfcUdatCBK1"}> 
$weixin_client.cards
=> <WeixinAuthorize::ResultHandler:0x0000000558c640 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"card_id_list"=>["pcYNAwkqZ8vaaH5LcuFZOuzplQFw", "pcYNAwr6lVUf8SnoXoCTZqqsxfuM", "pcYNAwisrt0GtuZURkbbUUvZ5ypp", "pcYNAwpkeCruBV3riAdd0nzfQkqg"], "total_num"=>4}> 
$weixin_client.card(card_id)
=> <WeixinAuthorize::ResultHandler:0x0000000292dfb8 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"card"=>{"card_type"=>"GIFT", "gift"=>{"base_info"=>{"id"=>"YOUR_CARD_ID", "logo_url"=>"http://mmbiz.qpic.cn/mmbiz/pssufOHIqWQGVacxInDpl6zbFgy8mPOWCjDp59Kjlp8wRiavTtVicxPHYO8hw7f57sc3OnSq7JLkjeQubTjjTFPQ/0?wx_fmt=jpeg", "code_type"=>"CODE_TYPE_QRCODE", "brand_name"=>"奥体健身", "title"=>"奥体运动健身包", "sub_title"=>"可免费兑换奥体运动健身包", "date_info"=>{"type"=>"DATE_TYPE_FIX_TERM", "fixed_term"=>7, "fixed_begin_term"=>0}, "color"=>"#F9861F", "notice"=>"请向店员出示本券领取奥体健身包", "service_phone"=>"0773-3662256", "description"=>"不可与其他优惠同享", "location_id_list"=>[292434386], "get_limit"=>1, "can_share"=>true, "can_give_friend"=>false, "status"=>"CARD_STATUS_DELETE", "sku"=>{"quantity"=>50, "total_quantity"=>50}, "create_time"=>1439900321, "update_time"=>1439900321, "js_oauth_uin_list"=>[]}, "gift"=>"可在有效期内免费领取奥体运动健身包一个"}}}> 
$weixin_client.card_code_unavailable('', '991755923319')
=> <WeixinAuthorize::ResultHandler:0x000000073baec8 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={}> 
$weixin_client.card_code_consume(nil, '233335119724')
=> <WeixinAuthorize::ResultHandler:0x00000007544140 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={"card"=>{"card_id"=>"pcYNAwkqZ8vUCH5LcuFZOuzplQFw"}, "openid"=>"ocYNAwnzoITRFgzWsAB0u3JJ-7q8"}> 
$weixin_client.card_delete(card_id)
=> <WeixinAuthorize::ResultHandler:0x000000042d0650 @code=0, @en_msg="ok", @cn_msg="请求成功", @result={}> 
lanrion commented 9 years ago

见:https://github.com/lanrion/weixin_authorize/pull/73