logix-payment-shift4 1.0.3 → 1.0.4
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.
- package/dist/index.cjs.js +94 -70
- package/dist/index.esm.js +94 -70
- package/package.json +1 -1
- package/src/PaymentForm.jsx +96 -84
package/dist/index.cjs.js
CHANGED
|
@@ -183,19 +183,28 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
183
183
|
|
|
184
184
|
function PaymentForm(_ref) {
|
|
185
185
|
var amount = _ref.amount,
|
|
186
|
-
currency = _ref.currency
|
|
186
|
+
currency = _ref.currency,
|
|
187
|
+
currencyIcon = _ref.currencyIcon,
|
|
188
|
+
color = _ref.color,
|
|
189
|
+
_ref$formwidth = _ref.formwidth,
|
|
190
|
+
formwidth = _ref$formwidth === void 0 ? 400 : _ref$formwidth,
|
|
191
|
+
_ref$formborderRadius = _ref.formborderRadius,
|
|
192
|
+
formborderRadius = _ref$formborderRadius === void 0 ? 20 : _ref$formborderRadius,
|
|
193
|
+
_ref$formbackgroundCo = _ref.formbackgroundColor,
|
|
194
|
+
formbackgroundColor = _ref$formbackgroundCo === void 0 ? "#fff" : _ref$formbackgroundCo,
|
|
195
|
+
companyLogo = _ref.companyLogo;
|
|
187
196
|
var formRef = React.useRef();
|
|
188
197
|
var initializedRef = React.useRef(false); // yalnız bir dəfə mount üçün
|
|
189
198
|
var shift4Ref = React.useRef(null);
|
|
190
199
|
var componentsRef = React.useRef(null);
|
|
191
200
|
var _useState = React.useState(""),
|
|
192
|
-
_useState2 = _slicedToArray(_useState, 2)
|
|
193
|
-
|
|
194
|
-
setError = _useState2[1];
|
|
201
|
+
_useState2 = _slicedToArray(_useState, 2);
|
|
202
|
+
_useState2[0];
|
|
203
|
+
var setError = _useState2[1];
|
|
195
204
|
var _useState3 = React.useState(""),
|
|
196
|
-
_useState4 = _slicedToArray(_useState3, 2)
|
|
197
|
-
|
|
198
|
-
setSuccess = _useState4[1];
|
|
205
|
+
_useState4 = _slicedToArray(_useState3, 2);
|
|
206
|
+
_useState4[0];
|
|
207
|
+
var setSuccess = _useState4[1];
|
|
199
208
|
var _useState5 = React.useState(false),
|
|
200
209
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
201
210
|
isSubmitting = _useState6[0],
|
|
@@ -325,63 +334,75 @@ function PaymentForm(_ref) {
|
|
|
325
334
|
style: {
|
|
326
335
|
display: "flex",
|
|
327
336
|
justifyContent: "center",
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
// yumşaq fon
|
|
332
|
-
padding: "20px"
|
|
337
|
+
width: "100%",
|
|
338
|
+
padding: "20px",
|
|
339
|
+
boxSizing: "border-box"
|
|
333
340
|
}
|
|
334
|
-
}, /*#__PURE__*/React.createElement("
|
|
341
|
+
}, /*#__PURE__*/React.createElement("form", {
|
|
342
|
+
ref: formRef,
|
|
343
|
+
id: "payment-form",
|
|
344
|
+
onSubmit: handleSubmit,
|
|
345
|
+
method: "post",
|
|
335
346
|
style: {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
347
|
+
display: "grid",
|
|
348
|
+
gap: "12px",
|
|
349
|
+
padding: "24px",
|
|
350
|
+
backgroundColor: formbackgroundColor,
|
|
351
|
+
borderRadius: formborderRadius,
|
|
352
|
+
width: formwidth,
|
|
353
|
+
// səhifənin 1/4-ü
|
|
354
|
+
boxSizing: "border-box"
|
|
343
355
|
}
|
|
344
|
-
}, /*#__PURE__*/React.createElement("
|
|
356
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
345
357
|
style: {
|
|
346
358
|
textAlign: "center",
|
|
347
|
-
marginBottom:
|
|
348
|
-
color: "#333",
|
|
349
|
-
fontWeight: "600"
|
|
359
|
+
marginBottom: 20
|
|
350
360
|
}
|
|
351
|
-
},
|
|
352
|
-
|
|
353
|
-
|
|
361
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
362
|
+
src: companyLogo,
|
|
363
|
+
alt: "Logo",
|
|
354
364
|
style: {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
display: error ? "block" : "none"
|
|
361
|
-
},
|
|
362
|
-
role: "alert",
|
|
363
|
-
"aria-live": "polite"
|
|
364
|
-
}, error), /*#__PURE__*/React.createElement("div", {
|
|
365
|
-
id: "payment-success",
|
|
366
|
-
className: "alert alert-success",
|
|
365
|
+
height: "40px",
|
|
366
|
+
width: "auto",
|
|
367
|
+
marginBottom: 10
|
|
368
|
+
}
|
|
369
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
367
370
|
style: {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
display: success ? "block" : "none"
|
|
374
|
-
},
|
|
375
|
-
role: "status",
|
|
376
|
-
"aria-live": "polite"
|
|
377
|
-
}, success), /*#__PURE__*/React.createElement("form", {
|
|
378
|
-
ref: formRef,
|
|
379
|
-
id: "payment-form",
|
|
380
|
-
className: "grid gap-5",
|
|
381
|
-
onSubmit: handleSubmit,
|
|
382
|
-
method: "post"
|
|
371
|
+
display: "flex",
|
|
372
|
+
alignItems: "center",
|
|
373
|
+
gap: "12px",
|
|
374
|
+
marginTop: 10
|
|
375
|
+
}
|
|
383
376
|
}, /*#__PURE__*/React.createElement("div", {
|
|
384
|
-
|
|
377
|
+
style: {
|
|
378
|
+
flex: 1,
|
|
379
|
+
height: "1px",
|
|
380
|
+
backgroundColor: "#e5e7eb"
|
|
381
|
+
}
|
|
382
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
383
|
+
style: {
|
|
384
|
+
fontSize: "22px",
|
|
385
|
+
fontWeight: "700",
|
|
386
|
+
color: "#1f2937",
|
|
387
|
+
margin: "0 12px"
|
|
388
|
+
}
|
|
389
|
+
}, "Total Amount:"), /*#__PURE__*/React.createElement("div", {
|
|
390
|
+
style: {
|
|
391
|
+
fontSize: "22px",
|
|
392
|
+
fontWeight: "700",
|
|
393
|
+
color: "#16a34a"
|
|
394
|
+
}
|
|
395
|
+
}, currencyIcon, " ", Math.round(amount * 100)), /*#__PURE__*/React.createElement("div", {
|
|
396
|
+
style: {
|
|
397
|
+
flex: 1,
|
|
398
|
+
height: "1px",
|
|
399
|
+
backgroundColor: "#e5e7eb"
|
|
400
|
+
}
|
|
401
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
402
|
+
style: {
|
|
403
|
+
display: "grid",
|
|
404
|
+
gap: "8px"
|
|
405
|
+
}
|
|
385
406
|
}, /*#__PURE__*/React.createElement("label", {
|
|
386
407
|
style: {
|
|
387
408
|
fontWeight: "500",
|
|
@@ -392,15 +413,16 @@ function PaymentForm(_ref) {
|
|
|
392
413
|
className: "form-control",
|
|
393
414
|
style: {
|
|
394
415
|
padding: "12px",
|
|
395
|
-
borderRadius: "
|
|
396
|
-
border: "1px solid #ccc"
|
|
416
|
+
borderRadius: "10px",
|
|
417
|
+
border: "1px solid #ccc",
|
|
418
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
397
419
|
}
|
|
398
420
|
})), /*#__PURE__*/React.createElement("div", {
|
|
399
|
-
className: "grid gap-2",
|
|
400
421
|
style: {
|
|
401
|
-
gridTemplateColumns: "1fr 1fr",
|
|
402
422
|
display: "grid",
|
|
403
|
-
|
|
423
|
+
gridTemplateColumns: "1fr 1fr",
|
|
424
|
+
gap: "10px",
|
|
425
|
+
marginTop: "12px"
|
|
404
426
|
}
|
|
405
427
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", {
|
|
406
428
|
style: {
|
|
@@ -412,8 +434,9 @@ function PaymentForm(_ref) {
|
|
|
412
434
|
className: "form-control",
|
|
413
435
|
style: {
|
|
414
436
|
padding: "12px",
|
|
415
|
-
borderRadius: "
|
|
416
|
-
border: "1px solid #ccc"
|
|
437
|
+
borderRadius: "10px",
|
|
438
|
+
border: "1px solid #ccc",
|
|
439
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
417
440
|
}
|
|
418
441
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", {
|
|
419
442
|
style: {
|
|
@@ -425,25 +448,26 @@ function PaymentForm(_ref) {
|
|
|
425
448
|
className: "form-control",
|
|
426
449
|
style: {
|
|
427
450
|
padding: "12px",
|
|
428
|
-
borderRadius: "
|
|
429
|
-
border: "1px solid #ccc"
|
|
451
|
+
borderRadius: "10px",
|
|
452
|
+
border: "1px solid #ccc",
|
|
453
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
430
454
|
}
|
|
431
455
|
}))), /*#__PURE__*/React.createElement("button", {
|
|
432
456
|
type: "submit",
|
|
433
457
|
disabled: !isReady || isSubmitting,
|
|
434
458
|
style: {
|
|
459
|
+
marginTop: "16px",
|
|
435
460
|
width: "100%",
|
|
436
461
|
padding: "14px",
|
|
437
|
-
backgroundColor:
|
|
462
|
+
backgroundColor: color,
|
|
438
463
|
color: "white",
|
|
439
464
|
border: "none",
|
|
440
|
-
borderRadius: "
|
|
465
|
+
borderRadius: "12px",
|
|
441
466
|
fontWeight: "600",
|
|
442
|
-
cursor: "pointer",
|
|
443
|
-
opacity: !isReady || isSubmitting ? 0.7 : 1
|
|
444
|
-
marginTop: "10px"
|
|
467
|
+
cursor: !isReady || isSubmitting ? "not-allowed" : "pointer",
|
|
468
|
+
opacity: !isReady || isSubmitting ? 0.7 : 1
|
|
445
469
|
}
|
|
446
|
-
}, isSubmitting ? "Processing..." : "Buy now")))
|
|
470
|
+
}, isSubmitting ? "Processing..." : "Buy now")));
|
|
447
471
|
}
|
|
448
472
|
|
|
449
473
|
exports.PaymentForm = PaymentForm;
|
package/dist/index.esm.js
CHANGED
|
@@ -181,19 +181,28 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
181
181
|
|
|
182
182
|
function PaymentForm(_ref) {
|
|
183
183
|
var amount = _ref.amount,
|
|
184
|
-
currency = _ref.currency
|
|
184
|
+
currency = _ref.currency,
|
|
185
|
+
currencyIcon = _ref.currencyIcon,
|
|
186
|
+
color = _ref.color,
|
|
187
|
+
_ref$formwidth = _ref.formwidth,
|
|
188
|
+
formwidth = _ref$formwidth === void 0 ? 400 : _ref$formwidth,
|
|
189
|
+
_ref$formborderRadius = _ref.formborderRadius,
|
|
190
|
+
formborderRadius = _ref$formborderRadius === void 0 ? 20 : _ref$formborderRadius,
|
|
191
|
+
_ref$formbackgroundCo = _ref.formbackgroundColor,
|
|
192
|
+
formbackgroundColor = _ref$formbackgroundCo === void 0 ? "#fff" : _ref$formbackgroundCo,
|
|
193
|
+
companyLogo = _ref.companyLogo;
|
|
185
194
|
var formRef = useRef();
|
|
186
195
|
var initializedRef = useRef(false); // yalnız bir dəfə mount üçün
|
|
187
196
|
var shift4Ref = useRef(null);
|
|
188
197
|
var componentsRef = useRef(null);
|
|
189
198
|
var _useState = useState(""),
|
|
190
|
-
_useState2 = _slicedToArray(_useState, 2)
|
|
191
|
-
|
|
192
|
-
setError = _useState2[1];
|
|
199
|
+
_useState2 = _slicedToArray(_useState, 2);
|
|
200
|
+
_useState2[0];
|
|
201
|
+
var setError = _useState2[1];
|
|
193
202
|
var _useState3 = useState(""),
|
|
194
|
-
_useState4 = _slicedToArray(_useState3, 2)
|
|
195
|
-
|
|
196
|
-
setSuccess = _useState4[1];
|
|
203
|
+
_useState4 = _slicedToArray(_useState3, 2);
|
|
204
|
+
_useState4[0];
|
|
205
|
+
var setSuccess = _useState4[1];
|
|
197
206
|
var _useState5 = useState(false),
|
|
198
207
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
199
208
|
isSubmitting = _useState6[0],
|
|
@@ -323,63 +332,75 @@ function PaymentForm(_ref) {
|
|
|
323
332
|
style: {
|
|
324
333
|
display: "flex",
|
|
325
334
|
justifyContent: "center",
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
// yumşaq fon
|
|
330
|
-
padding: "20px"
|
|
335
|
+
width: "100%",
|
|
336
|
+
padding: "20px",
|
|
337
|
+
boxSizing: "border-box"
|
|
331
338
|
}
|
|
332
|
-
}, /*#__PURE__*/React.createElement("
|
|
339
|
+
}, /*#__PURE__*/React.createElement("form", {
|
|
340
|
+
ref: formRef,
|
|
341
|
+
id: "payment-form",
|
|
342
|
+
onSubmit: handleSubmit,
|
|
343
|
+
method: "post",
|
|
333
344
|
style: {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
345
|
+
display: "grid",
|
|
346
|
+
gap: "12px",
|
|
347
|
+
padding: "24px",
|
|
348
|
+
backgroundColor: formbackgroundColor,
|
|
349
|
+
borderRadius: formborderRadius,
|
|
350
|
+
width: formwidth,
|
|
351
|
+
// səhifənin 1/4-ü
|
|
352
|
+
boxSizing: "border-box"
|
|
341
353
|
}
|
|
342
|
-
}, /*#__PURE__*/React.createElement("
|
|
354
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
343
355
|
style: {
|
|
344
356
|
textAlign: "center",
|
|
345
|
-
marginBottom:
|
|
346
|
-
color: "#333",
|
|
347
|
-
fontWeight: "600"
|
|
357
|
+
marginBottom: 20
|
|
348
358
|
}
|
|
349
|
-
},
|
|
350
|
-
|
|
351
|
-
|
|
359
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
360
|
+
src: companyLogo,
|
|
361
|
+
alt: "Logo",
|
|
352
362
|
style: {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
display: error ? "block" : "none"
|
|
359
|
-
},
|
|
360
|
-
role: "alert",
|
|
361
|
-
"aria-live": "polite"
|
|
362
|
-
}, error), /*#__PURE__*/React.createElement("div", {
|
|
363
|
-
id: "payment-success",
|
|
364
|
-
className: "alert alert-success",
|
|
363
|
+
height: "40px",
|
|
364
|
+
width: "auto",
|
|
365
|
+
marginBottom: 10
|
|
366
|
+
}
|
|
367
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
365
368
|
style: {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
display: success ? "block" : "none"
|
|
372
|
-
},
|
|
373
|
-
role: "status",
|
|
374
|
-
"aria-live": "polite"
|
|
375
|
-
}, success), /*#__PURE__*/React.createElement("form", {
|
|
376
|
-
ref: formRef,
|
|
377
|
-
id: "payment-form",
|
|
378
|
-
className: "grid gap-5",
|
|
379
|
-
onSubmit: handleSubmit,
|
|
380
|
-
method: "post"
|
|
369
|
+
display: "flex",
|
|
370
|
+
alignItems: "center",
|
|
371
|
+
gap: "12px",
|
|
372
|
+
marginTop: 10
|
|
373
|
+
}
|
|
381
374
|
}, /*#__PURE__*/React.createElement("div", {
|
|
382
|
-
|
|
375
|
+
style: {
|
|
376
|
+
flex: 1,
|
|
377
|
+
height: "1px",
|
|
378
|
+
backgroundColor: "#e5e7eb"
|
|
379
|
+
}
|
|
380
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
381
|
+
style: {
|
|
382
|
+
fontSize: "22px",
|
|
383
|
+
fontWeight: "700",
|
|
384
|
+
color: "#1f2937",
|
|
385
|
+
margin: "0 12px"
|
|
386
|
+
}
|
|
387
|
+
}, "Total Amount:"), /*#__PURE__*/React.createElement("div", {
|
|
388
|
+
style: {
|
|
389
|
+
fontSize: "22px",
|
|
390
|
+
fontWeight: "700",
|
|
391
|
+
color: "#16a34a"
|
|
392
|
+
}
|
|
393
|
+
}, currencyIcon, " ", Math.round(amount * 100)), /*#__PURE__*/React.createElement("div", {
|
|
394
|
+
style: {
|
|
395
|
+
flex: 1,
|
|
396
|
+
height: "1px",
|
|
397
|
+
backgroundColor: "#e5e7eb"
|
|
398
|
+
}
|
|
399
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
400
|
+
style: {
|
|
401
|
+
display: "grid",
|
|
402
|
+
gap: "8px"
|
|
403
|
+
}
|
|
383
404
|
}, /*#__PURE__*/React.createElement("label", {
|
|
384
405
|
style: {
|
|
385
406
|
fontWeight: "500",
|
|
@@ -390,15 +411,16 @@ function PaymentForm(_ref) {
|
|
|
390
411
|
className: "form-control",
|
|
391
412
|
style: {
|
|
392
413
|
padding: "12px",
|
|
393
|
-
borderRadius: "
|
|
394
|
-
border: "1px solid #ccc"
|
|
414
|
+
borderRadius: "10px",
|
|
415
|
+
border: "1px solid #ccc",
|
|
416
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
395
417
|
}
|
|
396
418
|
})), /*#__PURE__*/React.createElement("div", {
|
|
397
|
-
className: "grid gap-2",
|
|
398
419
|
style: {
|
|
399
|
-
gridTemplateColumns: "1fr 1fr",
|
|
400
420
|
display: "grid",
|
|
401
|
-
|
|
421
|
+
gridTemplateColumns: "1fr 1fr",
|
|
422
|
+
gap: "10px",
|
|
423
|
+
marginTop: "12px"
|
|
402
424
|
}
|
|
403
425
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", {
|
|
404
426
|
style: {
|
|
@@ -410,8 +432,9 @@ function PaymentForm(_ref) {
|
|
|
410
432
|
className: "form-control",
|
|
411
433
|
style: {
|
|
412
434
|
padding: "12px",
|
|
413
|
-
borderRadius: "
|
|
414
|
-
border: "1px solid #ccc"
|
|
435
|
+
borderRadius: "10px",
|
|
436
|
+
border: "1px solid #ccc",
|
|
437
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
415
438
|
}
|
|
416
439
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", {
|
|
417
440
|
style: {
|
|
@@ -423,25 +446,26 @@ function PaymentForm(_ref) {
|
|
|
423
446
|
className: "form-control",
|
|
424
447
|
style: {
|
|
425
448
|
padding: "12px",
|
|
426
|
-
borderRadius: "
|
|
427
|
-
border: "1px solid #ccc"
|
|
449
|
+
borderRadius: "10px",
|
|
450
|
+
border: "1px solid #ccc",
|
|
451
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
428
452
|
}
|
|
429
453
|
}))), /*#__PURE__*/React.createElement("button", {
|
|
430
454
|
type: "submit",
|
|
431
455
|
disabled: !isReady || isSubmitting,
|
|
432
456
|
style: {
|
|
457
|
+
marginTop: "16px",
|
|
433
458
|
width: "100%",
|
|
434
459
|
padding: "14px",
|
|
435
|
-
backgroundColor:
|
|
460
|
+
backgroundColor: color,
|
|
436
461
|
color: "white",
|
|
437
462
|
border: "none",
|
|
438
|
-
borderRadius: "
|
|
463
|
+
borderRadius: "12px",
|
|
439
464
|
fontWeight: "600",
|
|
440
|
-
cursor: "pointer",
|
|
441
|
-
opacity: !isReady || isSubmitting ? 0.7 : 1
|
|
442
|
-
marginTop: "10px"
|
|
465
|
+
cursor: !isReady || isSubmitting ? "not-allowed" : "pointer",
|
|
466
|
+
opacity: !isReady || isSubmitting ? 0.7 : 1
|
|
443
467
|
}
|
|
444
|
-
}, isSubmitting ? "Processing..." : "Buy now")))
|
|
468
|
+
}, isSubmitting ? "Processing..." : "Buy now")));
|
|
445
469
|
}
|
|
446
470
|
|
|
447
471
|
export { PaymentForm };
|
package/package.json
CHANGED
package/src/PaymentForm.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from "react";
|
|
2
2
|
|
|
3
|
-
export default function PaymentForm({amount,currency}) {
|
|
3
|
+
export default function PaymentForm({amount,currency,currencyIcon,color,formwidth=400,formborderRadius=20,formbackgroundColor="#fff",companyLogo}) {
|
|
4
4
|
const formRef = useRef();
|
|
5
5
|
const initializedRef = useRef(false); // yalnız bir dəfə mount üçün
|
|
6
6
|
const shift4Ref = useRef(null);
|
|
@@ -90,105 +90,117 @@ export default function PaymentForm({amount,currency}) {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
return (
|
|
93
|
-
|
|
93
|
+
<div
|
|
94
94
|
style={{
|
|
95
95
|
display: "flex",
|
|
96
96
|
justifyContent: "center",
|
|
97
|
-
|
|
98
|
-
minHeight: "100vh",
|
|
99
|
-
backgroundColor: "#f0f2f5", // yumşaq fon
|
|
97
|
+
width: "100%",
|
|
100
98
|
padding: "20px",
|
|
99
|
+
boxSizing: "border-box"
|
|
101
100
|
}}
|
|
102
101
|
>
|
|
103
|
-
<
|
|
102
|
+
<form
|
|
103
|
+
ref={formRef}
|
|
104
|
+
id="payment-form"
|
|
105
|
+
onSubmit={handleSubmit}
|
|
106
|
+
method="post"
|
|
104
107
|
style={{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
padding: "
|
|
108
|
-
backgroundColor:
|
|
109
|
-
borderRadius:
|
|
110
|
-
|
|
108
|
+
display: "grid",
|
|
109
|
+
gap: "12px",
|
|
110
|
+
padding: "24px",
|
|
111
|
+
backgroundColor: formbackgroundColor,
|
|
112
|
+
borderRadius: formborderRadius,
|
|
113
|
+
width: formwidth, // səhifənin 1/4-ü
|
|
114
|
+
boxSizing: "border-box"
|
|
111
115
|
}}
|
|
112
116
|
>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
backgroundColor: "#
|
|
124
|
-
color: "#
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
117
|
+
{/* Logo + Total */}
|
|
118
|
+
<div style={{ textAlign: "center", marginBottom: 20 }}>
|
|
119
|
+
<img
|
|
120
|
+
src={companyLogo}
|
|
121
|
+
alt="Logo"
|
|
122
|
+
style={{ height: "40px", width: "auto", marginBottom: 10 }}
|
|
123
|
+
/>
|
|
124
|
+
|
|
125
|
+
{/* Product Name + Price inline with line */}
|
|
126
|
+
<div style={{ display: "flex", alignItems: "center", gap: "12px", marginTop: 10 }}>
|
|
127
|
+
<div style={{ flex: 1, height: "1px", backgroundColor: "#e5e7eb" }} />
|
|
128
|
+
<div style={{ fontSize: "22px", fontWeight: "700", color: "#1f2937", margin: "0 12px" }}>
|
|
129
|
+
Total Amount:
|
|
130
|
+
</div>
|
|
131
|
+
<div style={{ fontSize: "22px", fontWeight: "700", color: "#16a34a" }}>
|
|
132
|
+
{currencyIcon} {Math.round(amount * 100)}
|
|
133
|
+
</div>
|
|
134
|
+
<div style={{ flex: 1, height: "1px", backgroundColor: "#e5e7eb" }} />
|
|
135
|
+
</div>
|
|
132
136
|
</div>
|
|
133
137
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
>
|
|
148
|
-
{success}
|
|
138
|
+
{/* Card Number */}
|
|
139
|
+
<div style={{ display: "grid", gap: "8px" }}>
|
|
140
|
+
<label style={{ fontWeight: "500", color: "#555" }}>Card number</label>
|
|
141
|
+
<div
|
|
142
|
+
data-shift4="number"
|
|
143
|
+
className="form-control"
|
|
144
|
+
style={{
|
|
145
|
+
padding: "12px",
|
|
146
|
+
borderRadius: "10px",
|
|
147
|
+
border: "1px solid #ccc",
|
|
148
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
149
|
+
}}
|
|
150
|
+
/>
|
|
149
151
|
</div>
|
|
150
152
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<div
|
|
154
|
-
<label style={{ fontWeight: "500", color: "#555" }}>
|
|
155
|
-
<div
|
|
153
|
+
{/* Expiration + CVC */}
|
|
154
|
+
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "10px", marginTop: "12px" }}>
|
|
155
|
+
<div>
|
|
156
|
+
<label style={{ fontWeight: "500", color: "#555" }}>Expiration</label>
|
|
157
|
+
<div
|
|
158
|
+
data-shift4="expiry"
|
|
159
|
+
className="form-control"
|
|
160
|
+
style={{
|
|
161
|
+
padding: "12px",
|
|
162
|
+
borderRadius: "10px",
|
|
163
|
+
border: "1px solid #ccc",
|
|
164
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
165
|
+
}}
|
|
166
|
+
/>
|
|
156
167
|
</div>
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
<div>
|
|
169
|
+
<label style={{ fontWeight: "500", color: "#555" }}>CVC</label>
|
|
170
|
+
<div
|
|
171
|
+
data-shift4="cvc"
|
|
172
|
+
className="form-control"
|
|
173
|
+
style={{
|
|
174
|
+
padding: "12px",
|
|
175
|
+
borderRadius: "10px",
|
|
176
|
+
border: "1px solid #ccc",
|
|
177
|
+
boxShadow: "inset 0 2px 4px rgba(0,0,0,0.05)"
|
|
178
|
+
}}
|
|
179
|
+
/>
|
|
169
180
|
</div>
|
|
181
|
+
</div>
|
|
170
182
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
</div>
|
|
183
|
+
{/* Submit Button */}
|
|
184
|
+
<button
|
|
185
|
+
type="submit"
|
|
186
|
+
disabled={!isReady || isSubmitting}
|
|
187
|
+
style={{
|
|
188
|
+
marginTop: "16px",
|
|
189
|
+
width: "100%",
|
|
190
|
+
padding: "14px",
|
|
191
|
+
backgroundColor: color,
|
|
192
|
+
color: "white",
|
|
193
|
+
border: "none",
|
|
194
|
+
borderRadius: "12px",
|
|
195
|
+
fontWeight: "600",
|
|
196
|
+
cursor: !isReady || isSubmitting ? "not-allowed" : "pointer",
|
|
197
|
+
opacity: !isReady || isSubmitting ? 0.7 : 1
|
|
198
|
+
}}
|
|
199
|
+
>
|
|
200
|
+
{isSubmitting ? "Processing..." : "Buy now"}
|
|
201
|
+
</button>
|
|
202
|
+
</form>
|
|
192
203
|
</div>
|
|
204
|
+
|
|
193
205
|
);
|
|
194
206
|
}
|