Module: Reapal::Form::DepositApplyForm

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

Instance Method Summary collapse

Instance Method Details

#deposit_apply_form(flow_id, contract, money, charge, return_url, notify_url, busway = '01', remark = '') ⇒ Hash

2.1 充值

Parameters:

  • flow_id (String)

    业务订单号

  • contract (String)

    用户协议号

  • money (Number)

    充值金额

  • charge (Number)

    手续费

  • return_url (String)

    回调 url

  • notify_url (String)

    通知 url

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

    默认01 00:网银充值;01:快捷充值

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

    备注(默认为 ”)

Returns:

  • (Hash)

    结果集

    • form_method

      • url

      • method

    • form_data

      • :merchant_id

      • :encryptkey

      • :data



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

def deposit_apply_form(flow_id, contract, money, charge,
                       return_url, notify_url,
                       busway = '01', remark='')

  service = 'reapal.trust.depositApply'
  post_path = '/service/deposit.htm'

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

  params.merge(channel: 'bank', paymentType: '1', payCustomerNo: '') if '00' == busway

  get_form_data(service, params, post_path)
end