Class: Wechat::Qrcode
- Inherits:
-
DataObject
- Object
- DataObject
- Wechat::Qrcode
- Defined in:
- lib/wechat/data_objects/qrcode.rb
Class Method Summary collapse
- .create ⇒ Object
-
.show(ticket) ⇒ String
QR code image url.
Methods inherited from DataObject
get, parameterize_params, post, #request
Class Method Details
.create ⇒ Object
17 18 19 20 21 |
# File 'lib/wechat/data_objects/qrcode.rb', line 17 def create = {expire_seconds: 1800,action_name: 'QR_SCENE', action_info: {scene: {scene_id: 2.times.map{ 10 + Random.rand(20) }.join }}} post("qrcode/create", JSON.generate()) end |
.show(ticket) ⇒ String
Returns QR code image url.
32 33 34 |
# File 'lib/wechat/data_objects/qrcode.rb', line 32 def show(ticket) return "https://mp.weixin.qq.com/cgi-bin/showqrcode/cgi-bin/showqrcode?ticket=#{CGI.escape(ticket)}" end |