Commit 808de093 authored by zhang_z's avatar zhang_z

修复一个查询的问题;

parent 85ab96a6
......@@ -68,10 +68,10 @@ public class PayCenter {
*
* @return 查询结果的Observable
*/
public Observable<Response> query() {
public Observable<Response> query(int payChannel) {
switch (mShopppp.getHost().getHostMapId()) {
case C.HOST.PAX:
return Factory.query();
return Factory.query(payChannel);
default:
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道"));
}
......
......@@ -95,10 +95,21 @@ public class Factory extends com.xingdata.zxpay.api.Factory {
*
* @return 查询结果
*/
public static Observable<com.xingdata.zxpay.api.Response> query() {
public static Observable<com.xingdata.zxpay.api.Response> query(int payChannel) {
Request request = Request.create(C.METHOD.QUERY);
request.setOutTransactionNo(PayCenter.getInstance().mShopppp.getPosppp().getHposTrace());
request.setTimeStart(orderMap.get(request.getOutTransactionNo()));
switch (payChannel) {
case com.xingdata.zxpay.C.PAY_CHANNEL.ALI:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyAlipay());
break;
case com.xingdata.zxpay.C.PAY_CHANNEL.WECHAT:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyWechat());
break;
case com.xingdata.zxpay.C.PAY_CHANNEL.BANK:
request.setKey(PayCenter.getInstance().mShopppp.getHshopKeyUnipay());
break;
}
request.sign();
return run(Api.getInstance().service.action(request))
.map(new ResultFilter());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment