auth clssification last pay bug fix
This commit is contained in:
parent
18c7a2799e
commit
3eb495b007
@ -10,7 +10,7 @@ import { Roles } from 'src/decorators/roles.decorator';
|
||||
import { JwtAuthGuard } from 'src/guards/jwt-auth.guard';
|
||||
|
||||
@ApiTags('Auth')
|
||||
@Controller()
|
||||
@Controller("1")
|
||||
export class AuthController {
|
||||
constructor(
|
||||
private readonly authService: AuthService,
|
||||
|
||||
@ -1716,9 +1716,11 @@ export class CarnetApplicationService {
|
||||
|
||||
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
|
||||
&& 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({
|
||||
P_APPLICATIONNAME: body.P_APPLICATIONNAME,
|
||||
@ -1768,7 +1770,7 @@ export class CarnetApplicationService {
|
||||
P_PAYMENTERROR: `Error while validating user approval`
|
||||
});
|
||||
|
||||
throw new InternalServerException();
|
||||
throw new InternalServerException("failed to save approved status");
|
||||
}
|
||||
|
||||
} catch (error: any) {
|
||||
@ -1913,7 +1915,7 @@ export class CarnetApplicationService {
|
||||
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async SaveHistory(body: SaveHistoryDTO) {
|
||||
let connection;
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user