Module: Reapal::Form::BusinessAuthForm

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

Instance Method Summary collapse

Instance Method Details

#business_auth_form(flow_id, contract, services, auth_limit, amount, total_amount, return_url, notify_url, busway = '01', remark = '') ⇒ Hash

3.12 标的授权 (Form)

Parameters:

  • flow_id (String)

    业务订单号

  • contract (String)

    用户协议号

  • services (String)

    授权服务 02 自动投标 03 自动还款 05 自动担保还款

  • auth_limit (String)

    授权期限日期 YYYYMMDD

  • amount (Bigdecimal)

    金额

  • total_amount (Bigdecimal)

    累计金额

  • return_url (String)

    回调 url

  • notify_url (String)

    通知 url

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

    00:PC端;01:手机端;02:Pad端;03:其它

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

    备注

Returns:

  • (Hash)

    结果集

    • form_method

      • url

      • method

    • form_data

      • :merchant_id

      • :encryptkey

      • :data



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/reapal/form/business_auth_form.rb', line 29

def business_auth_form(flow_id, contract, services, auth_limit, amount, total_amount,
                       return_url, notify_url, busway='01', remark='')

  service = 'reapal.trust.businessAuth'
  post_path = '/user/rest.htm'

  params = {
    orderNo: flow_id,
    contracts: contract,
    services: services,
    busway: busway,
    authLimit: auth_limit,
    amount: amount,
    totalAmount: total_amount,
    returnUrl: return_url,
    notifyUrl: notify_url,
    remark: remark,
    applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
  }

  get_form_data(service, params, post_path)
end