支付:测试1毛钱

This commit is contained in:
luying
2022-05-16 10:44:08 +08:00
parent 8e5047e238
commit b55ccbedb8
4 changed files with 9 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import { nowSeconds } from "../../pubUtils/timeUtil";
import { resResult } from "../../pubUtils/util";
import { get37Md5SignA } from "../../pubUtils/sdkUtil";
import { pinus } from "pinus";
import { gameData } from "../../pubUtils/data";
/**
* 37支付下单
@@ -38,6 +39,9 @@ export async function applyOrder37(localOrderID: string, roleId: string, product
time: nowSeconds(),
ext
}
if(gameData.serverConst.DEBUG_PAY == 1) {
body = {...body, money: 0.1}
}
let sign = get37Md5SignA(body, SDK_37_CONST.PAY_KEY);

View File

@@ -27,6 +27,8 @@ export interface DicServerConst {
readonly CLOSE_LOGIN_WHEN_ONLINE_MAX: number;
// 最大在线人数
readonly MAX_ONLINE_USER_COUNT: number;
// debug模式
readonly DEBUG_PAY: number;
}
export const dicServerConst: DicServerConst = {} as DicServerConst;

View File

@@ -15,5 +15,6 @@
{ "id": 7, "desc": "刷新信息", "route": "connector.entryHandler.refresh", "param": {}, "interval": 1000 },
{ "id": 8, "desc": "捐赠", "route": "guild.donateHandler.donate", "param": {}, "interval": 200 },
{ "id": 9, "desc": "碾压镇念塔", "route": "battle.towerBattleHandler.skipTower", "param": {}, "interval": 200 }
]
],
"DEBUG_PAY": 0
}

View File

@@ -53,7 +53,7 @@ export default class Sdk extends Service {
return ctx.service.utils.resResult(PAY_37_CALLBACK_CODE.SUCCESS, '');
}
ctx.service.utils.log('DEBUG', `[${ctx.request.url}] [${ctx.logcode}] pay37Callback check order status ok ${params.money} ${typeof params.money}`);
if(order.price != parseFloat(params.money)) {
if(order.price != parseFloat(params.money) || (gameData.serverConst.DEBUG_PAY == 1 && parseFloat(params.money) != 0.1)) {
return ctx.service.utils.resResult(PAY_37_CALLBACK_CODE.PAY_ERR, '');
}
ctx.service.utils.log('DEBUG', `[${ctx.request.url}] [${ctx.logcode}] pay37Callback check money ok ${order.price} ${params.money}`);