Closed lay-zhou closed 3 months ago
async scan(requestParams:IRequestParams):Promise<AlipaySdkCommonResult | string> { const result = await alipaySdk.exec('alipay.trade.precreate', requestParams); if (typeof result === 'object') { const { code, msg } = result; if (code === '10000' && msg === 'Success') { return result; } else { throw new HttpException({ statusCode: HttpStatus.FORBIDDEN, error: msg }, 403); } } else { throw new HttpException({ statusCode: HttpStatus.FORBIDDEN, error: 'typeof scan result is string' }, 403); } }
async scan(requestParams:IRequestParams):Promise<AlipaySdkCommonResult | string> { const result = await alipaySdk.exec('alipay.trade.precreate', requestParams); if (typeof result === 'object') { const { code, msg } = result; if (code === '10000' && msg === 'Success') { return result; } else { throw new HttpException({ statusCode: HttpStatus.FORBIDDEN, error: msg }, 403); } } else { throw new HttpException({ statusCode: HttpStatus.FORBIDDEN, error: 'typeof scan result is string' }, 403); } }