@codesinger0/shared-components 1.1.35 → 1.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,6 +42,7 @@ const OrderForm = ({
|
|
|
42
42
|
addToast, // Inject toast function
|
|
43
43
|
cartItems,
|
|
44
44
|
totalPrice,
|
|
45
|
+
paymentLinkCreationURL
|
|
45
46
|
}) => {
|
|
46
47
|
|
|
47
48
|
const [nameError, setNameError] = useState('');
|
|
@@ -127,7 +128,7 @@ const OrderForm = ({
|
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
const response = await fetch(
|
|
131
|
+
const response = await fetch(paymentLinkCreationURL, {
|
|
131
132
|
method: 'POST',
|
|
132
133
|
headers: {
|
|
133
134
|
'Content-Type': 'application/json'
|
|
@@ -255,6 +256,10 @@ const OrderForm = ({
|
|
|
255
256
|
};
|
|
256
257
|
|
|
257
258
|
const handleInputChange = (field, value) => {
|
|
259
|
+
if (field === 'deliveryMethod' && value === 'pickup') {
|
|
260
|
+
setDeliveryError('')
|
|
261
|
+
setErrors({})
|
|
262
|
+
}
|
|
258
263
|
setFormData(prev => ({ ...prev, [field]: value }));
|
|
259
264
|
if (errors[field]) {
|
|
260
265
|
setErrors(prev => ({ ...prev, [field]: '' }));
|
|
@@ -282,8 +287,7 @@ const OrderForm = ({
|
|
|
282
287
|
onNavigateToLogin();
|
|
283
288
|
};
|
|
284
289
|
|
|
285
|
-
const handleOnBack =() => {
|
|
286
|
-
debugger
|
|
290
|
+
const handleOnBack = () => {
|
|
287
291
|
onBack();
|
|
288
292
|
}
|
|
289
293
|
|
|
@@ -370,8 +374,8 @@ const OrderForm = ({
|
|
|
370
374
|
};
|
|
371
375
|
|
|
372
376
|
// Create payment link
|
|
373
|
-
|
|
374
|
-
|
|
377
|
+
const paymentResponse = await createPaymentLink(orderData);
|
|
378
|
+
// const paymentResponse = await simulatePaymentLinkCreation(orderData);
|
|
375
379
|
|
|
376
380
|
if (paymentResponse.success) {
|
|
377
381
|
// Create order items in the format expected by the database
|
|
@@ -457,7 +461,7 @@ const OrderForm = ({
|
|
|
457
461
|
className="flex items-center gap-2 mb-6 content-text hover:text-primary transition-colors duration-200"
|
|
458
462
|
>
|
|
459
463
|
<ArrowRight className="w-4 h-4" />
|
|
460
|
-
חזור
|
|
464
|
+
חזור
|
|
461
465
|
</button>
|
|
462
466
|
|
|
463
467
|
<div className="glass-card p-8">
|