Module: Reapal::Api::Tender::TenderFinish

Defined in:
lib/reapal/api/tender/tender_finish.rb

Instance Method Summary collapse

Instance Method Details

#tender_finish(flow_id, tender_no, debit_contracts, invest_details, fee_details = [], busway = '01', remark = '') ⇒ Hash

3.7 满标

Parameters:

  • flow_id (String)

    完成订单号

  • tender_no (String)

    商户系统标的号

  • debit_contracts (String)

    借款方协议号

  • invest_details (Array)

    投资方分账

    • :seriaNo [String] 商户流水号

    • :investContracts [String] 投资方协议号

    • :amount [BigDecimal] 金额

    • :remark [String] 备注

  • fee_details (Array) (defaults to: [])

    手续费分账

    • :seriaNo [String] 商户流水号

    • :payeeContracts [String] 收款方协议号

    • :feeType [String] 01 收借款人手续费【包括平台和担保方,共享发标时的手续费】 02 受托支付

    • :amount [BigDecimal] 金额

    • :remark [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] 完成订单号
      * :resultCode [String] 结果代码
      


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/reapal/api/tender/tender_finish.rb', line 37

def tender_finish(flow_id, tender_no, debit_contracts, 
                  invest_details, fee_details=[], 
                  busway='01', remark='')
  service = 'reapal.trust.tenderFinish'
  post_path = '/tender/rest.htm'

  params = {
    orderNo: flow_id,
    tenderNo: tender_no,
    debitContracts: debit_contracts,
    feeDetails: fee_details,
    investDetails: invest_details,
    busway: busway,
    remark: remark,
    applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
  }

  res = operate_post(:operate, service, params, post_path, Http::ErrorCode.tender_finish, ['0000'])
  if 'S' == res[:result] && '0001' == res[:data][:resultCode]
    res[:result] = 'F'
  end

  Reapal.logger.info res

  res
end