Commit 808de093 authored by zhang_z's avatar zhang_z

修复一个查询的问题;

parent 85ab96a6
...@@ -68,10 +68,10 @@ public class PayCenter { ...@@ -68,10 +68,10 @@ public class PayCenter {
* *
* @return 查询结果的Observable * @return 查询结果的Observable
*/ */
public Observable<Response> query() { public Observable<Response> query(int payChannel) {
switch (mShopppp.getHost().getHostMapId()) { switch (mShopppp.getHost().getHostMapId()) {
case C.HOST.PAX: case C.HOST.PAX:
return Factory.query(); return Factory.query(payChannel);
default: default:
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道")); return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道"));
} }
......
...@@ -95,10 +95,21 @@ public class Factory extends com.xingdata.zxpay.api.Factory { ...@@ -95,10 +95,21 @@ public class Factory extends com.xingdata.zxpay.api.Factory {
* *
* @return 查询结果 * @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 request = Request.create(C.METHOD.QUERY);
request.setOutTransactionNo(PayCenter.getInstance().mShopppp.getPosppp().getHposTrace()); request.setOutTransactionNo(PayCenter.getInstance().mShopppp.getPosppp().getHposTrace());
request.setTimeStart(orderMap.get(request.getOutTransactionNo())); 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(); request.sign();
return run(Api.getInstance().service.action(request)) return run(Api.getInstance().service.action(request))
.map(new ResultFilter()); .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