mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
35 lines
1008 B
TypeScript
35 lines
1008 B
TypeScript
import { CbePaymentRequestDto } from "../dto/cbe-payment-request.dto";
|
|
import { CbePaymentResponseDto } from "../dto/cbe-payment-response.dto";
|
|
|
|
export function mapPaymentSuccess(
|
|
request: CbePaymentRequestDto,
|
|
destinationTxnRef: string,
|
|
): CbePaymentResponseDto {
|
|
return {
|
|
Destination_Api_Name: request.Destination_Api_Name,
|
|
End_To_End_Txn_Id: request.End_To_End_Txn_Id,
|
|
Cbe_Txn_Ref: request.Cbe_Txn_Ref,
|
|
Destination_Txn_Ref: destinationTxnRef,
|
|
Status: "SUCCESS",
|
|
Response_Code: "0",
|
|
Response_Description: "Success",
|
|
Additional_Fields: [],
|
|
};
|
|
}
|
|
|
|
export function mapPaymentFailure(
|
|
request: CbePaymentRequestDto,
|
|
description: string,
|
|
): CbePaymentResponseDto {
|
|
return {
|
|
Destination_Api_Name: request.Destination_Api_Name,
|
|
End_To_End_Txn_Id: request.End_To_End_Txn_Id,
|
|
Cbe_Txn_Ref: request.Cbe_Txn_Ref,
|
|
Destination_Txn_Ref: "",
|
|
Status: "FAILED",
|
|
Response_Code: "2",
|
|
Response_Description: description,
|
|
Additional_Fields: [],
|
|
};
|
|
}
|