1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327 |
- import {
- All,
- ALL,
- Body,
- Del,
- Get,
- Inject,
- Param,
- Post,
- Provide,
- Put,
- Query,
- } from '@midwayjs/decorator';
- import { BaseController, CoolController } from '@cool-midway/core';
- import { Context } from 'vm';
- import { IndividualEntity } from '../../payment/entity/individual';
- import { EasyPayAdapter } from '../../payment/adapter/easypay.adapter';
- import { EasyOpenService } from '../service/open';
- import { OrderType } from '../entity/open_payment_order';
- import {Fields, Files} from "@midwayjs/core";
- // import { FileItem } from '@midwayjs/upload';
- /**
- * 客户管理
- */
- @Provide()
- @CoolController('/api/open')
- export class OpenApiController extends BaseController {
- @Inject()
- ctx: Context; // Inject the context
- @Inject()
- easyPayAdapter: EasyPayAdapter;
- @Inject()
- easyOpenService: EasyOpenService;
- /**
- * 生成sign
- */
- @Post('/sign', { summary: '创建sign' })
- async createSign(@Body(ALL) userBody: any) {
- const { params, timestamp, nonce, secret } = userBody;
- return this.easyOpenService.createSign(params, timestamp, nonce, secret);
- }
- /**
- * 创建账户
- */
- @Post('/v3/accounts', { summary: '创建账户' })
- async createPayInOrder(@Body(ALL) params: any) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- const res = await this.easyPayAdapter.request(method, path, params);
- this.easyOpenService.save_user(res, params);
- return res;
- }
- /**
- * 查询账户列表
- */
- @Get('/v3/accounts', { summary: '查询账户列表' })
- async getAccounts(@Query(ALL) params: any) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询账户
- */
- @Get('/v3/accounts/:id', { summary: '查询账户' })
- async getAccountsInfo(@Param('id') id: any) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- return await this.easyPayAdapter.request(
- method,
- `${path}`.replace(':id', id),
- {}
- );
- }
- /**
- * 修改账户实名
- */
- @Put('/v3/accounts/:id', { summary: '修改账户实名' })
- async putAccountsInfo(@Param('id') id: any, @Body() params: any) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- return await this.easyPayAdapter.request(
- method,
- `${path}`.replace(':id', id),
- params
- );
- }
- /**
- * 查询余额
- */
- @Get('/v3/accounts/:account_id/balances', { summary: '查询余额' })
- async getAccountsBalances(
- @Param('account_id') account_id: any,
- @Body() params: any
- ) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- return await this.easyPayAdapter.request(
- method,
- `${path}`.replace(':account_id', account_id),
- params
- );
- }
- /**
- * 申请收款账户
- */
- @Post('/v3/applications', { summary: '申请收款账户' })
- async applications(@Body() params: any) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- const res = await this.easyPayAdapter.request(method, path, params);
- this.easyOpenService.save_user_account(res, params);
- return res;
- }
- /**
- * 查询申请列表
- */
- @Get('/v3/applications', { summary: '查询申请列表' })
- async getApplications(@Query() params: any) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询申请
- */
- @Get('/v3/applications/:id', { summary: '查询申请' })
- async getApplicationsInfo(@Param('id') id: string) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 查询收款账户列表
- */
- @Get('/v1/bank_accounts', { summary: '查询收款账户列表' })
- async getBank_accounts(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询收款账户
- */
- @Get('/v1/bank_accounts/:id', { summary: '查询收款账户' })
- async getBank_accountsInfo(@Param('id') id: any) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 创建支付订单
- */
- @Post('/v3/acquiring/payments', { summary: '创建支付订单' })
- async CreatedAcquiringPayments(@Body() params: any) {
- const method = this.ctx.method;
- const path = this.ctx.path;
- const res = await this.easyPayAdapter.request(method, path, params);
- // this.easyOpenService.save_user_order(res, params, OrderType.ACQUIRING_PAYMENT);
- return res;
- }
- /**
- * 查询支付单
- */
- @Get('/v3/acquiring/payments/:id', { summary: '查询支付单' })
- async getAcquiringPaymentsInfo(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 取消支付单
- */
- @Post('/v3/acquiring/payments/:id/cancel', { summary: '取消支付单' })
- async cancelAcquiringPayments(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 查询支付单列表
- */
- @Get('/v3/acquiring/payments', { summary: '查询支付单列表' })
- async getAcquiringPayments(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- console.log('Request params:', params);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 退款
- */
- @Post('/v3/acquiring/refunds', { summary: '退款' })
- async acquiringRefunds(@Body() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- console.log('Request params:', params);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- const res = await this.easyPayAdapter.request(method, path, params);
- // this.easyOpenService.save_user_order(res, params, OrderType.ACQUIRING_REFUND);
- return res;
- }
- /**
- * 查询退款
- */
- @Get('/v3/acquiring/refunds/:id', { summary: '查询退款' })
- async acquiringRefundsInfo(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 查询退款单列表
- */
- @Get('/v3/acquiring/refunds', { summary: '查询退款单列表' })
- async acquiringRefundsList(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询对账单列表
- */
- @Get('/v3/acquiring/statements', { summary: '查询对账单列表' })
- async acquiringStatements(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询结算单列表
- */
- @Get('/v3/acquiring/settlements', { summary: '查询结算单列表' })
- async acquiringSettlements(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询结算单列表
- */
- @Get('/v3/acquiring/settlements/:id', { summary: '查询结算单列表' })
- async acquiringSettlementsInfo(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 查询渠道汇率
- */
- @Get('/v3/acquiring/exchange_rates', { summary: '查询渠道汇率' })
- async acquiringExchange_rates(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询入账列表
- */
- @Get('/v1/deposits', { summary: '查询入账列表' })
- async depositsList(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- console.log('Request params:', params);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询入账
- */
- @Get('/v1/deposits/:id', { summary: '查询入账' })
- async depositsInfo(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 入账凭证下载
- */
- @Get('/v1/deposits/:id/proof', { summary: '入账凭证下载' })
- async depositsProofInfo(@Param('id') id: any, @Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询汇率
- */
- @Get('/v1/exchange_rates', { summary: '入账凭证下载' })
- async exchange_ratesInfo(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 创建换汇订单
- */
- @Post('/v1/exchanges', { summary: '创建换汇订单' })
- async createdExchanges(@Body() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- const res = await this.easyPayAdapter.request(method, path, params);
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // this.easyOpenService.save_user_order(res, params, OrderType.CURRENCY_EXCHANGE);
- return res;
- }
- /**
- * 查询换汇订单列表
- */
- @Get('/v1/exchanges', { summary: '查询换汇订单列表' })
- async exchangesList(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询换汇订单
- */
- @Get('/v1/exchanges/:id', { summary: '查询换汇订单' })
- async exchangesInfo(@Param() id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 付款
- */
- @Post('/v1/payments', { summary: '付款' })
- async createdPayments(@Body() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- const res = await this.easyPayAdapter.request(method, path, params);
- // this.easyOpenService.save_user_order(res, params, OrderType.PAYMENT);
- return res;
- }
- /**
- * 查询付款列表
- */
- @Get('/v1/payments', { summary: '查询付款列表' })
- async getPaymentsList(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询付款
- */
- @Get('/v1/payments/:id', { summary: '查询付款' })
- async paymentsInfo(@Param() id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 补充材料
- */
- @Post('/v1/payments/:id/documents', { summary: '补充材料' })
- async putPaymentsDocuments(@Param() id: any, @Body() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 付款凭证下载
- */
- @Get('/v1/payments/proof', { summary: '付款凭证下载' })
- async paymentsProof(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 转账
- */
- @Post('/v1/transfers', { summary: '转账' })
- async transfers(@Body() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- const res = await this.easyPayAdapter.request(method, path, params);
- // this.easyOpenService.save_user_order(res, params, OrderType.TRANSFER);
- return res;
- }
- /**
- * 查询转账列表
- */
- @Get('/v1/transfers', { summary: '查询转账列表' })
- async transfersList(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- console.log('Request params:', params);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询转账
- */
- @Get('/v1/transfers/:id', { summary: '查询转账' })
- async transfersInfo(@Param() id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 查询账户流水
- */
- @Get('/v3/accounts/:account_id/transactions', { summary: '查询账户流水' })
- async accountsTransactionsInfo(
- @Param() account_id: any,
- @Query() params: any
- ) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 根据 transaction ID 查询
- */
- @Get('/v3/accounts/:account_id/transactions/:id', {
- summary: '根据 transaction ID 查询',
- })
- async accountsTransactionsInfoByAccount_id(
- @Param() account_id: any,
- @Param() id: any
- ) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 查询实名更新请求列表
- */
- @Get('/v3/legal_entity_requests', { summary: '查询实名更新请求列表' })
- async legal_entity_requestslist(@Query() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 提交实名更新
- */
- @Post('/v3/legal_entity_requests/:id/submit', { summary: '提交实名更新' })
- async legal_entity_requestsSubmit(@Param() id: any, @Body() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 收款人信息校验
- */
- @Post('/v3/beneficiaries/validate', { summary: '收款人信息校验' })
- async beneficiariesValidate(@Body() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 通过实名
- */
- @Post('/v3/simulate/accounts/:id/approve', { summary: '通过实名' })
- async simulateAccountsApprove(@Param() id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 通过实名更新
- */
- @Post('/v3/simulate/legal_entity_requests/:id/confirm', {
- summary: '通过实名更新',
- })
- async simulateLegal_entity_requestsConfirm(@Param() id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 驳回实名
- */
- @Post('/v3/simulate/accounts/:id/reject', { summary: '驳回实名' })
- async simulateAccountsReject(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 创建实名更新
- */
- @Post('/v3/simulate/legal_entity_requests', { summary: '创建实名更新' })
- async simulateLegal_entity_requests(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 入账
- */
- @Post('/v1/simulate/deposits', { summary: '入账' })
- async simulateDeposits(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 拒绝更新请求
- */
- @Post('/v3/simulate/legal_entity_requests/:id/reject', {
- summary: '拒绝更新请求',
- })
- async simulateLegal_entity_requestsReject(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 收款账户审核通过
- */
- @Post('/v3/simulate/applications/:id/confirm', {
- summary: '收款账户审核通过',
- })
- async simulateApplicationsConfirm(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 收款账户审核驳回
- */
- @Post('/v3/simulate/applications/:id/reject', { summary: '收款账户审核驳回' })
- async simulateApplicationsReject(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 通过付款
- */
- @Post('/v1/simulate/payments/:id/confirm', { summary: '通过付款' })
- async simulatePaymentsConfirm(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 拒绝付款
- */
- @Post('/v1/simulate/payments/:id/reject', { summary: '拒绝付款' })
- async simulatePaymentsReject(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 通过换汇
- */
- @Post('/v1/simulate/exchanges/:id/confirm', { summary: '通过换汇' })
- async simulateExchangesConfirm(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 拒绝换汇
- */
- @Post('/v1/simulate/exchanges/:id/reject', { summary: '拒绝换汇' })
- async simulateExchangesReject(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 创建 Webhook
- */
- @Post('/v3/webhooks', { summary: '创建 Webhook' })
- async createdWebhooks(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 查询 Webhook
- */
- @Get('/v3/webhooks', { summary: '查询 Webhook' })
- async getWebhooks(@Query(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 修改 Webhook
- */
- @Put('/v3/webhooks/:id', { summary: '修改 Webhook' })
- async putWebhooks(@Param('id') id: any, @Body() params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 删除 Webhook
- */
- @Del('/v3/webhooks/:id', { summary: '修改 Webhook' })
- async delWebhooks(@Param('id') id: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, {});
- }
- /**
- * 创建 Webhook HMAC Key
- */
- @Post('/v3/webhook_hmac_key', { summary: '创建 Webhook HMAC Key' })
- async createWebhook_hmac_key(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 账户审核通过
- */
- @Post('/account_approved', { summary: '账户审核通过' })
- async account_approved(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 账户审核驳回
- */
- @Post('/account_rejected', { summary: '账户审核驳回' })
- async account_rejected(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 实名待更新
- */
- @Post('/legal_entity_request_created', { summary: '实名待更新' })
- async legal_entity_request_created(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 实名更新审核通过
- */
- @Post('/legal_entity_request_success', { summary: '实名更新审核通过' })
- async legal_entity_request_success(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 实名更新审核驳回
- */
- @Post('/legal_entity_request_rejected', { summary: '实名更新审核驳回 ' })
- async legal_entity_request_rejected(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 收款账户申请成功
- */
- @Post('/application_success', { summary: '收款账户申请成功' })
- async application_success(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 收款账户申请失败
- */
- @Post('/application_failed', { summary: '收款账户申请失败' })
- async application_failed(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 收款账户信息变更
- */
- @Post('/bank_account_updated', { summary: '收款账户信息变更' })
- async bank_account_updated(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 收单支付成功通知
- */
- @Post('/acquiring_payment_success', { summary: '收单支付成功通知' })
- async acquiring_payment_success(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 收单退款成功通知
- */
- @Post('/acquiring_refund_success', { summary: '收单退款成功通知' })
- async acquiring_refund_success(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 收单退款失败通知
- */
- @Post('/acquiring_refund_failed', { summary: '收单退款失败通知' })
- async acquiring_refund_failed(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 入账成功
- */
- @Post('/deposit_success', { summary: '入账成功' })
- async deposit_success(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 换汇成功
- */
- @Post('/exchange_success', { summary: '换汇成功' })
- async exchange_success(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 换汇失败
- */
- @Post('/exchange_failed', { summary: '换汇失败' })
- async exchange_failed(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 收款账户已下发
- */
- @Post('/bank_account_created', { summary: '收款账户已下发' })
- async bank_account_created(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 付款成功
- */
- @Post('/payment_success', { summary: '付款成功' })
- async payment_success(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 付款失败
- */
- @Post('/payment_failed', { summary: '付款失败' })
- async payment_failed(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 付款银行退回
- */
- @Post('/payment_refunded', { summary: '付款银行退回' })
- async payment_refunded(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 转账成功
- */
- @Post('/transfer_success', { summary: '转账成功' })
- async transfer_success(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * 转账失败
- */
- @Post('/transfer_failed', { summary: '转账失败' })
- async transfer_failed(@Body(ALL) params: any) {
- // Access the request method and path
- const method = this.ctx.method;
- const path = this.ctx.path;
- console.log('Request Method:', method);
- console.log('Request Path:', path);
- // console.log(typeof params)
- // return `${method}, ${path}, ${params}`
- return await this.easyPayAdapter.request(method, path, params);
- }
- /**
- * merchant_certification
- */
- @Post('/v1/upload', { summary: '上传文件' })
- async upload(@Files() files: any[], @Fields() fields) {
- const results = [];
- for (const file of files) {
- const result = await this.easyOpenService.upload(file);
- results.push(result);
- }
- return { success: true, data: results };
- }
- }
|