|
@@ -25,6 +25,7 @@ import { ChannelService } from '../../service/channel';
|
|
|
import { ILogger } from '@midwayjs/logger';
|
|
|
import { WithdrawService } from '../../service/withdraw';
|
|
|
import { KycService } from '../../service/kyc';
|
|
|
+import { RepayService } from '../../service/repay';
|
|
|
|
|
|
@Provide()
|
|
|
@CoolController()
|
|
@@ -51,6 +52,9 @@ export class PayOpenController extends BaseController {
|
|
|
@Inject()
|
|
|
kycService: KycService;
|
|
|
|
|
|
+ @Inject()
|
|
|
+ repayService: RepayService
|
|
|
+
|
|
|
@Logger()
|
|
|
logger: ILogger;
|
|
|
|
|
@@ -66,6 +70,18 @@ export class PayOpenController extends BaseController {
|
|
|
return this.ok(await this.payService.query(payload));
|
|
|
}
|
|
|
|
|
|
+ @CoolTag(TagTypes.IGNORE_TOKEN)
|
|
|
+ @Post('/withdraw/create', { summary: '发起代付' })
|
|
|
+ public async withdraw(@Body(ALL) payload: any) {
|
|
|
+ return this.ok(await this.repayService.query(payload));
|
|
|
+ }
|
|
|
+
|
|
|
+ @CoolTag(TagTypes.IGNORE_TOKEN)
|
|
|
+ @Post('/withdraw/query', { summary: '代收查询' })
|
|
|
+ public async withdrawQuery(@Body(ALL) payload: any) {
|
|
|
+ return this.ok(await this.repayService.query(payload));
|
|
|
+ }
|
|
|
+
|
|
|
@CoolTag(TagTypes.IGNORE_TOKEN)
|
|
|
@Post('/notifyTest', { summary: '回调通知' })
|
|
|
public async notifyTest(@Body(ALL) payload: any) {
|
|
@@ -79,7 +95,7 @@ export class PayOpenController extends BaseController {
|
|
|
public async notifySunCardOrderGet(@Body(ALL) payload: any) {
|
|
|
const headers = this.ctx.headers;
|
|
|
this.logger.error('SunCard收到交易订单回调数据', JSON.stringify(payload), headers);
|
|
|
- await this.orderService.handleNotify('SunCard', payload, headers);
|
|
|
+ await this.orderService.handleNotify('SUN_CARD', payload, headers);
|
|
|
this.ctx.body = {
|
|
|
"is_success": "true",
|
|
|
"message": "success"
|
|
@@ -91,7 +107,7 @@ export class PayOpenController extends BaseController {
|
|
|
public async hambitBraNotifyOrderGet(@Body(ALL) payload: any) {
|
|
|
const headers = this.ctx.headers;
|
|
|
this.logger.error('hambit收到交易订单回调数据', JSON.stringify(payload), headers);
|
|
|
- await this.orderService.handleNotify('HamBitBra', payload, headers);
|
|
|
+ await this.orderService.handleNotify('HB_BRA', payload, headers);
|
|
|
this.ctx.body = {
|
|
|
"code": "200",
|
|
|
"success": "true"
|
|
@@ -99,11 +115,11 @@ export class PayOpenController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@CoolTag(TagTypes.IGNORE_TOKEN)
|
|
|
- @Post('/hambit/ind/notifyOrder', { summary: '印度交易订单回调通知' })
|
|
|
- public async hambitIndNotifyOrderGet(@Body(ALL) payload: any) {
|
|
|
+ @Post('/hambit/inr/notifyOrder', { summary: '印度交易订单回调通知' })
|
|
|
+ public async hambitInrNotifyOrderGet(@Body(ALL) payload: any) {
|
|
|
const headers = this.ctx.headers;
|
|
|
this.logger.error('hambit收到交易订单回调数据', JSON.stringify(payload), headers);
|
|
|
- await this.orderService.handleNotify('HamBitInd', payload, headers);
|
|
|
+ await this.orderService.handleNotify('HB_INR', payload, headers);
|
|
|
this.ctx.body = {
|
|
|
"code": "200",
|
|
|
"success": "true"
|