Module: Reapal::Form::CertificateForm

Defined in:
lib/reapal/form/certificate_form.rb

Instance Method Summary collapse

Instance Method Details

#certificate_form(flow_id, bind_id, contract, return_url, notify_url, terminal_type = 'mobile') ⇒ Hash

2.5 卡密鉴权

Parameters:

  • flow_id (String)

    订单号

  • bind_id (String)

    绑卡 ID,调用充值签约接口时,获取的bindId

  • contract (String)

    借款人协议号

  • return_url (String)

    回调 url

  • notify_url (String)

    通知 url

  • terminal_type (String) (defaults to: 'mobile')

    终端类型,默认手机端。PC端:web 手机端:mobile

Returns:

  • (Hash)

    结果集

    • :form_method

      • :method

      • :url

    • :form_data

      • :merchant_id

      • :encryptkey

      • :data



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/reapal/form/certificate_form.rb', line 25

def certificate_form(flow_id, bind_id, contract, return_url, notify_url, terminal_type='mobile')
  service = 'reapal.trust.certificate'
  post_path = '/reagw/service/depwit.htm'

  params = {
    orderNo: flow_id,
    contracts: contract,
    terminalType: terminal_type,
    returnUrl: return_url,
    notifyUrl: notify_url,
    applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
  }

  get_form_data(service, params, post_path)
end