fix : sep gateway
This commit is contained in:
@@ -133,6 +133,7 @@ class App {
|
|||||||
* configure body parser
|
* configure body parser
|
||||||
*/
|
*/
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
app.use(express.urlencoded({ extended: true }));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* configure morgan for http logging
|
* configure morgan for http logging
|
||||||
|
|||||||
@@ -1,14 +1,68 @@
|
|||||||
|
import { Expose } from "class-transformer";
|
||||||
|
import { IsNotEmpty, IsString } from "class-validator";
|
||||||
|
|
||||||
|
import { ApiProperty } from "../../../common/decorator/swggerDocs";
|
||||||
|
|
||||||
export class VerifyOnlinePaymentDTO {
|
export class VerifyOnlinePaymentDTO {
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Merchant ID", example: "123456789" })
|
||||||
MID: string;
|
MID: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Transaction state", example: "OK" })
|
||||||
State: string;
|
State: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Transaction status", example: "OK" })
|
||||||
Status: string;
|
Status: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Retrieval Reference Number", example: "123456789012" })
|
||||||
RRN: string;
|
RRN: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsNotEmpty()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Reference number", example: "123456789012" })
|
||||||
RefNum: string;
|
RefNum: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Reservation number", example: "123456" })
|
||||||
ResNum: string;
|
ResNum: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Terminal ID", example: "12345678" })
|
||||||
TerminalId: string;
|
TerminalId: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Trace number", example: "123456" })
|
||||||
TraceNo: string;
|
TraceNo: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Transaction amount", example: "10000" })
|
||||||
Amount: string;
|
Amount: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Transaction wage", example: "0" })
|
||||||
Wage: string;
|
Wage: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Secure PAN", example: "123456******7890" })
|
||||||
SecurePan: string;
|
SecurePan: string;
|
||||||
|
|
||||||
|
@Expose()
|
||||||
|
@IsString()
|
||||||
|
@ApiProperty({ type: "string", description: "Hashed card number", example: "hashed_value" })
|
||||||
HashedCardNumber: string;
|
HashedCardNumber: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { BaseController } from "../../common/base/controller";
|
|||||||
import { ApiAuth, ApiModel, ApiOperation, ApiParam, ApiQuery, ApiResponse, ApiTags } from "../../common/decorator/swggerDocs";
|
import { ApiAuth, ApiModel, ApiOperation, ApiParam, ApiQuery, ApiResponse, ApiTags } from "../../common/decorator/swggerDocs";
|
||||||
import { GatewayProvider } from "../../common/enums/payment.enum";
|
import { GatewayProvider } from "../../common/enums/payment.enum";
|
||||||
import { Guard } from "../../core/middlewares/guard.middleware";
|
import { Guard } from "../../core/middlewares/guard.middleware";
|
||||||
|
import { ValidationMiddleware } from "../../core/middlewares/validator.middleware";
|
||||||
import { IOCTYPES } from "../../IOC/ioc.types";
|
import { IOCTYPES } from "../../IOC/ioc.types";
|
||||||
import { verifyPaymentTemplate } from "../../template/payment";
|
import { verifyPaymentTemplate } from "../../template/payment";
|
||||||
import { verifyPRPaymentTemplate } from "../../template/PRPayment";
|
import { verifyPRPaymentTemplate } from "../../template/PRPayment";
|
||||||
@@ -110,7 +111,7 @@ class PaymentController extends BaseController {
|
|||||||
@ApiOperation("verify a payment for current session user for cartCheckout (method post for SEP)")
|
@ApiOperation("verify a payment for current session user for cartCheckout (method post for SEP)")
|
||||||
@ApiResponse("successful", HttpStatus.Ok)
|
@ApiResponse("successful", HttpStatus.Ok)
|
||||||
@ApiParam("gateway", "the name of api gateway", true)
|
@ApiParam("gateway", "the name of api gateway", true)
|
||||||
@httpPost("/verify/:gateway/cart")
|
@httpPost("/verify/:gateway/cart", ValidationMiddleware.validateInput(VerifyOnlinePaymentDTO))
|
||||||
public async VerifyCartCheckoutPost(
|
public async VerifyCartCheckoutPost(
|
||||||
@requestParam("gateway") gateway: string,
|
@requestParam("gateway") gateway: string,
|
||||||
@response() res: Response,
|
@response() res: Response,
|
||||||
|
|||||||
Reference in New Issue
Block a user