apply "thawani" way payment

This commit is contained in:
2026-01-17 11:05:00 +03:00
parent 8083e9ec96
commit 69425580d6
7 changed files with 39 additions and 21 deletions

BIN
public/thawani.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -334,7 +334,8 @@
"pickup": "استلام",
"setPickupTime": "تحديد وقت الاستلام",
"carPlateNumber": "رقم لوحة السيارة",
"noItems": "لا يوجد عناصر في السلة"
"noItems": "لا يوجد عناصر في السلة",
"thawani": "ثواني"
},
"address": {
"title": "العنوان",

View File

@@ -353,7 +353,8 @@
"pickup": "Pickup",
"setPickupTime": "Set Pickup Time",
"carPlateNumber": "Car Plate Number",
"noItems": "No items in cart"
"noItems": "No items in cart",
"thawani": "Thawani"
},
"address": {
"title": "Address",

View File

@@ -18,9 +18,9 @@ const RefershIcon = ({ className, onClick, dimension }: RefershIconType) => {
<path
d="M1.5 7.5C1.5 7.5 1.59099 6.86307 4.22703 4.22703C6.86307 1.59099 11.1369 1.59099 13.773 4.22703C14.7069 5.16099 15.31 6.30054 15.5821 7.5M1.5 7.5V3M1.5 7.5H6M16.5 10.5C16.5 10.5 16.409 11.1369 13.773 13.773C11.1369 16.409 6.86307 16.409 4.22703 13.773C3.29307 12.839 2.69002 11.6995 2.41787 10.5M16.5 10.5V15M16.5 10.5H12"
stroke="#5F6C7B"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);

View File

@@ -1,7 +1,7 @@
import { Form, Radio, Space } from "antd";
import { Form, Image, Radio, Space } from "antd";
import { Group } from "antd/es/radio";
import ArabicPrice from "components/ArabicPrice";
import DifferentCardIcon from "components/Icons/paymentMethods/DifferentCardIcon";
// import DifferentCardIcon from "components/Icons/paymentMethods/DifferentCardIcon";
import ProText from "components/ProText";
import {
selectCart,
@@ -14,7 +14,6 @@ import { colors, ProGray1 } from "../../ThemeConstants";
import ProInputCard from "../ProInputCard/ProInputCard";
import styles from "./PaymentMethods.module.css";
import { OrderType } from "pages/checkout/hooks/types.ts";
import RCardIcon from "components/Icons/RCardIcon";
import { formatPriceUi } from "utils/helpers";
const PaymentMethods = () => {
@@ -22,7 +21,7 @@ const PaymentMethods = () => {
const { paymentMethod, orderType } = useAppSelector(selectCart);
const dispatch = useAppDispatch();
const grandTotal = useAppSelector(selectGrandTotal);
const { isRTL } = useAppSelector((state) => state.locale);
// const { isRTL } = useAppSelector((state) => state.locale);
const options: {
label: React.ReactNode;
@@ -40,12 +39,14 @@ const PaymentMethods = () => {
<ProText
style={{
color: "#E8B400",
[isRTL ? "marginLeft" : "marginRight"]: 4,
// [isRTL ? "marginLeft" : "marginRight"]: 4,
}}
>
$
{/* $ */}
</ProText>
<ProText style={{ color: "#5F6C7B" }}>
{t("checkout.cash")}
</ProText>
<ProText style={{color: '#5F6C7B'}}>{t("checkout.cash")}</ProText>
</>
),
value: "cash",
@@ -65,14 +66,26 @@ const PaymentMethods = () => {
{
label: (
<>
<RCardIcon className={styles.eCardIcon} />
<ProText style={{color: '#5F6C7B'}}>{t("checkout.differentCard")}</ProText>
{/* <RCardIcon className={styles.eCardIcon} /> */}
<ProText style={{ color: "#5F6C7B" }}>
{t("checkout.thawani")}
</ProText>
</>
),
value: "differentCard",
value: "thawani",
icon: (
<div className={styles.differentCardIcon}>
<DifferentCardIcon />
<Image
preview={false}
src={"thawani.png"}
alt="thawani"
width={24}
height={24}
style={{
position: "relative",
bottom: 3,
}}
/>
</div>
),
hideCurrency: true,

View File

@@ -380,7 +380,11 @@ const orderSlice = createSlice({
// Clear all cart data from localStorage
if (typeof window !== "undefined") {
Object.values(CART_STORAGE_KEYS)
.filter((key) => key !== CART_STORAGE_KEYS.ORDER_TYPE)
.filter(
(key) =>
key !== CART_STORAGE_KEYS.ORDER_TYPE &&
key !== CART_STORAGE_KEYS.PAYMENT_METHOD,
)
.forEach((key) => {
localStorage.removeItem(key);
});
@@ -703,7 +707,7 @@ const orderSlice = createSlice({
},
updateOrder(state, action: PayloadAction<any>) {
state.order = { ...(state.order || {}), ...action.payload };
if (typeof window !== "undefined") {
localStorage.setItem(
CART_STORAGE_KEYS.ORDER,

View File

@@ -75,8 +75,6 @@ export default function useOrder() {
duration: 0,
});
console.log(order?.roomNumber);
createOrder({
phone: mobilenumber || phone || giftDetails?.senderPhone,
comment: specialRequest,
@@ -152,8 +150,9 @@ export default function useOrder() {
);
else {
const redirectMessageKey = "order-redirect-loader";
if (
orderType === OrderType.Gift &&
localStorage.getItem("fascano_payment_method")?.toString() === '"thawani"' &&
mutationResult.data?.result?.orderID
) {
message.loading({