Module: Reapal::Api::Tender::TenderRepaymentComplete

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

Instance Method Summary collapse

Instance Method Details

#tender_repayment_complete(flow_id, tender_no, periods, comp_principal, comp_interest, comp_poundage, comp_amount, comp_time, busway = '01', remark = '') ⇒ Hash

3.10 还款计划更新(API)

Parameters:

  • flow_id (String)

    执行还款计划订单号

  • tender_no (String)

    商户系统标的号

  • periods (Integer)

    还款期数

  • comp_principal (BigDecimal)

    执行还款本金

  • comp_interest (BigDecimal)

    执行还款利息

  • comp_poundage (BigDecimal)

    执行还款手续费

  • comp_amount (BigDecimal)

    执行还款总金额

  • comp_time (Time)

    执行还款日期

  • 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] 结果代码
      


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/reapal/api/tender/tender_repayment_complete.rb', line 31

def tender_repayment_complete(flow_id, tender_no, periods, comp_principal, comp_interest,
                              comp_poundage, comp_amount, comp_time, busway='01', remark='')
  service = 'reapal.trust.repaymentComplete'
  post_path = '/tender/rest.htm'

  params = {
    orderNo: flow_id,
    tenderNo: tender_no,
    periods: periods,
    compPrincipal: comp_principal,
    compInterest: comp_interest,
    compPoundage: comp_poundage,
    compAmount: comp_amount,
    compTime: comp_time.strftime('%Y%m%d'),
    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_repayment_complete, ['0000'])

  Reapal.logger.info res

  res
end