Skip to content

Commit 344acfc

Browse files
committed
audit: the flow of booking and canceling orders with fawry express.
1 parent aa96314 commit 344acfc

File tree

22 files changed

+302
-521
lines changed

22 files changed

+302
-521
lines changed

apps/web/src/components/Checkout/Content.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ const Body: React.FC<{
214214
)
215215
return <Success type={transaction.data.type} />;
216216

217-
if (transaction.data?.status === ITransaction.Status.Processed)
217+
if (
218+
transaction.data?.status === ITransaction.Status.New ||
219+
transaction.data?.status === ITransaction.Status.Processed
220+
)
218221
return (
219222
<StatusContainer
220223
transactionId={transaction.data.id}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import ExclaimationMarkCircle from "@litespace/assets/ExclaimationMarkCircle";
2+
import { ITransaction } from "@litespace/types";
3+
import { Button } from "@litespace/ui/Button";
4+
import { useFormatMessage } from "@litespace/ui/hooks/intl";
5+
import { Typography } from "@litespace/ui/Typography";
6+
import { Web } from "@litespace/utils/routes";
7+
import { Link } from "react-router-dom";
8+
9+
const Fail: React.FC<{ type: ITransaction.Type }> = ({ type }) => {
10+
const intl = useFormatMessage();
11+
return (
12+
<div className="flex flex-col gap-6 md:gap-4 items-center justify-center">
13+
<div className="flex flex-row items-center gap-2">
14+
<ExclaimationMarkCircle className="w-6 h-6 [&>*]:stroke-destruction-500" />
15+
<Typography tag="h1" className="text-subtitle-1 font-bold">
16+
{intl("checkout.payment.failed.title")}
17+
</Typography>
18+
</div>
19+
20+
<div className="flex gap-4">
21+
{type === ITransaction.Type.PaidLesson ? (
22+
<Link to={Web.Tutors} tabIndex={-1}>
23+
<Button
24+
type="main"
25+
variant="primary"
26+
size="large"
27+
className="text text-body font-medium"
28+
>
29+
{intl("labels.try-again")}
30+
</Button>
31+
</Link>
32+
) : null}
33+
34+
{type === ITransaction.Type.PaidPlan ? (
35+
<Link to={Web.Plans} tabIndex={-1}>
36+
<Button
37+
type="main"
38+
variant="primary"
39+
size="large"
40+
className="text text-body font-medium"
41+
>
42+
{intl("labels.try-again")}
43+
</Button>
44+
</Link>
45+
) : null}
46+
</div>
47+
</div>
48+
);
49+
};
50+
51+
export default Fail;

0 commit comments

Comments
 (0)