Module: Reapal::Api::Money::DepositQuery

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

Instance Method Summary collapse

Instance Method Details

#deposit_query(deposit_flow_id) ⇒ Hash

2.3 充值查询(API)

Parameters:

  • deposit_flow_id (String)

    充值订单号

Returns:

  • (Hash)

    结果集

    • :result [String] “S”/“F”/“P”

    • :error_msg [String] 错误提示

    • :data [Hash] 成功数据

      * :orderNo [String]  充值订单号
      * :amount [BigDecimal] 交易金额
      * :charge [BigDecimal] 手续费
      * :resultCode [String] 结果代码
      


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/reapal/api/money/deposit_query.rb', line 21

def deposit_query(deposit_flow_id)
  service = 'reapal.trust.depositQuery'
  post_path = '/service/depwit.htm'

  params = {
    orderNo: deposit_flow_id,
    queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
  }

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

  if 'P' == res[:result] && ('0001' || '0004') == res[:data][:resultCode]
    res[:result] = 'F'
  end

  Reapal.logger.info res

  res
end