Module: Reapal::Api::Tender::TenderOneKeyInvest

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

Instance Method Summary collapse

Instance Method Details

#tender_onekey_invest(flow_id, tender_no, amount, coupon_amt, invest_contracts, busway = '01', remark = '') ⇒ Hash

3.5 一键投标



30
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_onekey_invest.rb', line 30

def tender_onekey_invest(flow_id, tender_no, amount, coupon_amt,
                         invest_contracts, busway='01', remark='')
  service = 'reapal.trust.onekeyInvest'
  post_path = '/tender/rest.htm'

  params = {
    orderNo: flow_id,
    tenderNo: tender_no,
    amount: amount,
    couponAmt: coupon_amt,
    investContracts: invest_contracts,
    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_onekey_invest, ['0000'])

  if 'S' == res[:result] && '0001' == res[:data][:resultCode]
    res[:result] = 'F'
  end

  Reapal.logger.info res

  res
end