Module: Reapal::Api::Money::DepositConfirmApi

Defined in:
lib/reapal/api/money/deposit_confirm_api.rb

Instance Method Summary collapse

Instance Method Details

#deposit_confirm_api(flow_id, contracts, check_code, terminal_info, member_ip, busway = '01', remark = '') ⇒ Hash

2.3 快捷充值确认(API)

Parameters:

  • flow_id (String)

    商户订单号(非自动生成,与充值签约订单号一致)

  • contracts (String)

    用户协议号

  • check_code (String)

    短信验证码

  • terminal_info (String)

    终端信息(手机IMEI地址、MAC地址、UUID)

  • member_ip (String)

    用户IP

  • 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] 结果代码 0000:充值成功
      * :resultMsg [String] 结果描述
      


29
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/money/deposit_confirm_api.rb', line 29

def deposit_confirm_api(flow_id, contracts, check_code, terminal_info, member_ip, busway = '01', remark = '')
  service = 'reapal.trust.depositConfirmAPI'
  post_path = '/reagw/service/depwit.htm'

  params = {
    orderNo: flow_id,
    contracts: contracts,
    checkCode: check_code,
    busway: busway,
    terminalInfo: terminal_info,
    memberIp: member_ip,
    applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
  }

  res = operate_post(:operate, service, params, post_path, Http::ErrorCode.deposit_confirm_api, ['0000'])

  error_result_code = %w(9060 9065 9083 9084 9085 0017 0210 0302 0303 0328 0329
                         0330 0332 0333 0335 0339 0340 0341 0342 0343 0344 0345
                         0346 0347 0348 0350 0351 0352 0358 0359 0360 0362 0363
                         0001 0004)

  if 'S' == res[:result] && error_result_code.include?(res[:data][:resultCode])
    res[:result] = 'F'
  end

  res
end