Commit 9a4a1882 authored by zhang_z's avatar zhang_z

更新POS支付;

parent 4eae0d7d
......@@ -661,4 +661,49 @@ public class C {
public static final int USED = 2;
public static final int INVALID = 3;
}
/**
* 支付系统
*/
public final class PAY_SYSTEM {
/**
* 当前支付系统
*/
public static final int CURRENT = PAX.APP;
/**
* 浙星
*/
public static final int ZX = 100101;
/**
* 拉卡拉
*/
public static final int LKL = 100201;
/**
* 百富
*/
public final class PAX {
/**
* 统一支付APP
*/
public static final int APP = 100301;
/**
* 接口
*/
public static final int API = 100302;
}
/**
* 交易类型
*/
public final class Trans_Type {
public static final int Trans_Type_Return = 0;
public static final int Trans_Type_Recharge = 1;
}
}
}
......@@ -186,9 +186,9 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
}
@Override
public void showPayFailFragment(Throwable throwable, Saleorder saleorder) {
public void showPayFailFragment(String throwable, Saleorder saleorder) {
if (throwable != null) {
LogUtils.e(throwable.getMessage());
LogUtils.e(throwable);
}
this.start(mPayResultFragment.setResult(false).setSaleorder(saleorder));
this.showTitleBarByTitleMode(C.TITLE_MODE.TEXT);
......
......@@ -125,7 +125,7 @@ interface SettleContract {
* @param throwable 错误信息
* @param saleorder 订单信息
*/
void showPayFailFragment(Throwable throwable, Saleorder saleorder);
void showPayFailFragment(String throwable, Saleorder saleorder);
/**
* 显示支付中页面
......
package com.xingdata.zzdpos.ui.settle;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.api.print.ZX_PrintPOS;
......@@ -112,9 +111,11 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override
public void initSettle() {
DBFactory.Settle.queryPays().subscribe(
pays -> mView.loadPays(pays),
throwable -> mView.showMsg(throwable.getMessage())
mCompositeDisposable.add(DBFactory.Settle.queryPays()
.subscribe(
pays -> mView.loadPays(pays),
throwable -> mView.showMsg(throwable.getMessage())
)
);
mView.setSettleFragmentBySettleMode(mSettleMode);
}
......@@ -124,16 +125,19 @@ public class SettlePresenter extends SettleContract.Presenter {
mView.loadSaledetails(mSaledetails);
//设置订单详情
mSaleorder.setSaledetails(mSaledetails);
DBFactory.Settle.queryMss().subscribe(ms -> {
mMss = ms;
for (int i = 0; i < mMss.size(); i++) {
mMss.get(i).setOnApplyListener(mOnApplyListener);
}
//处理营销活动
this.processMs();
//计算价格
this.reprice();
}, throwable -> mView.showMsg(throwable.getMessage()));
mCompositeDisposable.add(DBFactory.Settle.queryMss()
.subscribe(ms -> {
mMss = ms;
for (int i = 0; i < mMss.size(); i++) {
mMss.get(i).setOnApplyListener(mOnApplyListener);
}
//处理营销活动
this.processMs();
//计算价格
this.reprice();
}, throwable -> mView.showMsg(throwable.getMessage())
)
);
}
@Override
......@@ -151,13 +155,16 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override
public void searchVip(String keyword) {
ApiFactory.User.queryUserDetailByKeyword(keyword).subscribe(
vip -> {
List<Vip> vips = new ArrayList<>();
vips.add(vip);
mView.loadVips(vips);
},
throwable -> mView.loadVips(new ArrayList<>()));
mCompositeDisposable.add(ApiFactory.User.queryUserDetailByKeyword(keyword)
.subscribe(
vip -> {
List<Vip> vips = new ArrayList<>();
vips.add(vip);
mView.loadVips(vips);
},
throwable -> mView.loadVips(new ArrayList<>())
)
);
}
@Override
......@@ -174,12 +181,15 @@ public class SettlePresenter extends SettleContract.Presenter {
this.reprice();
// 获取订单
ApiFactory.Ticket.query(mVip.getVipId()).subscribe(
tickets -> {
this.mTickets = tickets.getList();
this.searchAvlTicket();
},
throwable -> mView.showMsg(throwable.getMessage()));
mCompositeDisposable.add(ApiFactory.Ticket.query(mVip.getVipId())
.subscribe(
tickets -> {
this.mTickets = tickets.getList();
this.searchAvlTicket();
},
throwable -> mView.showMsg(throwable.getMessage())
)
);
}
@Override
......@@ -219,185 +229,167 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override
public void payInCash(Long inputAmt, Long changeAmt) {
// mView.showLoadingDialog();
// subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.CASH))));
mView.showLoadingDialog();
commitOrder(
).flatMap(orderNo -> {
//获取支付中心参数
return ApiFactory.Pay.getPayKey();
}).flatMap(json -> {
//初始化支付中心,并发送支付指令
return NeptuneCenter.getInstance().init(App.instance, json).pay(C.PAY_CHANNEL.ALI, mSaleorder.getOrderPayAmt());
}).doFinally(() -> {
mView.dismissLoadingDialog();
}).subscribe(
response -> {
switch (response.getCode()) {
case com.xingdata.zxpay.C.PAY_STATE.ING:
//支付中, 显示支付对话框
mView.showPayingDialog(C.PAY_CHANNEL.ALI);
break;
case com.xingdata.zxpay.C.PAY_STATE.SUCCESS:
//支付成功, 发送完成订单指令
subscribePay(ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(mSaleorder.getOrderNo(), C.PAY_CHANNEL.ALI)));
break;
default:
//支付失败
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), response.getMsg()));
mView.showPayFailFragment(null, mSaleorder);
break;
}
},
throwable -> {
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), throwable.getMessage()));
mView.showPayFailFragment(throwable, mSaleorder);
}
subscribePay(commitOrder()
.flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.CASH)))
);
}
@Override
public void payInAli(String payCode) {
mView.showLoadingDialog();
commitOrder(
).flatMap(orderNo -> {
//获取支付中心参数
return ApiFactory.Pay.getPayKey();
}).flatMap(json -> {
//初始化支付中心,并发送支付指令
return PayCenter.getInstance().init(json).pay(C.PAY_CHANNEL.ALI, payCode, mSaleorder.getOrderPayAmt());
}).doFinally(() -> {
mView.dismissLoadingDialog();
}).subscribe(
response -> {
switch (response.getCode()) {
case com.xingdata.zxpay.C.PAY_STATE.ING:
//支付中, 显示支付对话框
mView.showPayingDialog(C.PAY_CHANNEL.ALI);
break;
case com.xingdata.zxpay.C.PAY_STATE.SUCCESS:
//支付成功, 发送完成订单指令
subscribePay(ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(mSaleorder.getOrderNo(), C.PAY_CHANNEL.ALI)));
break;
default:
//支付失败
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), response.getMsg()));
mView.showPayFailFragment(null, mSaleorder);
break;
}
},
throwable -> {
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), throwable.getMessage()));
mView.showPayFailFragment(throwable, mSaleorder);
}
);
switch (C.PAY_SYSTEM.CURRENT) {
case C.PAY_SYSTEM.PAX.API:
this.payInPaxApi(C.PAY_CHANNEL.ALI, payCode);
break;
case C.PAY_SYSTEM.PAX.APP:
this.payInPaxApp(C.PAY_CHANNEL.ALI);
break;
}
}
@Override
public void payInWechat(String payCode) {
mView.showLoadingDialog();
//提交订单
commitOrder(
).flatMap(orderNo -> {
//获取支付中心参数
return ApiFactory.Pay.getPayKey();
}).flatMap(json -> {
//初始化支付中心,并发送支付指令
return PayCenter.getInstance().init(json).pay(C.PAY_CHANNEL.WECHAT, payCode, mSaleorder.getOrderPayAmt());
}).doFinally(() -> {
mView.dismissLoadingDialog();
}).subscribe(
response -> {
switch (response.getCode()) {
case com.xingdata.zxpay.C.PAY_STATE.ING:
//支付中, 显示支付对话框
mView.showPayingDialog(C.PAY_CHANNEL.WECHAT);
break;
case com.xingdata.zxpay.C.PAY_STATE.SUCCESS:
//支付成功, 发送完成订单指令
subscribePay(ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(mSaleorder.getOrderNo(), C.PAY_CHANNEL.WECHAT)));
break;
default:
//支付失败
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), response.getMsg()));
mView.showPayFailFragment(null, mSaleorder);
break;
}
},
throwable -> {
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), throwable.getMessage()));
mView.showPayFailFragment(throwable, mSaleorder);
}
);
switch (C.PAY_SYSTEM.CURRENT) {
case C.PAY_SYSTEM.PAX.API:
this.payInPaxApi(C.PAY_CHANNEL.WECHAT, payCode);
break;
case C.PAY_SYSTEM.PAX.APP:
this.payInPaxApp(C.PAY_CHANNEL.WECHAT);
break;
}
}
@Override
public void payInBank() {
commitOrder(
).flatMap(orderNo -> {
//获取支付中心参数
return ApiFactory.Pay.getPayKey();
}).flatMap(json -> {
//初始化支付中心,并发送支付指令
return PayCenter.getInstance().init(json).pay(C.PAY_CHANNEL.WECHAT, mSaleorder.getOrderPayAmt());
}).doFinally(() -> {
mView.dismissLoadingDialog();
}).subscribe(
response -> {
LogUtils.d(response.getMsg());
},
throwable -> {
LogUtils.e(throwable.getMessage());
}
);
switch (C.PAY_SYSTEM.CURRENT) {
case C.PAY_SYSTEM.PAX.APP:
this.payInPaxApp(C.PAY_CHANNEL.BANK);
break;
}
}
@Override
public void payInCard(Long cardNo, String password) {
ApiFactory.Recard.checkPwd(mVip.getVipId(), null, password).subscribe(
b -> {
mView.dismissPasswordDialog();
mView.showLoadingDialog();
subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.CARD, String.valueOf(cardNo)))));
},
throwable -> mView.showMsg(throwable.getMessage())
mCompositeDisposable.add(ApiFactory.Recard.checkPwd(mVip.getVipId(), null, password)
.subscribe(
b -> {
mView.dismissPasswordDialog();
mView.showLoadingDialog();
subscribePay(commitOrder()
.flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.CARD, String.valueOf(cardNo))))
);
},
throwable -> mView.showMsg(throwable.getMessage())
)
);
}
@Override
public void payInTally(String password) {
ApiFactory.Recard.checkPwd(mVip.getVipId(), String.valueOf(0L), password).subscribe(
b -> {
mView.dismissPasswordDialog();
mView.showLoadingDialog();
subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.TALLY))));
},
throwable -> mView.showMsg(throwable.getMessage())
mCompositeDisposable.add(ApiFactory.Recard.checkPwd(mVip.getVipId(), String.valueOf(0L), password)
.subscribe(
b -> {
mView.dismissPasswordDialog();
mView.showLoadingDialog();
subscribePay(commitOrder()
.flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.TALLY)))
);
},
throwable -> mView.showMsg(throwable.getMessage())
)
);
}
/**
* 百富接口支付
*
* @param payChannel 支付渠道
* @param payCode 支付码
*/
private void payInPaxApi(int payChannel, String payCode) {
mView.showLoadingDialog();
mCompositeDisposable.add(commitOrder()
.flatMap(orderNo -> {
//获取支付中心参数
return ApiFactory.Pay.getPayKey();
})
.flatMap(json -> {
//初始化支付中心,并发送支付指令
return PayCenter.getInstance().init(C.PAY_SYSTEM.CURRENT).setPayKey(json).pay(payChannel, payCode, mSaleorder.getOrderPayAmt());
})
.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(
response -> {
switch (response.getCode()) {
case com.xingdata.zxpay.C.PAY_STATE.ING:
//支付中, 显示支付对话框
mView.showPayingDialog(payChannel);
break;
case com.xingdata.zxpay.C.PAY_STATE.SUCCESS:
//支付成功, 发送完成订单指令
subscribePay(ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(mSaleorder.getOrderNo(), payChannel)));
break;
default:
//支付失败
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), response.getMsg()));
this.payFail(response.getMsg());
break;
}
},
throwable -> {
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), throwable.getMessage()));
this.payFail(throwable.getMessage());
}
)
);
}
/**
* 百富统一收银台APP支付
*
* @param payChannel 支付渠道
*/
private void payInPaxApp(int payChannel) {
mView.showLoadingDialog();
mCompositeDisposable.add(commitOrder()
.flatMap(orderNo -> {
//初始化支付中心,并发送支付指令
return NeptuneCenter.getInstance().init(App.instance).pay(orderNo, payChannel, mSaleorder.getOrderPayAmt());
})
.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(
response -> {
switch (response.getCode()) {
case com.xingdata.zxpay.C.PAY_STATE.ING:
//支付中, 显示支付对话框
mView.showPayingDialog(payChannel);
break;
case com.xingdata.zxpay.C.PAY_STATE.SUCCESS:
//支付成功, 发送完成订单指令
subscribePay(ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(mSaleorder.getOrderNo(), payChannel)));
break;
default:
//支付失败
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), response.getMsg()));
this.payFail(response.getMsg());
break;
}
},
throwable -> {
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), throwable.getMessage()));
this.payFail(throwable.getMessage());
}
)
);
}
@Override
public void checkPayState(int payType) {
mView.showLoadingDialog();
// JniFactory.Settle.query()
// .doFinally(() -> mView.dismissLoadingDialog())
// .subscribe(s -> {
// com.xingdata.zzdpos.api.Pay.Response r1 = JSON.parseObject(s.replace("\\", ""), com.xingdata.zzdpos.api.Pay.Response.class);
// switch (r1.getResponseCode()) {
// case C.PAY_STATE.SUCC:
// subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, payType))));
// break;
// case C.PAY_STATE.PAYING:
// mView.showMsg("交易处理中");
// break;
// default:
// mView.showPayFailFragment(null, mSaleorder);
// break;
// }
// },
// throwable -> mView.showPayFailFragment(throwable, mSaleorder));
PayCenter.getInstance().query(payType)
mCompositeDisposable.add(PayCenter.getInstance().query(payType)
.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(response -> {
switch (response.getCode()) {
......@@ -418,8 +410,9 @@ public class SettlePresenter extends SettleContract.Presenter {
}, throwable -> {
//支付失败
subscribeRemark(ApiFactory.Saleorder.addRemark(mSaleorder.getOrderNo(), throwable.getMessage()));
mView.showPayFailFragment(throwable, mSaleorder);
});
this.payFail(throwable);
})
);
}
@Override
......@@ -457,8 +450,10 @@ public class SettlePresenter extends SettleContract.Presenter {
*/
private void subscribePay(Observable<Saleorder> observable) {
mView.showLoadingDialog();
observable.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(this::paySucc, this::payFail);
mCompositeDisposable.add(observable
.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(this::paySucc, this::payFail)
);
}
/**
......@@ -468,10 +463,11 @@ public class SettlePresenter extends SettleContract.Presenter {
*/
private void subscribeRemark(Observable<String> observable) {
mView.showLoadingDialog();
observable.doFinally(() -> mView.dismissLoadingDialog())
mCompositeDisposable.add(observable.doFinally(() -> mView.dismissLoadingDialog())
.subscribe(s -> {
}, throwable -> {
});
})
);
}
......@@ -523,10 +519,17 @@ public class SettlePresenter extends SettleContract.Presenter {
/**
* 支付失败
*/
private void payFail(Throwable throwable) {
private void payFail(String throwable) {
mView.showPayFailFragment(throwable, mSaleorder);
}
/**
* 支付失败
*/
private void payFail(Throwable throwable) {
mView.showPayFailFragment(throwable.getMessage(), mSaleorder);
}
/**
* 设置会员
......
......@@ -54,7 +54,9 @@ public class C {
public final static int QUERY = 400;
}
/**
* 支付渠道
*/
public final class PAY_CHANNEL {
public static final int CASH = 1;
public static final int WECHAT = 2;
......@@ -65,13 +67,34 @@ public class C {
}
/**
* 渠道
* 支付系统
*/
static final class HOST {
final class PAY_SYSTEM {
/**
* 浙星
*/
static final int ZX = 100101;
/**
* 惠尔丰平台的渠道编号
* 拉卡拉
*/
final static int PAX = 100000;
static final int LKL = 100201;
/**
* 百富
*/
final class PAX {
/**
* 统一支付APP
*/
static final int APP = 100301;
/**
* 接口
*/
static final int API = 100302;
}
}
/**
......
package com.xingdata.zxpay;
import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.Utils;
import com.xingdata.zxpay.api.Response;
import com.xingdata.zxpay.model.Shopppp;
import com.xingdata.zxpay.pax.Factory;
import com.xingdata.zxpay.pax.PaxFactory;
import io.reactivex.Observable;
......@@ -19,12 +18,32 @@ public class PayCenter {
}
/**
* 交易基本信息
* 支付系统
*/
public Shopppp mShopppp;
private int mPaySystem;
public PayCenter init(String json) {
mShopppp = JSON.parseObject(json, Shopppp.class);
/**
* 支付信息
*/
public String mShoppppJson;
/**
* 设置支付信息
*/
public PayCenter setPayKey(String json) {
mShoppppJson = json;
return this;
}
/**
* 初始化
*
* @param paySystem 支付系统
* @return this
*/
public PayCenter init(int paySystem) {
this.mPaySystem = paySystem;
return this;
}
......@@ -37,11 +56,11 @@ public class PayCenter {
* @return 支付结果的Observable
*/
public Observable<Response> pay(int payChannel, String payCode, Long orderAmt) {
switch (mShopppp.getHost().getHostMapId()) {
case C.HOST.PAX:
return Factory.microPay(payChannel, payCode, Util.fenToYuan(orderAmt));
switch (mPaySystem) {
case C.PAY_SYSTEM.PAX.API:
return PaxFactory.getInstance().microPay(payChannel, payCode, Util.fenToYuan(orderAmt));
default:
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道"));
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, Utils.getApp().getResources().getString(R.string.unknown_channels)));
}
}
......@@ -54,11 +73,11 @@ public class PayCenter {
* @return 支付结果的Observable
*/
public Observable<Response> pay(int payChannel, Long orderAmt) {
switch (mShopppp.getHost().getHostMapId()) {
case C.HOST.PAX:
return Factory.qrPay(payChannel, Util.fenToYuan(orderAmt));
switch (mPaySystem) {
case C.PAY_SYSTEM.PAX.API:
return PaxFactory.getInstance().qrPay(payChannel, Util.fenToYuan(orderAmt));
default:
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道"));
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, Utils.getApp().getResources().getString(R.string.unknown_channels)));
}
}
......@@ -69,11 +88,11 @@ public class PayCenter {
* @return 查询结果的Observable
*/
public Observable<Response> query(int payChannel) {
switch (mShopppp.getHost().getHostMapId()) {
case C.HOST.PAX:
return Factory.query(payChannel);
switch (mPaySystem) {
case C.PAY_SYSTEM.PAX.API:
return PaxFactory.getInstance().query(payChannel);
default:
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, "未知渠道"));
return Observable.just(new Response(C.PAY_STATE.FAIL_CUSTOM, Utils.getApp().getResources().getString(R.string.unknown_channels)));
}
}
}
package com.xingdata.zxpay.api;
public class Factory {
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class Factory {
protected static <T> Observable<T> run(Observable<T> observable) {
return observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
}
package com.xingdata.zxpay.pax;
import com.xingdata.zxpay.PayCenter;
class Api extends com.xingdata.zxpay.api.Api {
Service service;
......@@ -21,6 +19,6 @@ class Api extends com.xingdata.zxpay.api.Api {
@Override
protected String getBaseUrl() {
return PayCenter.getInstance().mShopppp.getHost().getHostAddr();
return PaxFactory.getInstance().mShopppp.getHost().getHostAddr();
}
}
......@@ -6,16 +6,6 @@ class C {
*/
static final String VERSION = "V1.0";
/**
* 重试次数
*/
static final int RETRY_COUNT = 6;
/**
* 重试延迟时间
*/
static final int RETRY_DELAY_TIME = 5 * 1000;
/**
* 测试数据
*/
......
......@@ -3,7 +3,6 @@ package com.xingdata.zxpay.pax;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.blankj.utilcode.util.EncryptUtils;
import com.xingdata.zxpay.PayCenter;
class Request {
......@@ -14,9 +13,9 @@ class Request {
this.signType = C.SIGN_TYPE.MD5;
this.version = C.VERSION;
this.agentId = PayCenter.getInstance().mShopppp.getHost().getHostAcqCode();
this.mchId = PayCenter.getInstance().mShopppp.getPosppp().getHshopNo();
this.terId = PayCenter.getInstance().mShopppp.getPosppp().getHposNo();
this.agentId = PaxFactory.getInstance().mShopppp.getHost().getHostAcqCode();
this.mchId = PaxFactory.getInstance().mShopppp.getPosppp().getHshopNo();
this.terId = PaxFactory.getInstance().mShopppp.getPosppp().getHposNo();
}
/**
......@@ -147,7 +146,6 @@ class Request {
@JSONField(name = "sign")
private String sign;
String getVersion() {
return version;
}
......@@ -204,7 +202,6 @@ class Request {
this.timeStart = timeStart;
}
String getSubject() {
return subject;
}
......@@ -213,7 +210,6 @@ class Request {
this.subject = subject;
}
String getBody() {
return body;
}
......@@ -238,7 +234,6 @@ class Request {
this.authCode = authCode;
}
String getCurrency() {
return currency;
}
......@@ -255,7 +250,6 @@ class Request {
this.totalAmount = totalAmount;
}
String getFeeAmount() {
return feeAmount;
}
......@@ -264,7 +258,6 @@ class Request {
this.feeAmount = feeAmount;
}
String getReserved() {
return reserved;
}
......@@ -273,7 +266,6 @@ class Request {
this.reserved = reserved;
}
String getExpTime() {
return expTime;
}
......
......@@ -33,13 +33,27 @@ class Response {
@JSONField(name = "msg")
private String msg;
public Long getTime_start() {
return time_start;
}
public void setTime_start(Long time_start) {
this.time_start = time_start;
}
/**
* 交易时间
*/
@JSONField(name = "time_start")
private Long time_start;
/**
* 二维码地址
*/
@JSONField(name = "code_url")
private String codeUrl;
String getMethod() {
public String getMethod() {
return method;
}
......@@ -47,7 +61,7 @@ class Response {
this.method = method;
}
String getAgentId() {
public String getAgentId() {
return agentId;
}
......@@ -55,7 +69,7 @@ class Response {
this.agentId = agentId;
}
String getMchId() {
public String getMchId() {
return mchId;
}
......@@ -63,7 +77,7 @@ class Response {
this.mchId = mchId;
}
String getCode() {
public String getCode() {
return code;
}
......@@ -71,7 +85,7 @@ class Response {
this.code = code;
}
String getMsg() {
public String getMsg() {
return msg;
}
......@@ -79,7 +93,7 @@ class Response {
this.msg = msg;
}
String getCodeUrl() {
public String getCodeUrl() {
return codeUrl;
}
......
package com.xingdata.zxpay.pax;
import com.alibaba.fastjson.JSON;
import io.reactivex.functions.Function;
class ResultFilter implements Function<Response, com.xingdata.zxpay.api.Response> {
......@@ -24,7 +26,7 @@ class ResultFilter implements Function<Response, com.xingdata.zxpay.api.Response
}
switch (response.getMethod()) {
case C.METHOD.QRPAY:
r.setBody(response.getCodeUrl());
r.setBody(JSON.toJSONString(response));
break;
}
return r;
......
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