Module: Wechat::Api::Program::Wxa

Included in:
Wechat::Api::Program
Defined in:
app/apis/wechat/api/program/wxa.rb

Constant Summary collapse

BASE =
'https://api.weixin.qq.com/wxa/'

Instance Method Summary collapse

Instance Method Details

#generate_scheme(path: '/pages/index/index', **options) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'app/apis/wechat/api/program/wxa.rb', line 24

def generate_scheme(path: '/pages/index/index', **options)
  p = {
    jump_wxa: {
      path: path,
      **options.slice(:query, :env_version)
    },
    **options.slice(:is_expire, :expire_type, :expire_time, :expire_interval)
  }
  post 'generatescheme', **p, base: BASE
end

#generate_url(path: '/pages/index/index', **options) ⇒ Object



20
21
22
# File 'app/apis/wechat/api/program/wxa.rb', line 20

def generate_url(path: '/pages/index/index', **options)
  post 'generate_urllink', path: path, **options, base: BASE
end

#get_wxacode(path, width = 430) ⇒ Object



10
11
12
# File 'app/apis/wechat/api/program/wxa.rb', line 10

def get_wxacode(path, width = 430)
  post 'getwxacode', path: path, width: width, base: BASE
end

#get_wxacode_unlimit(scene, **options) ⇒ Object



14
15
16
17
18
# File 'app/apis/wechat/api/program/wxa.rb', line 14

def get_wxacode_unlimit(scene, **options)
  p = { scene: scene, **options }

  post 'getwxacodeunlimit', **p, base: BASE
end

#msg_sec_check(content) ⇒ Object



6
7
8
# File 'app/apis/wechat/api/program/wxa.rb', line 6

def msg_sec_check(content)
  post 'msg_sec_check', content: content, base: BASE
end