소스 검색

feat(): 添加客户的回调接口

max 7 달 전
부모
커밋
6103ca2c8d
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      src/modules/payment/adapter/sunpay.adapter.ts

+ 9 - 4
src/modules/payment/adapter/sunpay.adapter.ts

@@ -313,8 +313,7 @@ export class SunPayAdapter implements ChannelAdapter {
     return parseFloat(data.balance);
   }
   async getBanks(params: any = {}) {
-    const res = await this.request('GET', '/Fiat/Banks', params);
-    return res;
+    return await this.request('GET', '/Fiat/Banks', params);
   }
   async getBank(params: any = {}) {
     console.log('getBank-=--=',params)
@@ -341,9 +340,15 @@ export class SunPayAdapter implements ChannelAdapter {
     let res = null;
     if (customer) {
       params.customer_id = customer.customer_id;
-      res = await this.request('PUT', '/Fiat/Customer', params);
+      res = await this.request('PUT', '/Fiat/Customer', {
+        ...params,
+
+      });
     } else {
-      res = await this.request('POST', '/Fiat/Customer', params);
+      res = await this.request('POST', '/Fiat/Customer', {
+        ...params,
+        webhook_url: this.globalConfig.callback.sunpay // 回调用fusionPay配置的的回调生成用户信息
+      });
     }
     await this.customerEntity.save({
       type: params.customer_type,