auth changes and last pay bug fix
This commit is contained in:
parent
36529727a0
commit
5fd62322ad
@ -10,7 +10,7 @@ import { Roles } from 'src/decorators/roles.decorator';
|
|||||||
import { JwtAuthGuard } from 'src/guards/jwt-auth.guard';
|
import { JwtAuthGuard } from 'src/guards/jwt-auth.guard';
|
||||||
|
|
||||||
@ApiTags('Auth')
|
@ApiTags('Auth')
|
||||||
@Controller()
|
@Controller("1")
|
||||||
export class AuthController {
|
export class AuthController {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly authService: AuthService,
|
private readonly authService: AuthService,
|
||||||
|
|||||||
@ -1716,9 +1716,11 @@ export class CarnetApplicationService {
|
|||||||
|
|
||||||
const approve_result = await this.OrderDetails({ P_ORDERID: body.P_ORDERID });
|
const approve_result = await this.OrderDetails({ P_ORDERID: body.P_ORDERID });
|
||||||
|
|
||||||
|
const formattedAmount = await this.formatAmount(body.P_PRICE);
|
||||||
|
|
||||||
if (approve_result.data.id === body.P_ORDERID
|
if (approve_result.data.id === body.P_ORDERID
|
||||||
&& approve_result.data.status === "APPROVED"
|
&& approve_result.data.status === "APPROVED"
|
||||||
&& approve_result.data.purchase_units[0]?.amount?.value === body.P_PRICE + ""
|
&& approve_result.data.purchase_units[0]?.amount?.value === formattedAmount + ""
|
||||||
) {
|
) {
|
||||||
await this.SaveHistory({
|
await this.SaveHistory({
|
||||||
P_APPLICATIONNAME: body.P_APPLICATIONNAME,
|
P_APPLICATIONNAME: body.P_APPLICATIONNAME,
|
||||||
@ -1768,7 +1770,7 @@ export class CarnetApplicationService {
|
|||||||
P_PAYMENTERROR: `Error while validating user approval`
|
P_PAYMENTERROR: `Error while validating user approval`
|
||||||
});
|
});
|
||||||
|
|
||||||
throw new InternalServerException();
|
throw new InternalServerException("failed to save approved status");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@ -1913,7 +1915,7 @@ export class CarnetApplicationService {
|
|||||||
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async SaveHistory(body: SaveHistoryDTO) {
|
async SaveHistory(body: SaveHistoryDTO) {
|
||||||
let connection;
|
let connection;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user