sdk:37ios支付及退款
This commit is contained in:
@@ -68,6 +68,22 @@ export default class UserOrder extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
// 准备退款
|
||||
public static async startRefund(roleId: string, localOrderID: string, message: string = '') {
|
||||
let result: UserOrderModelType = await UserOrderModel.findOneAndUpdate({ roleId, localOrderID },
|
||||
{ $set: { state: ORDER_STATE.CHECK_TO_REFUND, message } },
|
||||
{ new: true }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 退款
|
||||
public static async refund(roleId: string, localOrderID: string, message: string = '') {
|
||||
let result: UserOrderModelType = await UserOrderModel.findOneAndUpdate({ roleId, localOrderID },
|
||||
{ $set: { state: ORDER_STATE.REFUND, message } },
|
||||
{ new: true }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
//查询成功订单详情
|
||||
public static async findSuccessOrderByProductID(productID: string, roleId: string, activityId: number) {
|
||||
let result: UserOrderModelType[] = await UserOrderModel.find({ productID, roleId, activityId, state: ORDER_STATE.RESULT_SUCCESS }).lean(true);
|
||||
|
||||
Reference in New Issue
Block a user