Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TangKuPos
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王海
TangKuPos
Commits
332b953f
Commit
332b953f
authored
Mar 12, 2018
by
zhang_z
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打包;
parent
88dc5b5e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
58 deletions
+58
-58
app/src/main/java/com/xingdata/zzdpos/ui/settle/SettlePresenter.java
...n/java/com/xingdata/zzdpos/ui/settle/SettlePresenter.java
+56
-58
pay/src/main/java/com/xingdata/zxpay/pax/Service.java
pay/src/main/java/com/xingdata/zxpay/pax/Service.java
+2
-0
No files found.
app/src/main/java/com/xingdata/zzdpos/ui/settle/SettlePresenter.java
View file @
332b953f
...
@@ -2,11 +2,9 @@ package com.xingdata.zzdpos.ui.settle;
...
@@ -2,11 +2,9 @@ package com.xingdata.zzdpos.ui.settle;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.blankj.utilcode.util.LogUtils
;
import
com.blankj.utilcode.util.StringUtils
;
import
com.blankj.utilcode.util.StringUtils
;
import
com.blankj.utilcode.util.ToastUtils
;
import
com.blankj.utilcode.util.ToastUtils
;
import
com.xingdata.api.print.ZX_PrintPOS
;
import
com.xingdata.api.print.ZX_PrintPOS
;
import
com.xingdata.zxpay.PayCenter
;
import
com.xingdata.zzdpos.C
;
import
com.xingdata.zzdpos.C
;
import
com.xingdata.zzdpos.api.ApiFactory
;
import
com.xingdata.zzdpos.api.ApiFactory
;
import
com.xingdata.zzdpos.api.JniFactory
;
import
com.xingdata.zzdpos.api.JniFactory
;
...
@@ -226,72 +224,72 @@ public class SettlePresenter extends SettleContract.Presenter {
...
@@ -226,72 +224,72 @@ public class SettlePresenter extends SettleContract.Presenter {
@Override
@Override
public
void
payInAli
(
String
payCode
)
{
public
void
payInAli
(
String
payCode
)
{
mView
.
showLoadingDialog
();
mView
.
showLoadingDialog
();
// commitOrder()
// .flatMap(orderNo -> JniFactory.Settle.pay(C.PAY_CHANNEL.ALI, payCode, mSaleorder.getOrderPayAmt(), orderNo))
// .doFinally(() -> mView.dismissLoadingDialog())
// .subscribe(
// response -> {
// com.xingdata.zzdpos.api.Pay.Response r1 = JSON.parseObject(response.replace("\\", ""), com.xingdata.zzdpos.api.Pay.Response.class);
// switch (r1.getResponseCode()) {
// case "0000":
// subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.ALI)).doFinally(() -> mView.dismissLoadingDialog())));
// break;
// case "0098":
// mView.showPayingDialog(C.PAY_CHANNEL.ALI, r1);
// break;
// default:
// mView.showPayFailFragment(null, mSaleorder);
// break;
// }
// },
// throwable -> mView.showPayFailFragment(throwable, mSaleorder));
commitOrder
()
commitOrder
()
.
flatMap
(
orderNo
->
PayCenter
.
getInstance
().
pay
(
C
.
PAY_CHANNEL
.
ALI
,
payCode
,
mSaleorder
.
getOrderPayAmt
()
))
.
flatMap
(
orderNo
->
JniFactory
.
Settle
.
pay
(
C
.
PAY_CHANNEL
.
ALI
,
payCode
,
mSaleorder
.
getOrderPayAmt
(),
orderNo
))
.
doFinally
(()
->
mView
.
dismissLoadingDialog
())
.
doFinally
(()
->
mView
.
dismissLoadingDialog
())
.
subscribe
(
.
subscribe
(
response
->
{
response
->
{
LogUtils
.
e
(
response
.
getMsg
());
com
.
xingdata
.
zzdpos
.
api
.
Pay
.
Response
r1
=
JSON
.
parseObject
(
response
.
replace
(
"\\"
,
""
),
com
.
xingdata
.
zzdpos
.
api
.
Pay
.
Response
.
class
);
},
switch
(
r1
.
getResponseCode
())
{
throwable
->
{
case
"0000"
:
mView
.
showPayFailFragment
(
throwable
,
mSaleorder
);
subscribePay
(
commitOrder
().
flatMap
(
orderNo
->
ApiFactory
.
Saleorder
.
addOrderPayMis
(
mSaleorder
.
pay
(
orderNo
,
C
.
PAY_CHANNEL
.
ALI
)).
doFinally
(()
->
mView
.
dismissLoadingDialog
())));
});
break
;
case
"0098"
:
mView
.
showPayingDialog
(
C
.
PAY_CHANNEL
.
ALI
,
r1
);
break
;
default
:
mView
.
showPayFailFragment
(
null
,
mSaleorder
);
break
;
}
}
},
@Override
throwable
->
mView
.
showPayFailFragment
(
throwable
,
mSaleorder
));
public
void
payInWechat
(
String
payCode
)
{
mView
.
showLoadingDialog
();
// commitOrder()
// commitOrder()
// .flatMap(orderNo ->
JniFactory.Settle.pay(C.PAY_CHANNEL.WECHAT, payCode, mSaleorder.getOrderPayAmt(), orderNo
))
// .flatMap(orderNo ->
PayCenter.getInstance().pay(C.PAY_CHANNEL.ALI, payCode, mSaleorder.getOrderPayAmt()
))
// .doFinally(() -> mView.dismissLoadingDialog())
// .doFinally(() -> mView.dismissLoadingDialog())
// .subscribe(
// .subscribe(
// response -> {
// response -> {
// com.xingdata.zzdpos.api.Pay.Response r1 = JSON.parseObject(response.replace("\\", ""), com.xingdata.zzdpos.api.Pay.Response.class);
// LogUtils.e(response.getMsg());
// switch (r1.getResponseCode()) {
// case C.PAY_STATE.SUCC:
// subscribePay(commitOrder().flatMap(orderNo -> ApiFactory.Saleorder.addOrderPayMis(mSaleorder.pay(orderNo, C.PAY_CHANNEL.WECHAT)).doFinally(() -> mView.dismissLoadingDialog())));
// break;
// case C.PAY_STATE.PAYING:
// mView.showPayingDialog(C.PAY_CHANNEL.WECHAT, r1);
// break;
// default:
// mView.showPayFailFragment(null, mSaleorder);
// break;
// }
// },
// },
// throwable -> mView.showPayFailFragment(throwable, mSaleorder));
// throwable -> {
ApiFactory
.
Pay
.
getPayKey
().
flatMap
(
s
->
{
// mView.showPayFailFragment(throwable, mSaleorder);
return
Observable
.
just
(
commitOrder
()
// });
.
flatMap
(
orderNo
->
PayCenter
.
getInstance
().
init
(
s
).
pay
(
C
.
PAY_CHANNEL
.
WECHAT
,
payCode
,
mSaleorder
.
getOrderPayAmt
()))
}
@Override
public
void
payInWechat
(
String
payCode
)
{
mView
.
showLoadingDialog
();
commitOrder
()
.
flatMap
(
orderNo
->
JniFactory
.
Settle
.
pay
(
C
.
PAY_CHANNEL
.
WECHAT
,
payCode
,
mSaleorder
.
getOrderPayAmt
(),
orderNo
))
.
doFinally
(()
->
mView
.
dismissLoadingDialog
())
.
doFinally
(()
->
mView
.
dismissLoadingDialog
())
.
subscribe
(
.
subscribe
(
response
->
{
response
->
{
LogUtils
.
e
(
response
.
getMsg
());
com
.
xingdata
.
zzdpos
.
api
.
Pay
.
Response
r1
=
JSON
.
parseObject
(
response
.
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
,
C
.
PAY_CHANNEL
.
WECHAT
)).
doFinally
(()
->
mView
.
dismissLoadingDialog
())));
break
;
case
C
.
PAY_STATE
.
PAYING
:
mView
.
showPayingDialog
(
C
.
PAY_CHANNEL
.
WECHAT
,
r1
);
break
;
default
:
mView
.
showPayFailFragment
(
null
,
mSaleorder
);
break
;
}
},
},
throwable
->
{
throwable
->
mView
.
showPayFailFragment
(
throwable
,
mSaleorder
));
mView
.
showPayFailFragment
(
throwable
,
mSaleorder
);
// ApiFactory.Pay.getPayKey().flatMap(s -> {
})
// return Observable.just(commitOrder()
);
// .flatMap(orderNo -> PayCenter.getInstance().init(s).pay(C.PAY_CHANNEL.WECHAT, payCode, mSaleorder.getOrderPayAmt()))
}).
subscribe
();
// .doFinally(() -> mView.dismissLoadingDialog())
// .subscribe(
// response -> {
// LogUtils.e(response.getMsg());
// },
// throwable -> {
// mView.showPayFailFragment(throwable, mSaleorder);
// })
// );
// }).subscribe();
}
}
...
...
pay/src/main/java/com/xingdata/zxpay/pax/Service.java
View file @
332b953f
...
@@ -5,6 +5,8 @@ import retrofit2.http.Body;
...
@@ -5,6 +5,8 @@ import retrofit2.http.Body;
import
retrofit2.http.POST
;
import
retrofit2.http.POST
;
interface
Service
{
interface
Service
{
@POST
(
C
.
URL
.
ACTION
)
@POST
(
C
.
URL
.
ACTION
)
Observable
<
Response
>
action
(
@Body
com
.
xingdata
.
zxpay
.
pax
.
Request
request
);
Observable
<
Response
>
action
(
@Body
com
.
xingdata
.
zxpay
.
pax
.
Request
request
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment