coinley-checkout 0.8.4 → 0.8.5
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.
@@ -21751,34 +21751,41 @@ const CoinleyCheckout = forwardRef(({
|
|
21751
21751
|
}
|
21752
21752
|
};
|
21753
21753
|
}, [checkingInterval]);
|
21754
|
-
const
|
21755
|
-
|
21756
|
-
|
21754
|
+
const processBackendConfirmationWithDebug = (txHash) => __async(void 0, null, function* () {
|
21755
|
+
var _a2;
|
21756
|
+
console.log("🔍 processBackendConfirmationWithDebug called with:", txHash);
|
21757
|
+
console.log("📊 State check:");
|
21758
|
+
console.log(" - payment ID:", payment == null ? void 0 : payment.id);
|
21759
|
+
console.log(" - selectedPaymentMethod:", selectedPaymentMethod);
|
21760
|
+
console.log(" - walletConnection:", walletConnection);
|
21761
|
+
if (!payment || !selectedPaymentMethod || !txHash) {
|
21762
|
+
console.error("❌ Missing required data for backend confirmation:", {
|
21757
21763
|
hasPayment: !!payment,
|
21758
21764
|
hasPaymentMethod: !!selectedPaymentMethod,
|
21759
|
-
hasTransactionHash: !!
|
21765
|
+
hasTransactionHash: !!txHash
|
21760
21766
|
});
|
21761
21767
|
return;
|
21762
21768
|
}
|
21763
21769
|
try {
|
21764
|
-
log("
|
21770
|
+
console.log("📡 Making API call to processPayment...");
|
21771
|
+
console.log("📨 Request data:", {
|
21765
21772
|
paymentId: payment.id,
|
21766
|
-
transactionHash,
|
21773
|
+
transactionHash: txHash,
|
21767
21774
|
network: selectedPaymentMethod.network,
|
21768
|
-
|
21775
|
+
senderAddress: walletConnection == null ? void 0 : walletConnection.address
|
21769
21776
|
});
|
21770
21777
|
const processResponse = yield processPayment({
|
21771
21778
|
paymentId: payment.id,
|
21772
|
-
transactionHash,
|
21779
|
+
transactionHash: txHash,
|
21773
21780
|
network: selectedPaymentMethod.network,
|
21774
21781
|
senderAddress: walletConnection == null ? void 0 : walletConnection.address
|
21775
21782
|
});
|
21776
|
-
log("Payment processed successfully with backend:", processResponse);
|
21783
|
+
console.log("✅ Payment processed successfully with backend:", processResponse);
|
21777
21784
|
setPendingBackendConfirmation(false);
|
21778
21785
|
setPaymentStatus("success");
|
21779
21786
|
if (onSuccess) {
|
21780
|
-
log("Calling onSuccess callback...");
|
21781
|
-
onSuccess(payment.id,
|
21787
|
+
console.log("📞 Calling onSuccess callback...");
|
21788
|
+
onSuccess(payment.id, txHash, {
|
21782
21789
|
network: selectedPaymentMethod.network,
|
21783
21790
|
currency: selectedPaymentMethod.currency,
|
21784
21791
|
amount: payment.totalAmount || payment.amount,
|
@@ -21786,10 +21793,13 @@ const CoinleyCheckout = forwardRef(({
|
|
21786
21793
|
});
|
21787
21794
|
}
|
21788
21795
|
} catch (processError) {
|
21789
|
-
|
21796
|
+
console.error("❌ Payment processing failed:", processError);
|
21797
|
+
console.error("❌ Error details:", processError.message);
|
21798
|
+
console.error("❌ Error response:", (_a2 = processError.response) == null ? void 0 : _a2.data);
|
21790
21799
|
setPendingBackendConfirmation(true);
|
21791
21800
|
setTimeout(() => {
|
21792
|
-
processBackendConfirmation
|
21801
|
+
console.log("🔄 Retrying processBackendConfirmation...");
|
21802
|
+
processBackendConfirmationWithDebug(txHash);
|
21793
21803
|
}, 1e4);
|
21794
21804
|
}
|
21795
21805
|
});
|
@@ -21953,11 +21963,23 @@ const CoinleyCheckout = forwardRef(({
|
|
21953
21963
|
network: selectedPaymentMethod.network
|
21954
21964
|
});
|
21955
21965
|
}
|
21956
|
-
log("
|
21966
|
+
console.log("🎉 TRANSACTION HASH OBTAINED:", txHash);
|
21967
|
+
console.log("💾 Setting transaction hash in state...");
|
21957
21968
|
setTransactionHash(txHash);
|
21969
|
+
console.log("📺 Setting step to success...");
|
21958
21970
|
setStep("success");
|
21959
21971
|
setPaymentStatus("success");
|
21960
|
-
processBackendConfirmation
|
21972
|
+
console.log("🔄 About to call processBackendConfirmation...");
|
21973
|
+
console.log("📋 Current state check:");
|
21974
|
+
console.log(" - payment:", payment == null ? void 0 : payment.id);
|
21975
|
+
console.log(" - selectedPaymentMethod:", selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.network);
|
21976
|
+
console.log(" - txHash:", txHash);
|
21977
|
+
try {
|
21978
|
+
console.log("🚀 CALLING processBackendConfirmation...");
|
21979
|
+
yield processBackendConfirmationWithDebug(txHash);
|
21980
|
+
} catch (processError) {
|
21981
|
+
console.error("❌ processBackendConfirmation failed:", processError);
|
21982
|
+
}
|
21961
21983
|
} catch (err) {
|
21962
21984
|
log("Payment error:", err);
|
21963
21985
|
setError(err.message || "Failed to process payment");
|