lib/rock_fintech/http/request.rb in rock_fintech-0.5.0 vs lib/rock_fintech/http/request.rb in rock_fintech-0.6.0
- old
+ new
@@ -53,18 +53,30 @@
RockFintech.logger.info "#{identifier} 返回的数据为:\n#{res}\n"
# 7. create response
@response = RockFintech::Http::Response.new(service: @service,
- flow_id: @params[:out_serial_no],
+ flow_id: flow_id,
http_response: http_response,
raw_body: http_response.body,
data: res,
data_valid: Sign.verify(res, @config))
end
+ def flow_id
+ if @params[:out_serial_no]
+ @params[:out_serial_no]
+ elsif @params[:serial_no]
+ @params[:serial_no]
+ elsif @params[:order_no]
+ @params[:order_no]
+ else
+ nil
+ end
+ end
+
def identifier
- "[#{@service} - #{@params[:out_serial_no]}] "
+ "[#{@service} - #{flow_id}] "
end
end # end of class
end
end