Commit 3a0c5457 authored by Su-Yi's avatar Su-Yi

添加支付里回调验证

parent 7dc6a453
......@@ -94,10 +94,33 @@ public class Pay {
Assert.assertEquals(result,"OK",network.message(cancelParams, PAY_ORDERCANCEL,"取消支付:取消支付失败",response.body().asString())); //判断返回的微信调起参数中appId是否正确
}
// @Test (description = "默认付费_成功支付",priority = 4)
// public void 默认付费_成功支付() throws IOException {
//
// }
@Test (description = "默认付费_微信支付后回调",priority = 4)
public void 默认付费_微信支付后回调() throws IOException {
//创建支付
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("userVersion",1);
payParams.put("comboId","Kj21MTU");
payParams.put("oaId","1");
payParams.put("paySource","2");
payParams.put("sellerFrom","");
Response response = network.postResponse(payParams,PAY_ORDERCREATE);
String tradeNo = response.jsonPath().getString("data.tradeNo");
// mock微信回调成功
Map<String, Object> callbackParams = new HashMap<String, Object>();
callbackParams.put("tradeNo",tradeNo);
callbackParams.put("payTradeNo","test");
callbackParams.put("payResult",true);
response = network.getResponse(callbackParams,PAY_CALLOUT);
boolean result = response.jsonPath().getBoolean("data");
Assert.assertTrue(result,network.message(callbackParams,PAY_CALLOUT,"微信支付回调成功,但我们订单处理失败",response.body().asString()));
// mock微信回调失败
callbackParams.put("payResult",false);
response = network.getResponse(callbackParams,PAY_CALLOUT);
result = response.jsonPath().getBoolean("data");
Assert.assertTrue(result,network.message(callbackParams,PAY_CALLOUT,"微信支付回调失败,但我们订单处理也失败",response.body().asString()));
}
@Test (description = "默认付费_切换会员类型为保险版",priority = 5)
public void 默认付费_切换为保险版会员类型() throws IOException {
......@@ -131,10 +154,10 @@ public class Pay {
@AfterClass
public static void tearDown() throws IOException, InterruptedException {
apiCount += 6;
apiCount += 7;
// 切换为保险版vip
ManagerUtil.switchvip(ManagerUtil.getSellerId());
ManagerUtil.switchvip();
//延迟2秒
Thread.sleep(2000);
......
......@@ -6,11 +6,11 @@ public class BasicConfig {
// *************** 配置信息,每次重新配置以下信息就ok ***************
// 是否推送
public static final boolean isPushReport = false; //true
public static final boolean isPushReport = true; //true
// 用户微信昵称
public static final String WECHAT_NAME = "小疙瘩人寿"; //true
// 用户tku
public static final String AGENT_TKU = "T3gM31f18jAWCm9eqftWyzQUphBHVffMC23MD7Wj7wx7HuhnNuoCruNaDb9R4KYyDP3BVF9SpsZV5Grkup";
public static final String AGENT_TKU = "T3gM31f18jAWCfbjiyPds6LuAsfydVKRb9m3WoUoTqb1Qh8ktrwxtwja7msr2m4LkCm6nJ6CCoHTtzT7Lr";
// *************** 钉钉机器人 ***************
// 线上-告警群
......@@ -76,6 +76,8 @@ public class BasicConfig {
public static final String PAY_ORDERCANCEL = HOST + "/kjy/order/cancel";
public static final String PAY_CALLOUT = HOST + "/kjy/order/payCallout";
public static final String PAY_VERSIONEXCHANGE = HOST + "/kjy/mp/version/exchange";
public static final String PAY_DISTRIBUTE = HOST + "/kjy/sp/visitorPayment/distribute";
......
......@@ -58,7 +58,9 @@ public class ManagerUtil {
}
// 切换vip
public static void switchvip(String sellerId) {
public static void switchvip() {
String sellerId = getSellerId();
// 登录下,检验是否失效
ssoLogin();
......@@ -90,7 +92,8 @@ public class ManagerUtil {
}
// 切换为内部人员 isInternalSeller 传1代表内部人员 传0代表非内部人员
public static void switchInsider(String sellerId,int isInternalSeller){
public static void switchInsider(int isInternalSeller){
String sellerId = getSellerId();
// 登录下,检验是否失效
ssoLogin();
......@@ -108,9 +111,8 @@ public class ManagerUtil {
public static void main(String[] args) throws IOException {
String sellerId = getSellerId();
switchInsider(sellerId,1);
switchvip(sellerId);
// switchInsider(1);
// switchvip();
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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