Class: Wechat::ShakeAround::Registration

Inherits:
Object
  • Object
show all
Extended by:
Core::Common, Common
Defined in:
lib/wechat/shake_around/registration.rb

Overview

Registration 是账号注册管理的封装类。

Constant Summary

Constants included from Common

Common::ERROR_CODES

Class Method Summary collapse

Methods included from Common

normalize_date, normalize_device_id, normalize_page_ids

Class Method Details

.create(access_token, name, phone_number, email, industry_id, qualification_links, apply_reason) ⇒ Object

申请开通功能 mp.weixin.qq.com/wiki/13/025f1d471dc999928340161c631c6635.html#.E7.94.B3.E8.AF.B7.E5.BC.80.E9.80.9A.E5.8A.9F.E8.83.BD 成功提交申请请求后,工作人员会在三个工作日内完成审核。 若审核不通过,可以重新提交申请请求。 若是审核中,请耐心等待工作人员审核,在审核中状态不能再提交申请请求。 industry_id: 3gimg.qq.com/shake_nearby/Qualificationdocuments.html

Return hash format if success:

data:    {,
errcode: 0,
errmsg:  'success.'

}



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/wechat/shake_around/registration.rb', line 50

def self.create(access_token, name, phone_number, email, industry_id, qualification_links, apply_reason)

  assert_present! :access_token, access_token
  assert_present! :name,         name
  assert_present! :phone_number, phone_number
  assert_present! :email,        email

  message = post_json "https://api.weixin.qq.com/shakearound/account/register?access_token=#{access_token}", body:
    {
      name:                    name,
      phone_number:            phone_number,
      email:                   email,
      industry_id:             industry_id,
      qualification_cert_urls: qualification_links,
      apply_reason:            apply_reason
    }
  message.body
end

.load(access_token) ⇒ Object

查询审核状态 mp.weixin.qq.com/wiki/13/025f1d471dc999928340161c631c6635.html#.E6.9F.A5.E8.AF.A2.E5.AE.A1.E6.A0.B8.E7.8A.B6.E6.80.81

Return hash format if success: {

data: {
  apply_time:    APPLY_TIME,
  audit_comment: AUDIT_COMMENT,
  audit_status:  AUDIT_STATUS,
  audit_time:    AUDIT_TIME
},
errcode: 0,
errmsg:  'success.'

}

apply_time: 提交申请的时间戳 apply_comment: 审核备注,包括审核不通过的原因 audit_status: 0:审核未通过、1:审核中、2:审核已通过 audit_time: 确定审核结果的时间戳;若状态为审核中,则该时间值为0



29
30
31
32
33
34
# File 'lib/wechat/shake_around/registration.rb', line 29

def self.load(access_token)

  assert_present! :access_token, access_token

  get_json "https://api.weixin.qq.com/shakearound/account/auditstatus?access_token=#{access_token}"
end