支付:修复支付测试bug
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Application, BackendSession, HandlerService, } from 'pinus';
|
||||
import { genCode, resResult } from '../../../pubUtils/util';
|
||||
import { ACTIVITY_TYPE, DEBUG_MAGIC_WORD, ORDER_STATE, PAY_TYPE, STATUS, TASK_TYPE, TA_EVENT } from '../../../consts';
|
||||
import { ACTIVITY_TYPE, DEBUG_MAGIC_WORD, DEBUG_PRICE, ORDER_STATE, PAY_TYPE, STATUS, TASK_TYPE, TA_EVENT } from '../../../consts';
|
||||
import { dicRMB } from '../../../pubUtils/dictionary/DicRMB';
|
||||
import { UserOrderModel } from '../../../db/UserOrder';
|
||||
import _ = require('underscore');
|
||||
@@ -12,6 +12,7 @@ import { addRechargeMoney } from '../../../services/activity/rechargeMoneyServic
|
||||
import { addVipRechargeMoney } from '../../../services/activity/vipRechargeMoneyService';
|
||||
import { getActivityById } from '../../../services/activity/activityService';
|
||||
import { reportTAEvent } from '../../../services/sdkService';
|
||||
import { gameData } from '../../../pubUtils/data';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -112,6 +113,9 @@ export class orderHandler {
|
||||
reportTAEvent(roleId, TA_EVENT.RECHARGE, {
|
||||
pay_id: localOrderID, chargeId: productID, pay_name: message, pay_amount: price, pay_channel: payType
|
||||
}, ip)
|
||||
if(gameData.serverConst.DEBUG_PAY == 1) {
|
||||
productInfo = {...productInfo, price: DEBUG_PRICE}
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, { orderInfo: sdkOrderInfo, productInfo, localOrderID });
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { UserOrderModel, UserOrderModelType } from '../db/UserOrder';
|
||||
import { ACTIVITY_TYPE, ORDER_STATE, PAY_TYPE, PUSH_ROUTE, REFUND_PRICE_TO_GOLD, STATUS, TASK_TYPE, TA_EVENT, TA_USERSET_TYPE } from '../consts';
|
||||
import { ACTIVITY_TYPE, DEBUG_PRICE, ORDER_STATE, PAY_TYPE, PUSH_ROUTE, REFUND_PRICE_TO_GOLD, STATUS, TASK_TYPE, TA_EVENT, TA_USERSET_TYPE } from '../consts';
|
||||
import { dicRMB } from '../pubUtils/dictionary/DicRMB';
|
||||
import { makeYuanbaoShopReward } from './activity/yuanbaoService';
|
||||
import { RoleModel } from '../db/Role';
|
||||
@@ -32,6 +32,7 @@ import { recordFirstGift } from './activity/firstGiftService';
|
||||
import { makeTaskPass } from './activity/taskPassService';
|
||||
import { addGuildPay } from './activity/guildPayService';
|
||||
import { sendMessageToUserWithSuc } from './pushService';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
|
||||
export async function checkOrderCanBuy(roleId: string, serverId: number, activityData: ActivityModelType, productID: string, paramStr: string) {
|
||||
let activityId = activityData.activityId;
|
||||
@@ -277,7 +278,7 @@ export async function settleOrderFromRedisPub(message: string) {
|
||||
console.log('订单玩家错误');
|
||||
return false;
|
||||
}
|
||||
if(order.price != parseFloat(params.money)) {
|
||||
if((gameData.serverConst.DEBUG_PAY != 1 && order.price != parseFloat(params.money))||(gameData.serverConst.DEBUG_PAY == 1 && parseFloat(params.money) != DEBUG_PRICE)) {
|
||||
console.log('订单金额错误');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SDK_37_CONST, STATUS } from "../../consts";
|
||||
import { DEBUG_PRICE, SDK_37_CONST, STATUS } from "../../consts";
|
||||
import { RoleModel } from "../../db/Role";
|
||||
import { UserModel } from "../../db/User";
|
||||
import { LoginValidateData37 } from "../../domain/sdk";
|
||||
@@ -40,7 +40,7 @@ export async function applyOrder37(localOrderID: string, roleId: string, product
|
||||
ext
|
||||
}
|
||||
if(gameData.serverConst.DEBUG_PAY == 1) {
|
||||
body = {...body, money: 0.1}
|
||||
body = {...body, money: DEBUG_PRICE}
|
||||
}
|
||||
|
||||
let sign = get37Md5SignA(body, SDK_37_CONST.PAY_KEY);
|
||||
|
||||
@@ -23,7 +23,6 @@ export const REF_CIRCLE_MAIL_TIME = 6; // 统一一天刷新定期邮件时间
|
||||
export const PUSH_BATCH = 100; // 推送分批人数
|
||||
export const PUSH_INTERVAL = 5 * 1000; // 分批时间,5秒一批
|
||||
|
||||
|
||||
export enum TIME_OUTPUT_TYPE {
|
||||
DATE = 1,
|
||||
STAMP_10 = 2,
|
||||
@@ -1117,4 +1116,6 @@ export enum GuideUnloadNum {
|
||||
// 功能开启id,写死
|
||||
export enum SYSTEM_OPEN_ID {
|
||||
EXPEDITION = 36, // 远征
|
||||
}
|
||||
}
|
||||
|
||||
export const DEBUG_PRICE = 0.01;
|
||||
@@ -423,15 +423,15 @@ export class TreasureHuntData extends ActivityBase {
|
||||
arr.forEach(data => {
|
||||
switch(data.index) {
|
||||
case 1:
|
||||
this.firstPage = new TreasureHuntFirstPageData(data); break;
|
||||
this.firstPage = new TreasureHuntFirstPageData(<TreasureHuntFirstPageInDb>data); break;
|
||||
case 2:
|
||||
this.shop = new TreasureHuntShopData(data); break;
|
||||
this.shop = new TreasureHuntShopData(<TreasureHuntShopInDb>data); break;
|
||||
case 3:
|
||||
this.tasks = new TreasureHuntTaskData(data); break;
|
||||
this.tasks = new TreasureHuntTaskData(<TreasureHuntTaskInDb>data); break;
|
||||
case 4:
|
||||
this.challenge = new TreasureHuntChallengeData(data); break;
|
||||
this.challenge = new TreasureHuntChallengeData(<TreasureHuntChallengeInDb>data); break;
|
||||
case 5:
|
||||
this.treasureShop = new TreasureHuntTreasureShopData(data); break;
|
||||
this.treasureShop = new TreasureHuntTreasureShopData(<TreasureHuntTreasureShopInDb>data); break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import { Service } from 'egg';
|
||||
import { REDIS_KEY, PAY_37_CALLBACK_CODE, SDK_37_CONST, ORDER_STATE, SDK_37_TREAT_CODE, SERVER_STATUS, SDK_37_REFUND_CODE } from '@consts';
|
||||
import { REDIS_KEY, PAY_37_CALLBACK_CODE, SDK_37_CONST, ORDER_STATE, SDK_37_TREAT_CODE, SERVER_STATUS, SDK_37_REFUND_CODE, DEBUG_PRICE } from '@consts';
|
||||
import { GetGuildInfoByUserParam, GetServerListParam, GuildNameCallBackParam, IOSRefundParam, PayCallback37Data, RoleNameCallBackParam } from '../domain/sdk';
|
||||
import { RedisClient } from 'redis';
|
||||
import { get37GetServerMd5Sign, get37Md5SignA, get37Md5SignB, getChannelId, getRedisSubChannel } from '../pubUtils/sdkUtil';
|
||||
@@ -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) || (gameData.serverConst.DEBUG_PAY == 1 && parseFloat(params.money) != 0.1)) {
|
||||
if((gameData.serverConst.DEBUG_PAY != 1 && order.price != parseFloat(params.money)) || (gameData.serverConst.DEBUG_PAY == 1 && parseFloat(params.money) != DEBUG_PRICE)) {
|
||||
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}`);
|
||||
|
||||
Reference in New Issue
Block a user