sdk:37sdk发起支付接口
This commit is contained in:
@@ -6,6 +6,7 @@ import { UserOrderModel } from '../../../db/UserOrder';
|
||||
import _ = require('underscore');
|
||||
import { applyOrderWX, checkOrderWX } from '../../../services/pay/weixinPay';
|
||||
import { applyOrderALI, checkOrderALI } from '../../../services/pay/aliPay';
|
||||
import { applyOrder37 } from '../../../services/pay/37Pay';
|
||||
import { makeOrder } from '../../../services/orderService';
|
||||
import { addRechargeMoney } from '../../../services/activity/rechargeMoneyService';
|
||||
import { ActivityModel, ActivityModelType } from '../../../db/Activity';
|
||||
@@ -55,10 +56,21 @@ export class orderHandler {
|
||||
let orderID = '';//平台订单号
|
||||
let sdkOrderInfo = null;//客户端需要的平台订单信息
|
||||
switch (payType) {
|
||||
case PAY_TYPE.THREE_SEVEN:
|
||||
{
|
||||
let pay37Order = await applyOrder37(localOrderID, roleId, productInfo);
|
||||
if (pay37Order.code == -1) {
|
||||
console.log('37下单失败')
|
||||
return pay37Order.resData;
|
||||
}
|
||||
sdkOrderInfo = pay37Order.data;
|
||||
orderID = ''
|
||||
break;
|
||||
}
|
||||
case PAY_TYPE.WX:
|
||||
{
|
||||
let weixinOrder = await applyOrderWX(localOrderID, price * 100, message);
|
||||
if (weixinOrder.code == 0) {
|
||||
if (weixinOrder.code == -1) {
|
||||
console.log('微信下单失败')
|
||||
return resResult(STATUS.APPLY_ORDER_ERROR);
|
||||
}
|
||||
@@ -69,7 +81,7 @@ export class orderHandler {
|
||||
case PAY_TYPE.ALI:
|
||||
{
|
||||
let aliOrder = await applyOrderALI(localOrderID, price, message);
|
||||
if (aliOrder.code == 0) {
|
||||
if (aliOrder.code == -1) {
|
||||
console.log('支付宝下单失败')
|
||||
return resResult(STATUS.APPLY_ORDER_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user