Module: Reapal::Api::Order::QueryByFlowId
- Defined in:
- lib/reapal/api/order/query_by_flow_id.rb
Instance Method Summary collapse
-
#query_by_flow_id(flow_id, service_type) ⇒ Hash
4.3 订单号查询(批量).
Instance Method Details
#query_by_flow_id(flow_id, service_type) ⇒ Hash
4.3 订单号查询(批量)
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 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/reapal/api/order/query_by_flow_id.rb', line 31 def query_by_flow_id(flow_id, service_type) service = case service_type.to_sym when :tender_cancel 'reapal.trust.tenderCancelMQuery' when :tender_finish 'reapal.trust.tenderFinishMQuery' when :tender_refund 'reapal.trust.tenderRefundMQuery' when :tender_transfer 'reapal.trust.tenderTransferMQuery' else nil end if service.nil? res[:result] = "F" res[:error_msg] = "参数 service_type 错误" return res end post_path = '/tender/rest.htm' params = { orderNo: flow_id, queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'), } res = operate_post(:query, service, params, post_path, Http::ErrorCode.query_by_flow_id, ['0000']) if 'P' == res[:result] && ('0001' || '0003') == res[:data][:resultCode] res[:result] = 'F' end Reapal.logger.info res res end |