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": "استلام", "pickup": "استلام",
"setPickupTime": "تحديد وقت الاستلام", "setPickupTime": "تحديد وقت الاستلام",
"carPlateNumber": "رقم لوحة السيارة", "carPlateNumber": "رقم لوحة السيارة",
"noItems": "لا يوجد عناصر في السلة" "noItems": "لا يوجد عناصر في السلة",
"thawani": "ثواني"
}, },
"address": { "address": {
"title": "العنوان", "title": "العنوان",

View File

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

View File

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

View File

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

View File

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