coinley-checkout 0.7.8 → 0.8.0
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.
@@ -20594,6 +20594,14 @@ const QRCode = ({
|
|
20594
20594
|
}
|
20595
20595
|
setQrData(paymentData);
|
20596
20596
|
setQrError(null);
|
20597
|
+
console.log("=== QR CODE DEBUG ===");
|
20598
|
+
console.log("Network:", network);
|
20599
|
+
console.log("Currency:", currency);
|
20600
|
+
console.log("Amount:", amount);
|
20601
|
+
console.log("Wallet Address:", walletAddress);
|
20602
|
+
console.log("Generated QR Data:", paymentData);
|
20603
|
+
console.log("QR Data Length:", paymentData.length);
|
20604
|
+
console.log("=== END QR DEBUG ===");
|
20597
20605
|
} catch (err) {
|
20598
20606
|
console.error("Error generating QR code:", err);
|
20599
20607
|
setQrError("Error generating payment QR code");
|
@@ -20601,28 +20609,18 @@ const QRCode = ({
|
|
20601
20609
|
}, [walletAddress, amount, currency, network]);
|
20602
20610
|
const generateAlgorandQR = (address, amount2, currency2) => {
|
20603
20611
|
try {
|
20612
|
+
if (!address || address.includes("No wallet address")) {
|
20613
|
+
return address;
|
20614
|
+
}
|
20604
20615
|
const amountFloat = parseFloat(amount2);
|
20605
20616
|
if (currency2 === "ALGO") {
|
20606
20617
|
const microAlgos = Math.floor(amountFloat * 1e6);
|
20607
|
-
|
20608
|
-
receiver: address,
|
20609
|
-
amount: microAlgos,
|
20610
|
-
note: btoa("Payment via Coinley")
|
20611
|
-
// Base64 encoded note
|
20612
|
-
};
|
20613
|
-
return `algorand://pay?receiver=${peraPayment.receiver}&amount=${peraPayment.amount}¬e=${peraPayment.note}`;
|
20618
|
+
return `algorand://${address}?amount=${microAlgos}`;
|
20614
20619
|
} else {
|
20615
20620
|
const tokenConfig = getTokenConfigForCurrency(currency2, "algorand");
|
20616
20621
|
if (tokenConfig && tokenConfig.assetId) {
|
20617
20622
|
const assetAmount = Math.floor(amountFloat * Math.pow(10, tokenConfig.decimals));
|
20618
|
-
|
20619
|
-
receiver: address,
|
20620
|
-
amount: assetAmount,
|
20621
|
-
assetId: tokenConfig.assetId,
|
20622
|
-
note: btoa(`${currency2} Payment via Coinley`)
|
20623
|
-
// Base64 encoded note
|
20624
|
-
};
|
20625
|
-
return `algorand://pay?receiver=${peraAssetPayment.receiver}&amount=${peraAssetPayment.amount}&asset=${peraAssetPayment.assetId}¬e=${peraAssetPayment.note}`;
|
20623
|
+
return `algorand://${address}?amount=${assetAmount}&asset=${tokenConfig.assetId}`;
|
20626
20624
|
} else {
|
20627
20625
|
console.warn(`Token config not found for ${currency2} on Algorand`);
|
20628
20626
|
return address;
|