Module: Reapal::Api::Money::SubAccountQuery

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

Instance Method Summary collapse

Instance Method Details

#sub_account_query(sub_account_flow_id, serial_no = '') ⇒ Hash

2.9 企业分账查询(API)

Parameters:

  • sub_account_flow_id (String)

    分账订单号

  • serial_no (String) (defaults to: '')

    分账流水号(传空串表示该订单批量查询)

Returns:

  • (Hash)

    结果集

    • :result [String] 业务结果:‘S/F/P’

    • :request_params [Hash] 请求参数

    • :response [Object] 请求返回对象

    • :error_code [String] 错误代号

    • :error_msg [String] 错误信息

    • :data: 具体业务返回信息

      * :orderNO [String] 分账订单号
      * :subDetails [String]  分账明细
          * serialNo [String] 分账流水号
          * payeeContracts [String] 收款方协议号
          * amount [BigDecimal] 金额
          * remark [String] 备注
          * resultCode [String] 结果代码
      * :resultCode [String] 结果代码 0000:分账成功;0001 : 分账失败;0002:处理中
      


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/reapal/api/money/sub_account_query.rb', line 29

def (, serial_no='')
  service = 'reapal.trust.subAccountQuery'
  post_path = '/service/depwit.htm'

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

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

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

  Reapal.logger.info res

  res
end