Skip to content

Commit

Permalink
ORV2-1327 Updated date format for server parsing (#678)
Browse files Browse the repository at this point in the history
Co-authored-by: praju-aot <[email protected]>
  • Loading branch information
erikataot and praju-aot authored Oct 13, 2023
1 parent 2fcb172 commit f139ddf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class PaymentGatewayTransactionDto {

@AutoMap()
@ApiProperty({
example: '6/23/2023 10:57:28 PM',
example: '2023-10-11T23:26:51.170Z',
description:
'Represents the date and time that the transaction was processed.',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class Transaction extends Base {

@AutoMap()
@ApiProperty({
example: '6/23/2023 10:57:28 PM',
example: '2023-10-11T23:26:51.170Z',
description:
'Represents the date and time that the transaction was processed.',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CompleteTransactionRequestData, MotiPaymentDetails } from "../../types/
import { Loading } from "../../../../common/pages/Loading";
import { useCompleteTransaction, useIssuePermits } from "../../hooks/hooks";
import { getDefaultRequiredVal } from "../../../../common/helpers/util";
import { toUtc } from "../../../../common/helpers/formatDate";
import { DATE_FORMATS, toUtc } from "../../../../common/helpers/formatDate";

const getPermitIdsArray = (permitIds?: string | null) => {
return getDefaultRequiredVal("", permitIds).split(",").filter(id => id !== "");
Expand Down Expand Up @@ -105,13 +105,12 @@ export const PaymentRedirect = () => {
const mapTransactionDetails = (
motiResponse: MotiPaymentDetails
): CompleteTransactionRequestData => {
const dateFormat = 'YYYY-MM-DD HH:mm:ss'
return {
pgTransactionId: motiResponse.trnId,
pgApproved: Number(motiResponse.trnApproved),
pgAuthCode: motiResponse.authCode,
pgCardType: motiResponse.cardType,
pgTransactionDate: toUtc(motiResponse.trnDate, dateFormat),
pgTransactionDate: toUtc(motiResponse.trnDate, DATE_FORMATS.ISO8601),
pgCvdId: Number(motiResponse.cvdId),
pgPaymentMethod: motiResponse.paymentMethod,
pgMessageId: Number(motiResponse.messageId),
Expand Down

0 comments on commit f139ddf

Please sign in to comment.