lrf 2 år sedan
förälder
incheckning
3cf004c38c
1 ändrade filer med 6 tillägg och 7 borttagningar
  1. 6 7
      app/service/trade/pay.js

+ 6 - 7
app/service/trade/pay.js

@@ -126,8 +126,6 @@ class PayService extends CrudService {
       // 清空事务
       this.tran.clean();
     }
-
-
   }
 
   /**
@@ -145,7 +143,6 @@ class PayService extends CrudService {
     }
   }
 
-
   /**
    * 微信支付:整理出uniapp需要的数据
    * @param {Object} data 微信接口的数据
@@ -227,17 +224,19 @@ class PayService extends CrudService {
 
   /**
    * TODO 退款,金额需要指定.可能是部分退款,也可能是全额退款
-   * @param {String} order_no 订单号
+   * @param {String} order_no 支付订单号
+   * @param {String} out_refund_no 退款单号
+   * @param {String} money 退款金额
    * @param {String} reason 原因
    */
-  async refund(order_no, reason) {
+  async refund({ order_no, out_refund_no, money, reason }) {
     assert(order_no, '缺少订单号,无法查询订单信息');
+    assert(out_refund_no, '缺少退款单号,无法退款');
     const url = `${this.wxDomain}/pay/refundOrder`;
-    const params = { config: this.appConfig, order_no, reason };
+    const params = { config: this.appConfig, order_no, out_refund_no, money, reason };
     const wxRefundReq = await this.httpUtil.cpost(url, params);
     return wxRefundReq || 'ok';
   }
-
 }
 
 module.exports = PayService;