Module: Reapal::Api::User::OnekeyComContract

Defined in:
lib/reapal/api/user/onekey_com_contract.rb

Instance Method Summary collapse

Instance Method Details

#onekey_com_contract(flow_id, corp_name, identity_id, com_name, com_license, lic_start_date, lic_end_date, phone, return_url, notify_url, email, busway = '01', remark = '') ⇒ Hash

1.4 企业一键签约(API)

Parameters:

  • flow_id (String)

    订单号

  • corp_name (String)

    法人代表姓名

  • identity_id (String)

    法人身份证号

  • com_name (String)

    企业名称

  • com_license (String)

    组织机构代码/社会征信号

  • lic_start_date (Datetime)

    企业组织机构证起始日

  • lic_end_date (Datetime)

    企业组织机构证截止日

  • phone (String)

    手机号

  • return_url (String)

    回调 URL

  • notify_url (String)

    通知 URL

  • email (String)

    企业邮箱

  • busway (String) (defaults to: '01')

    设备通道,默认手机端 00:PC端;01:手机端;02:Pad端;03:其它

  • remark (String) (defaults to: '')

    备注

Returns:

  • (Hash)

    结果集

    • :result [String] 业务结果:‘S/F/P’

    • :request_params [Hash] 请求参数

    • :response [Object] 请求返回对象

    • :error_code [String] 错误代号

    • :error_msg [String] 错误信息

    • :data: 具体业务返回信息

      • :orderNo [String] 订单号

      • :contracts [String] 企业签约协议号

      • :resultCode [String] 结果代码 0000:申请成功 0002:签约成功(审核通过)0003:签约失败(审核不通过)0006:再次申请成功(拒绝后)

      • :corpName [String] 法人代表姓名

      • :corpIdentity [String] 法人身份证号

      • :comLicense [String] 组织机构代码/社会征信号

      • :licStartDate [String] 企业组织机构证起始日

      • :licEndDate [String] 企业组织机构证截止日

      • :mobile [String] 手机号

      • :email [String] 企业邮箱

      • :remark [String] 备注



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/reapal/api/user/onekey_com_contract.rb', line 43

def onekey_com_contract(flow_id, corp_name, identity_id, com_name, com_license,
                        lic_start_date, lic_end_date, phone, return_url, notify_url,
                        email, busway='01', remark='')
  service = 'reapal.trust.comContractAPI'
  post_path = '/reagw/agreement/agree.htm'

  params = {
    orderNo: flow_id,
    corpName: corp_name,
    corpIdentity: identity_id,
    comName: com_name,
    comLicense: com_license,
    licStartDate: lic_start_date,
    licEndDate: lic_end_date,
    mobile: phone,
    email: email,
    busway: busway,
    returnUrl: return_url,
    notifyUrl: notify_url,
    remark: '',
    applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
  }

  res = operate_post(:operate, service, params, post_path, Http::ErrorCode.contract_create, ['0002', '0006'])

  if 'S' == res[:result] && '0003' == res[:data][:resultCode]
    res[:result] = 'F'
  end

  res
end