coinley-checkout 0.6.8 → 0.6.9
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.
@@ -20583,11 +20583,11 @@ const PaymentStatus = ({
|
|
20583
20583
|
merchantName = "Merchant",
|
20584
20584
|
onClose = null,
|
20585
20585
|
// The onClose prop for the close button
|
20586
|
-
//
|
20586
|
+
// Processing info
|
20587
20587
|
processingStartTime = null,
|
20588
|
-
|
20589
|
-
|
20590
|
-
//
|
20588
|
+
paymentNetwork = null,
|
20589
|
+
pendingBackendConfirmation = false
|
20590
|
+
// New prop to show backend confirmation status
|
20591
20591
|
}) => {
|
20592
20592
|
const [copiedHash, setCopiedHash] = useState(false);
|
20593
20593
|
const [processingSeconds, setProcessingSeconds] = useState(0);
|
@@ -20629,11 +20629,6 @@ const PaymentStatus = ({
|
|
20629
20629
|
onClose();
|
20630
20630
|
}
|
20631
20631
|
};
|
20632
|
-
const handleEarlySuccess = () => {
|
20633
|
-
if (onClose) {
|
20634
|
-
onClose();
|
20635
|
-
}
|
20636
|
-
};
|
20637
20632
|
const formatTransactionHash = (hash2) => {
|
20638
20633
|
if (!hash2)
|
20639
20634
|
return "";
|
@@ -20650,16 +20645,6 @@ const PaymentStatus = ({
|
|
20650
20645
|
};
|
20651
20646
|
return names2[network] || network;
|
20652
20647
|
};
|
20653
|
-
const getEstimatedConfirmationTime = (network) => {
|
20654
|
-
const times = {
|
20655
|
-
ethereum: "1-2 minutes",
|
20656
|
-
bsc: "15-30 seconds",
|
20657
|
-
tron: "30-60 seconds",
|
20658
|
-
algorand: "5-10 seconds",
|
20659
|
-
solana: "10-15 seconds"
|
20660
|
-
};
|
20661
|
-
return times[network] || "1-2 minutes";
|
20662
|
-
};
|
20663
20648
|
const formatRecipientAddress = (address) => {
|
20664
20649
|
if (!address)
|
20665
20650
|
return "N/A";
|
@@ -20667,11 +20652,6 @@ const PaymentStatus = ({
|
|
20667
20652
|
return address;
|
20668
20653
|
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
20669
20654
|
};
|
20670
|
-
const formatTime = (seconds) => {
|
20671
|
-
const mins = Math.floor(seconds / 60);
|
20672
|
-
const secs = seconds % 60;
|
20673
|
-
return `${mins}:${secs < 10 ? "0" : ""}${secs}`;
|
20674
|
-
};
|
20675
20655
|
const renderIcon = () => {
|
20676
20656
|
switch (status) {
|
20677
20657
|
case "processing":
|
@@ -20711,7 +20691,7 @@ const PaymentStatus = ({
|
|
20711
20691
|
case "processing":
|
20712
20692
|
return "Processing Payment";
|
20713
20693
|
case "success":
|
20714
|
-
return "Payment Successful";
|
20694
|
+
return "Payment Successful!";
|
20715
20695
|
case "error":
|
20716
20696
|
return "Payment Failed";
|
20717
20697
|
default:
|
@@ -20743,6 +20723,13 @@ const PaymentStatus = ({
|
|
20743
20723
|
] }),
|
20744
20724
|
" has been completed."
|
20745
20725
|
] }),
|
20726
|
+
pendingBackendConfirmation && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center mb-4 text-xs text-gray-500 bg-gray-50 rounded-full px-3 py-1", children: [
|
20727
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: "animate-spin -ml-1 mr-2 h-3 w-3 text-gray-400", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
20728
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
20729
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
20730
|
+
] }),
|
20731
|
+
"Verifying on blockchain"
|
20732
|
+
] }),
|
20746
20733
|
transactionHash && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full mb-6", children: [
|
20747
20734
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium mb-2 ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: "Transaction Hash:" }),
|
20748
20735
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
@@ -20795,54 +20782,6 @@ const PaymentStatus = ({
|
|
20795
20782
|
)
|
20796
20783
|
] });
|
20797
20784
|
}
|
20798
|
-
if (status === "processing") {
|
20799
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
20800
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: renderIcon() }),
|
20801
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: `text-xl font-bold mb-2 ${theme2 === "dark" ? "text-white" : "text-gray-900"}`, children: getStatusTitle() }),
|
20802
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-center ${getMessageClasses()}`, children: message }),
|
20803
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full mt-6 mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full bg-gray-200 rounded-full h-2.5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
20804
|
-
"div",
|
20805
|
-
{
|
20806
|
-
className: "bg-blue-600 h-2.5 rounded-full transition-all duration-500",
|
20807
|
-
style: {
|
20808
|
-
width: `${Math.min(100, progressStage / 3 * 100)}%`
|
20809
|
-
}
|
20810
|
-
}
|
20811
|
-
) }) }),
|
20812
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full grid grid-cols-3 gap-1 mb-4", children: [
|
20813
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-xs text-center ${progressStage >= 1 ? "text-blue-600 font-medium" : "text-gray-400"}`, children: "Submitted" }),
|
20814
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-xs text-center ${progressStage >= 2 ? "text-blue-600 font-medium" : "text-gray-400"}`, children: "Detected" }),
|
20815
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-xs text-center ${progressStage >= 3 ? "text-blue-600 font-medium" : "text-gray-400"}`, children: "Confirming" })
|
20816
|
-
] }),
|
20817
|
-
transactionHash && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full my-3 px-4", children: [
|
20818
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-center text-gray-600 mb-2", children: "Transaction ID:" }),
|
20819
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-gray-50 border border-gray-200 rounded-md p-2 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-mono text-gray-700", children: formatTransactionHash(transactionHash) }) })
|
20820
|
-
] }),
|
20821
|
-
paymentNetwork && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full mt-4 mb-2 p-3 bg-blue-50 rounded-md text-center", children: [
|
20822
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-blue-800", children: [
|
20823
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: "Estimated confirmation time:" }),
|
20824
|
-
" ",
|
20825
|
-
getEstimatedConfirmationTime(paymentNetwork)
|
20826
|
-
] }),
|
20827
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-blue-600 mt-1", children: [
|
20828
|
-
"Processing time: ",
|
20829
|
-
formatTime(processingSeconds)
|
20830
|
-
] })
|
20831
|
-
] }),
|
20832
|
-
showEarlySuccessOption && onClose && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full mt-4", children: [
|
20833
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2 p-3 bg-yellow-50 rounded-md", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-center text-yellow-800", children: "Taking longer than expected? Your payment may already be complete. You can proceed now or continue waiting for confirmation." }) }),
|
20834
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
20835
|
-
"button",
|
20836
|
-
{
|
20837
|
-
onClick: handleEarlySuccess,
|
20838
|
-
className: "w-full py-2 px-4 bg-gray-200 text-purple-600 font-medium rounded-md hover:bg-gray-300 transition-colors",
|
20839
|
-
children: "Continue to Order Confirmation"
|
20840
|
-
}
|
20841
|
-
)
|
20842
|
-
] }),
|
20843
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `mt-4 text-xs ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "Blockchain transactions can take a few moments to confirm. Please wait..." })
|
20844
|
-
] });
|
20845
|
-
}
|
20846
20785
|
if (status === "error") {
|
20847
20786
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
20848
20787
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: renderIcon() }),
|
@@ -21247,11 +21186,10 @@ const CoinleyModal = ({
|
|
21247
21186
|
step = "select-currency",
|
21248
21187
|
merchantWalletAddresses = {},
|
21249
21188
|
debug = false,
|
21250
|
-
//
|
21189
|
+
// Processing info
|
21251
21190
|
processingStartTime = null,
|
21252
|
-
|
21253
|
-
paymentNetwork = null
|
21254
|
-
onEarlySuccess = null
|
21191
|
+
pendingBackendConfirmation = false,
|
21192
|
+
paymentNetwork = null
|
21255
21193
|
}) => {
|
21256
21194
|
const [paymentType, setPaymentType] = useState("wallet");
|
21257
21195
|
const getWalletAddressForNetwork = () => {
|
@@ -21272,12 +21210,6 @@ const CoinleyModal = ({
|
|
21272
21210
|
onClose();
|
21273
21211
|
}
|
21274
21212
|
};
|
21275
|
-
const handleEarlySuccess = () => {
|
21276
|
-
console.log("Early success button clicked");
|
21277
|
-
if (onEarlySuccess) {
|
21278
|
-
onEarlySuccess();
|
21279
|
-
}
|
21280
|
-
};
|
21281
21213
|
const formatAmount = (amount) => {
|
21282
21214
|
return parseFloat(amount).toFixed(2);
|
21283
21215
|
};
|
@@ -21472,7 +21404,7 @@ const CoinleyModal = ({
|
|
21472
21404
|
] })
|
21473
21405
|
),
|
21474
21406
|
error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 rounded-lg bg-red-50 mb-4 text-red-600 text-sm", children: error }),
|
21475
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3
|
21407
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [
|
21476
21408
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21477
21409
|
"button",
|
21478
21410
|
{
|
@@ -21499,11 +21431,10 @@ const CoinleyModal = ({
|
|
21499
21431
|
{
|
21500
21432
|
status: "processing",
|
21501
21433
|
theme: theme2,
|
21502
|
-
message:
|
21434
|
+
message: "Processing your payment...",
|
21503
21435
|
processingStartTime,
|
21504
21436
|
paymentNetwork: paymentNetwork || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.network),
|
21505
|
-
transactionHash
|
21506
|
-
onEarlySuccess: handleEarlySuccess
|
21437
|
+
transactionHash
|
21507
21438
|
}
|
21508
21439
|
),
|
21509
21440
|
step === "success" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
@@ -21516,7 +21447,8 @@ const CoinleyModal = ({
|
|
21516
21447
|
transactionHash,
|
21517
21448
|
selectedPaymentMethod,
|
21518
21449
|
merchantName,
|
21519
|
-
onClose: handleSuccessClose
|
21450
|
+
onClose: handleSuccessClose,
|
21451
|
+
pendingBackendConfirmation
|
21520
21452
|
}
|
21521
21453
|
),
|
21522
21454
|
step === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
@@ -21571,11 +21503,10 @@ const CoinleyCheckout = forwardRef(({
|
|
21571
21503
|
supportedNetworks = [],
|
21572
21504
|
preferredNetwork = NETWORK_TYPES.ETHEREUM,
|
21573
21505
|
preferredWallet = WALLET_TYPES.METAMASK,
|
21574
|
-
//
|
21506
|
+
// Processing options
|
21575
21507
|
confirmations = 1,
|
21576
|
-
|
21577
|
-
|
21578
|
-
// When true, will show success screen faster with fewer confirmations
|
21508
|
+
fastMode = true
|
21509
|
+
// Default to true for faster experience
|
21579
21510
|
}, ref) => {
|
21580
21511
|
const coinleyContext = useCoinley();
|
21581
21512
|
const { theme: contextTheme } = useTheme();
|
@@ -21590,9 +21521,9 @@ const CoinleyCheckout = forwardRef(({
|
|
21590
21521
|
const [step, setStep] = useState("select-currency");
|
21591
21522
|
const [actualMerchantWallets, setActualMerchantWallets] = useState({});
|
21592
21523
|
const [processingStartTime, setProcessingStartTime] = useState(null);
|
21593
|
-
const [transactionDetected, setTransactionDetected] = useState(false);
|
21594
21524
|
const [checkingInterval, setCheckingInterval] = useState(null);
|
21595
21525
|
const processingTimerRef = useRef(null);
|
21526
|
+
const [pendingBackendConfirmation, setPendingBackendConfirmation] = useState(false);
|
21596
21527
|
const effectiveApiKey = apiKey || (coinleyContext == null ? void 0 : coinleyContext.apiKey);
|
21597
21528
|
const effectiveApiSecret = apiSecret || (coinleyContext == null ? void 0 : coinleyContext.apiSecret);
|
21598
21529
|
apiUrl || (coinleyContext == null ? void 0 : coinleyContext.apiUrl);
|
@@ -21641,73 +21572,64 @@ const CoinleyCheckout = forwardRef(({
|
|
21641
21572
|
};
|
21642
21573
|
}, [checkingInterval]);
|
21643
21574
|
useEffect(() => {
|
21644
|
-
if (transactionHash &&
|
21645
|
-
|
21646
|
-
|
21647
|
-
|
21648
|
-
|
21649
|
-
|
21650
|
-
|
21651
|
-
|
21652
|
-
|
21653
|
-
|
21654
|
-
|
21655
|
-
|
21656
|
-
|
21657
|
-
}
|
21658
|
-
|
21575
|
+
if (transactionHash && pendingBackendConfirmation && paymentStatus === "loading") {
|
21576
|
+
const interval = setInterval(() => __async(void 0, null, function* () {
|
21577
|
+
try {
|
21578
|
+
log("Checking payment status with backend...");
|
21579
|
+
const processResponse = yield processPayment({
|
21580
|
+
paymentId: payment.id,
|
21581
|
+
transactionHash,
|
21582
|
+
network: selectedPaymentMethod.network,
|
21583
|
+
currency: selectedPaymentMethod.currency,
|
21584
|
+
senderAddress: walletConnection == null ? void 0 : walletConnection.address,
|
21585
|
+
confirmations,
|
21586
|
+
check: true
|
21587
|
+
// Just check status, don't process again
|
21588
|
+
});
|
21589
|
+
if (processResponse.status === "success") {
|
21590
|
+
log("Payment confirmed by backend!");
|
21591
|
+
clearInterval(interval);
|
21592
|
+
setCheckingInterval(null);
|
21593
|
+
setPendingBackendConfirmation(false);
|
21594
|
+
setPaymentStatus("success");
|
21659
21595
|
}
|
21660
|
-
})
|
21661
|
-
|
21662
|
-
|
21596
|
+
} catch (err) {
|
21597
|
+
log("Error checking payment status:", err);
|
21598
|
+
}
|
21599
|
+
}), 1e4);
|
21600
|
+
setCheckingInterval(interval);
|
21601
|
+
return () => {
|
21602
|
+
clearInterval(interval);
|
21603
|
+
};
|
21663
21604
|
}
|
21664
|
-
|
21665
|
-
|
21666
|
-
clearInterval(checkingInterval);
|
21667
|
-
}
|
21668
|
-
};
|
21669
|
-
}, [transactionHash, paymentStatus, step, testMode, processingStartTime, fastMode]);
|
21670
|
-
const getMinimumProcessingTime = () => {
|
21671
|
-
if (!selectedPaymentMethod)
|
21672
|
-
return 2e4;
|
21673
|
-
const times = {
|
21674
|
-
[NETWORK_TYPES.ETHEREUM]: 15e3,
|
21675
|
-
// 15 seconds for Ethereum
|
21676
|
-
[NETWORK_TYPES.BSC]: 1e4,
|
21677
|
-
// 10 seconds for BSC
|
21678
|
-
[NETWORK_TYPES.TRON]: 8e3,
|
21679
|
-
// 8 seconds for Tron
|
21680
|
-
[NETWORK_TYPES.ALGORAND]: 5e3
|
21681
|
-
// 5 seconds for Algorand
|
21682
|
-
};
|
21683
|
-
return times[selectedPaymentMethod.network] || 15e3;
|
21684
|
-
};
|
21685
|
-
const handleEarlySuccess = () => __async(void 0, null, function* () {
|
21605
|
+
}, [transactionHash, pendingBackendConfirmation, paymentStatus, payment, selectedPaymentMethod, walletConnection, confirmations]);
|
21606
|
+
const processBackendConfirmation = () => __async(void 0, null, function* () {
|
21686
21607
|
if (!payment || !selectedPaymentMethod || !transactionHash) {
|
21687
21608
|
return;
|
21688
21609
|
}
|
21689
|
-
log("Moving to early success state with transaction:", transactionHash);
|
21690
21610
|
try {
|
21611
|
+
log("Processing payment with backend...");
|
21691
21612
|
const processResponse = yield processPayment({
|
21692
21613
|
paymentId: payment.id,
|
21693
21614
|
transactionHash,
|
21694
21615
|
network: selectedPaymentMethod.network,
|
21695
21616
|
currency: selectedPaymentMethod.currency,
|
21696
21617
|
senderAddress: walletConnection == null ? void 0 : walletConnection.address,
|
21697
|
-
|
21618
|
+
confirmations
|
21698
21619
|
});
|
21699
|
-
log("
|
21700
|
-
|
21701
|
-
setStep("success");
|
21620
|
+
log("Payment processed successfully:", processResponse);
|
21621
|
+
setPendingBackendConfirmation(false);
|
21702
21622
|
if (onSuccess) {
|
21623
|
+
log("Calling onSuccess callback...");
|
21703
21624
|
onSuccess(payment.id, transactionHash, {
|
21704
21625
|
network: selectedPaymentMethod.network,
|
21705
21626
|
currency: selectedPaymentMethod.currency,
|
21706
21627
|
amount: payment.totalAmount || payment.amount
|
21707
21628
|
});
|
21708
21629
|
}
|
21709
|
-
} catch (
|
21710
|
-
log("
|
21630
|
+
} catch (processError) {
|
21631
|
+
log("Payment processing initial attempt failed, will retry in background:", processError);
|
21632
|
+
setPendingBackendConfirmation(true);
|
21711
21633
|
}
|
21712
21634
|
});
|
21713
21635
|
useImperativeHandle(ref, () => ({
|
@@ -21780,7 +21702,7 @@ const CoinleyCheckout = forwardRef(({
|
|
21780
21702
|
setSelectedPaymentMethod(null);
|
21781
21703
|
setStep("select-currency");
|
21782
21704
|
setProcessingStartTime(null);
|
21783
|
-
|
21705
|
+
setPendingBackendConfirmation(false);
|
21784
21706
|
if (onClose)
|
21785
21707
|
onClose();
|
21786
21708
|
};
|
@@ -21844,13 +21766,12 @@ const CoinleyCheckout = forwardRef(({
|
|
21844
21766
|
setTransactionHash(null);
|
21845
21767
|
setStep("processing");
|
21846
21768
|
setProcessingStartTime(Date.now());
|
21847
|
-
setTransactionDetected(false);
|
21848
21769
|
try {
|
21849
21770
|
let txHash;
|
21850
21771
|
if (testMode) {
|
21851
21772
|
log("Test mode: Generating mock transaction...");
|
21852
21773
|
txHash = `test_${Date.now().toString(16)}_${Math.random().toString(16).substring(2, 10)}`;
|
21853
|
-
yield new Promise((resolve) => setTimeout(resolve,
|
21774
|
+
yield new Promise((resolve) => setTimeout(resolve, 1e3));
|
21854
21775
|
} else {
|
21855
21776
|
let merchantAddress;
|
21856
21777
|
if (payment.recipientWallet) {
|
@@ -21871,49 +21792,10 @@ const CoinleyCheckout = forwardRef(({
|
|
21871
21792
|
network: selectedPaymentMethod.network
|
21872
21793
|
});
|
21873
21794
|
}
|
21874
|
-
log("Transaction hash:", txHash);
|
21795
|
+
log("Transaction hash obtained:", txHash);
|
21875
21796
|
setTransactionHash(txHash);
|
21876
|
-
|
21877
|
-
|
21878
|
-
log("Test mode: Moving to success state");
|
21879
|
-
setPaymentStatus("success");
|
21880
|
-
setStep("success");
|
21881
|
-
if (onSuccess) {
|
21882
|
-
log("Calling onSuccess callback...");
|
21883
|
-
onSuccess(payment.id, txHash, {
|
21884
|
-
network: selectedPaymentMethod.network,
|
21885
|
-
currency: selectedPaymentMethod.currency,
|
21886
|
-
amount: payment.totalAmount || payment.amount
|
21887
|
-
});
|
21888
|
-
}
|
21889
|
-
}, 2e3);
|
21890
|
-
return;
|
21891
|
-
}
|
21892
|
-
try {
|
21893
|
-
log("Processing payment with backend...");
|
21894
|
-
const processResponse = yield processPayment({
|
21895
|
-
paymentId: payment.id,
|
21896
|
-
transactionHash: txHash,
|
21897
|
-
network: selectedPaymentMethod.network,
|
21898
|
-
currency: selectedPaymentMethod.currency,
|
21899
|
-
senderAddress: walletConnection == null ? void 0 : walletConnection.address,
|
21900
|
-
confirmations
|
21901
|
-
// Use specified confirmation level
|
21902
|
-
});
|
21903
|
-
log("Payment processed successfully:", processResponse);
|
21904
|
-
setPaymentStatus("success");
|
21905
|
-
setStep("success");
|
21906
|
-
if (onSuccess) {
|
21907
|
-
log("Calling onSuccess callback...");
|
21908
|
-
onSuccess(payment.id, txHash, {
|
21909
|
-
network: selectedPaymentMethod.network,
|
21910
|
-
currency: selectedPaymentMethod.currency,
|
21911
|
-
amount: payment.totalAmount || payment.amount
|
21912
|
-
});
|
21913
|
-
}
|
21914
|
-
} catch (processError) {
|
21915
|
-
log("Payment processing error, but transaction was sent:", processError);
|
21916
|
-
}
|
21797
|
+
setStep("success");
|
21798
|
+
processBackendConfirmation();
|
21917
21799
|
} catch (err) {
|
21918
21800
|
log("Payment error:", err);
|
21919
21801
|
setError(err.message || "Failed to process payment");
|
@@ -21953,9 +21835,8 @@ const CoinleyCheckout = forwardRef(({
|
|
21953
21835
|
merchantWalletAddresses: actualMerchantWallets,
|
21954
21836
|
debug: effectiveDebug,
|
21955
21837
|
processingStartTime,
|
21956
|
-
|
21957
|
-
paymentNetwork: selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.network
|
21958
|
-
onEarlySuccess: handleEarlySuccess
|
21838
|
+
pendingBackendConfirmation,
|
21839
|
+
paymentNetwork: selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.network
|
21959
21840
|
}
|
21960
21841
|
) });
|
21961
21842
|
});
|