Module: WeixinAuthorize::Api::Qrcode

Included in:
Client
Defined in:
lib/weixin_authorize/api/qrcode.rb

Instance Method Summary collapse

Instance Method Details

#create_qr_limit_scene(scene_id) ⇒ Object

永久二维码



16
17
18
19
20
21
# File 'lib/weixin_authorize/api/qrcode.rb', line 16

def create_qr_limit_scene(scene_id)
  post_url     = "#{qrcode_base_url}/create"
  qrcode_infos = {action_name: "QR_LIMIT_SCENE"}
  qrcode_infos = qrcode_infos.merge(action_info(scene_id))
  http_post(post_url, qrcode_infos)
end

#create_qr_scene(scene_id, expire_seconds = 1800) ⇒ Object

临时二维码



8
9
10
11
12
13
# File 'lib/weixin_authorize/api/qrcode.rb', line 8

def create_qr_scene(scene_id, expire_seconds=1800)
  post_url     = "#{qrcode_base_url}/create"
  qrcode_infos = {action_name: "QR_SCENE", expire_seconds: expire_seconds}
  qrcode_infos = qrcode_infos.merge(action_info(scene_id))
  http_post(post_url, qrcode_infos)
end

#qr_code_url(ticket) ⇒ Object

通过ticket换取二维码, 直接访问即可显示!



24
25
26
# File 'lib/weixin_authorize/api/qrcode.rb', line 24

def qr_code_url(ticket)
  WeixinAuthorize.mp_endpoint("/showqrcode?ticket=#{ticket}")
end