Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-sportstest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-sportstest
Commits
ba4e4b08
Commit
ba4e4b08
authored
Jun 21, 2025
by
yangfangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决报错
parent
f6fee968
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
38 deletions
+38
-38
src/main/java/com/xiaomai/cases/polar/finance/cashier/TestRefundByRecord.java
+38
-38
No files found.
src/main/java/com/xiaomai/cases/polar/finance/cashier/TestRefundByRecord.java
View file @
ba4e4b08
...
@@ -33,43 +33,43 @@ public class TestRefundByRecord extends XMBaseTest {
...
@@ -33,43 +33,43 @@ public class TestRefundByRecord extends XMBaseTest {
//目前1808757176611880962这笔流水是已经结算过的收款流水,商户号下没有钱退,但是当商户号下有钱可退的时候,这个case会报错,因为可以退成功
//目前1808757176611880962这笔流水是已经结算过的收款流水,商户号下没有钱退,但是当商户号下有钱可退的时候,这个case会报错,因为可以退成功
//乐动收银退款预校验-检查流水是否可退
//乐动收银退款预校验-检查流水是否可退
String
checkBeforeRefundCode
=
cashierTools
.
checkBeforeRefund
(
"1808757176611880962"
,
BigDecimal
.
valueOf
(
0.01
)).
getJSONObject
(
"result"
).
getString
(
"code"
);
//
String checkBeforeRefundCode=cashierTools.checkBeforeRefund("1808757176611880962", BigDecimal.valueOf(0.01)).getJSONObject("result").getString("code");
//
try
{
//
try {
Thread
.
sleep
(
1000
);
//
Thread.sleep(1000);
}
catch
(
InterruptedException
e
)
{
//
} catch (InterruptedException e) {
throw
new
RuntimeException
(
e
);
//
throw new RuntimeException(e);
}
//
}
//
//如果校验为可退
//
//如果校验为可退
if
(
"SUCCESS"
.
equals
(
checkBeforeRefundCode
)){
//
if("SUCCESS".equals(checkBeforeRefundCode)){
//
//流水退款
//
//流水退款
JSONObject
refundByRecordResult
=
new
JSONObject
();
//
JSONObject refundByRecordResult=new JSONObject();
refundByRecordResult
.
put
(
"transAmount"
,
0.01
);
//
refundByRecordResult.put("transAmount",0.01);
refundByRecordResult
.
put
(
"refundReason"
,
RandomStringUtil
.
randomString
(
6
));
//
refundByRecordResult.put("refundReason", RandomStringUtil.randomString(6));
refundByRecordResult
.
put
(
"orderType"
,
"PAY_QR_CODE"
);
//
refundByRecordResult.put("orderType","PAY_QR_CODE");
refundByRecordResult
.
put
(
"payTransNo"
,
"1808757176611880962"
);
//
refundByRecordResult.put("payTransNo","1808757176611880962");
refundByRecordResult
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
//
refundByRecordResult.put("brandId", xmAppApi.getLoginInfo().getBrandId());
refundByRecordResult
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
//
refundByRecordResult.put("studioId", xmAppApi.getLoginInfo().getStudioId());
refundByRecordResult
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
//
refundByRecordResult.put("operatorId", xmAppApi.getLoginInfo().getAdminId());
//
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
refundByRecordResult
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
//
xmAppApi.doRequest(RequestType.JSON, params, refundByRecordResult.toJSONString(), headers).assetsSuccess(true);
String
success
=
xmAppApi
.
getBodyInJSON
().
getString
(
"success"
);
//
String success = xmAppApi.getBodyInJSON().getString("success");
String
failCode
=
xmAppApi
.
getBodyInJSON
().
getJSONObject
(
"result"
).
getString
(
"failCode"
);
//
String failCode = xmAppApi.getBodyInJSON().getJSONObject("result").getString("failCode");
Assert
.
assertEquals
(
success
,
"true"
,
"获取流水退款失败"
);
//
Assert.assertEquals(success, "true", "获取流水退款失败");
Assert
.
assertEquals
(
failCode
,
"OTHER_ERROR"
,
"当前乐动收银余额不足,无法退款,请在线收款后再次发起退款或者线下处理退款"
);
//
Assert.assertEquals(failCode, "OTHER_ERROR", "当前乐动收银余额不足,无法退款,请在线收款后再次发起退款或者线下处理退款");
//
}
//
}
//
else
{
//
else{
Assert
.
assertEquals
(
checkBeforeRefundCode
,
"AMOUNT_LIMIT"
,
"订单关联流水可退金额不足,请修改退款金额后重试"
);
//
Assert.assertEquals(checkBeforeRefundCode,"AMOUNT_LIMIT","订单关联流水可退金额不足,请修改退款金额后重试");
}
//
}
//
//
}
}
}
}
//
//
//
//
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