This repository has been archived by the owner on Jul 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
397 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./AdyenPaymentGateway"; | ||
export * from "./intl"; |
50 changes: 50 additions & 0 deletions
50
src/@next/components/organisms/AdyenPaymentGateway/intl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { defineMessages, IntlShape } from "react-intl"; | ||
|
||
const description = "Adyen payment gateway error"; | ||
|
||
export const adyenErrorMessages = defineMessages({ | ||
unknownPayment: { | ||
defaultMessage: "Unknown payment submission error occured.", | ||
description, | ||
}, | ||
invalidPaymentSubmission: { | ||
defaultMessage: "Invalid payment submission.", | ||
description, | ||
}, | ||
}); | ||
|
||
export const adyenConfirmationErrorMessages = defineMessages({ | ||
error: { | ||
defaultMessage: "Error processing payment occured.", | ||
description, | ||
}, | ||
refused: { | ||
defaultMessage: | ||
"The payment was refused. Try the payment again using a different payment method or card.", | ||
description, | ||
}, | ||
cancelled: { | ||
defaultMessage: "Payment was cancelled.", | ||
description, | ||
}, | ||
general: { | ||
defaultMessage: "Payment could not be confirmed.", | ||
description, | ||
}, | ||
}); | ||
|
||
export function translateAdyenConfirmationError( | ||
status: string, | ||
intl: IntlShape | ||
): string { | ||
switch (status) { | ||
case "Error": | ||
return intl.formatMessage(adyenConfirmationErrorMessages.error); | ||
case "Refused": | ||
return intl.formatMessage(adyenConfirmationErrorMessages.refused); | ||
case "Cancelled": | ||
return intl.formatMessage(adyenConfirmationErrorMessages.cancelled); | ||
default: | ||
return intl.formatMessage(adyenConfirmationErrorMessages.general); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b02d18d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
storefront-stable-staging – ./
storefront-stable-staging-saleorcommerce.vercel.app
storefront-stable-staging-git-30-saleorcommerce.vercel.app
storefront-stable-staging.vercel.app
stable.storefront.staging.saleor.cloud