coinley-checkout 0.5.6 → 0.5.7

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.
@@ -76,7 +76,7 @@ var __async = (__this, __arguments, generator) => {
76
76
  });
77
77
  };
78
78
  var _listener, _listeners, _cancelled, _allowInsecure, _gzip, _headers, _method, _timeout, _url, _body, _bodyType, _creds, _preflight, _process, _retry, _signal, _throttle, _getUrlFunc, _send, send_fn, _statusCode, _statusMessage, _headers2, _body2, _request, _error, _format, _val, _tens, _checkFormat, checkFormat_fn, _checkValue, checkValue_fn, _add, add_fn, _sub, sub_fn, _mul, mul_fn, _div, div_fn, _names, _data, _dataLength, _writeData, writeData_fn, _data2, _offset, _bytesRead, _parent, _maxInflation, _incrementBytesRead, incrementBytesRead_fn, _peekBytes, peekBytes_fn, _r, _s, _v, _networkV, _privateKey, _options, _type, _to, _data3, _nonce, _gasLimit, _gasPrice, _maxPriorityFeePerGas, _maxFeePerGas, _value, _chainId, _sig, _accessList, _maxFeePerBlobGas, _blobVersionedHashes, _kzg, _blobs, _auths, _getSerialized, getSerialized_fn, _types, _fullTypes, _encoderCache, _getEncoder, getEncoder_fn, _offset2, _tokens, _subTokenString, subTokenString_fn, _walkAsync, walkAsync_fn, _getCoder, getCoder_fn, _errors, _events, _functions, _abiCoder, _getFunction, getFunction_fn, _getEvent, getEvent_fn, _transactions, _logs, _startBlock, _iface, _iface2, _filter, _a, _supports2544, _resolver, _fetch, fetch_fn, _getResolver, getResolver_fn, _url2, _processFunc, _name, _chainId2, _plugins, _provider, _poller, _interval, _blockNumber, _poll, poll_fn, _provider2, _poll2, _running, _tag, _lastBlock, _filter2, _hash, _provider3, _filter3, _poller2, _running2, _blockNumber2, _poll3, poll_fn2, _subs, _plugins2, _pausedState, _destroyed, _networkPromise, _anyNetwork, _performCache, _lastBlockNumber, _nextTimer, _timers, _disableCcipRead, _options2, _perform, perform_fn, _call, call_fn, _checkNetwork, checkNetwork_fn, _getAccountValue, getAccountValue_fn, _getBlock, getBlock_fn, _hasSub, hasSub_fn, _getSub, getSub_fn, _provider4, _filterIdPromise, _poller3, _running3, _network, _hault, _poll4, poll_fn3, _teardown, teardown_fn, _event, _options3, _nextId, _payloads, _drainTimer, _notReady, _network2, _pendingDetectNetwork, _scheduleDrain, scheduleDrain_fn, _pollingInterval, _request2, _providerInfo;
79
- import React, { createContext, useContext, useState, useEffect, forwardRef, useImperativeHandle } from "react";
79
+ import React, { createContext, useContext, useState, useEffect, useRef, forwardRef, useImperativeHandle } from "react";
80
80
  const styles = "";
81
81
  const version = "6.14.3";
82
82
  function checkType(value, type, name) {
@@ -20587,21 +20587,65 @@ const QRCode = ({
20587
20587
  ] }) })
20588
20588
  ] });
20589
20589
  };
20590
- const PaymentStatus = ({ status, message, theme: theme2 = "light" }) => {
20590
+ const PaymentStatus = ({
20591
+ status,
20592
+ message,
20593
+ theme: theme2 = "light",
20594
+ // New props for success screen
20595
+ payment = null,
20596
+ transactionHash = null,
20597
+ selectedPaymentMethod = null,
20598
+ merchantName = "Merchant"
20599
+ }) => {
20600
+ const [copiedHash, setCopiedHash] = useState(false);
20601
+ const copyTransactionHash = () => __async(void 0, null, function* () {
20602
+ if (transactionHash) {
20603
+ try {
20604
+ yield navigator.clipboard.writeText(transactionHash);
20605
+ setCopiedHash(true);
20606
+ setTimeout(() => setCopiedHash(false), 2e3);
20607
+ } catch (err) {
20608
+ console.error("Failed to copy transaction hash:", err);
20609
+ }
20610
+ }
20611
+ });
20612
+ const formatTransactionHash = (hash2) => {
20613
+ if (!hash2)
20614
+ return "";
20615
+ if (hash2.length <= 16)
20616
+ return hash2;
20617
+ return `${hash2.slice(0, 8)}...${hash2.slice(-8)}`;
20618
+ };
20619
+ const getNetworkDisplayName = (network) => {
20620
+ const names2 = {
20621
+ ethereum: "Ethereum",
20622
+ bsc: "BSC",
20623
+ tron: "TRON",
20624
+ algorand: "Algorand"
20625
+ };
20626
+ return names2[network] || network;
20627
+ };
20628
+ const formatRecipientAddress = (address) => {
20629
+ if (!address)
20630
+ return "N/A";
20631
+ if (address.length <= 16)
20632
+ return address;
20633
+ return `${address.slice(0, 6)}...${address.slice(-4)}`;
20634
+ };
20591
20635
  const renderIcon = () => {
20592
20636
  switch (status) {
20593
20637
  case "processing":
20594
20638
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-4 border-t-blue-500 border-blue-500/20" });
20595
20639
  case "success":
20596
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-full h-12 w-12 bg-green-100 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
20640
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-full h-16 w-16 bg-green-500 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
20597
20641
  "svg",
20598
20642
  {
20599
20643
  xmlns: "http://www.w3.org/2000/svg",
20600
- className: "h-8 w-8 text-green-500",
20644
+ className: "h-10 w-10 text-white",
20601
20645
  fill: "none",
20602
20646
  viewBox: "0 0 24 24",
20603
20647
  stroke: "currentColor",
20604
- strokeWidth: 2,
20648
+ strokeWidth: 3,
20605
20649
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
20606
20650
  }
20607
20651
  ) });
@@ -20646,43 +20690,119 @@ const PaymentStatus = ({ status, message, theme: theme2 = "light" }) => {
20646
20690
  return theme2 === "dark" ? "text-gray-300" : "text-gray-600";
20647
20691
  }
20648
20692
  };
20693
+ if (status === "success") {
20694
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
20695
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: renderIcon() }),
20696
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: `text-2xl font-bold mb-3 ${theme2 === "dark" ? "text-white" : "text-gray-900"}`, children: "Payment Successful" }),
20697
+ payment && selectedPaymentMethod && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: `text-center mb-6 ${theme2 === "dark" ? "text-gray-300" : "text-gray-600"}`, children: [
20698
+ "Your payment of ",
20699
+ payment.totalAmount || payment.amount,
20700
+ " ",
20701
+ selectedPaymentMethod.currency,
20702
+ " has been completed."
20703
+ ] }),
20704
+ transactionHash && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full mb-6", children: [
20705
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium mb-2 ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: "Transaction Hash:" }),
20706
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
20707
+ "div",
20708
+ {
20709
+ className: `flex items-center justify-between p-3 rounded-lg border cursor-pointer transition-colors ${theme2 === "dark" ? "bg-gray-700 border-gray-600 hover:bg-gray-600" : "bg-gray-50 border-gray-200 hover:bg-gray-100"}`,
20710
+ onClick: copyTransactionHash,
20711
+ children: [
20712
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `font-mono text-sm ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: formatTransactionHash(transactionHash) }),
20713
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
20714
+ copiedHash ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-500 text-xs font-medium mr-2", children: "Copied!" }) : null,
20715
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
20716
+ "svg",
20717
+ {
20718
+ xmlns: "http://www.w3.org/2000/svg",
20719
+ className: `h-4 w-4 ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`,
20720
+ fill: "none",
20721
+ viewBox: "0 0 24 24",
20722
+ stroke: "currentColor",
20723
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" })
20724
+ }
20725
+ )
20726
+ ] })
20727
+ ]
20728
+ }
20729
+ )
20730
+ ] }),
20731
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-full p-4 rounded-lg border ${theme2 === "dark" ? "bg-gray-700 border-gray-600" : "bg-gray-50 border-gray-200"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
20732
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
20733
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs font-medium mb-1 ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "Merchant ID:" }),
20734
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: merchantName })
20735
+ ] }),
20736
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
20737
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs font-medium mb-1 ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "Network:" }),
20738
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: selectedPaymentMethod ? getNetworkDisplayName(selectedPaymentMethod.network) : "N/A" })
20739
+ ] }),
20740
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-2", children: [
20741
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs font-medium mb-1 ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "Recipient:" }),
20742
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-mono ${theme2 === "dark" ? "text-gray-300" : "text-gray-700"}`, children: (payment == null ? void 0 : payment.recipientWallet) ? formatRecipientAddress(payment.recipientWallet) : "N/A" })
20743
+ ] })
20744
+ ] }) })
20745
+ ] });
20746
+ }
20649
20747
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
20650
20748
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: renderIcon() }),
20651
20749
  /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: `text-xl font-bold mb-2 ${theme2 === "dark" ? "text-white" : "text-gray-900"}`, children: getStatusTitle() }),
20652
20750
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-center ${getMessageClasses()}`, children: message }),
20653
20751
  status === "processing" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `mt-4 text-xs ${theme2 === "dark" ? "text-gray-400" : "text-gray-500"}`, children: "This may take a few moments. Please do not close this window." }),
20654
- status === "success" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `mt-4 p-2 rounded ${theme2 === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs ${theme2 === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Your payment has been successfully processed. You will receive a confirmation shortly." }) })
20752
+ status === "error" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `mt-4 p-2 rounded ${theme2 === "dark" ? "bg-gray-700" : "bg-gray-100"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs ${theme2 === "dark" ? "text-gray-300" : "text-gray-600"}`, children: "Please try again or contact support if the problem persists." }) })
20655
20753
  ] });
20656
20754
  };
20657
20755
  const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supportedNetworks = [] }) => {
20756
+ var _a2, _b, _c;
20658
20757
  const [selectedNetwork, setSelectedNetwork] = useState(NETWORK_TYPES.ETHEREUM);
20758
+ const [selectedPaymentMethod, setSelectedPaymentMethod] = useState(null);
20659
20759
  const [availableWallets, setAvailableWallets] = useState({});
20660
20760
  const [showMore, setShowMore] = useState(false);
20661
- useEffect(() => {
20662
- setAvailableWallets(detectWallets());
20663
- }, []);
20664
20761
  const networks = [
20665
20762
  {
20666
20763
  id: NETWORK_TYPES.ETHEREUM,
20667
20764
  name: "Ethereum",
20668
- description: "ERC-20"
20669
- },
20670
- {
20671
- id: NETWORK_TYPES.BSC,
20672
- name: "BSC",
20673
- description: "BEP-20"
20765
+ icon: "/eth.png"
20674
20766
  },
20675
20767
  {
20676
20768
  id: NETWORK_TYPES.TRON,
20677
20769
  name: "Tron",
20678
- description: "TRC-20"
20770
+ icon: "/tron.png"
20679
20771
  },
20680
20772
  {
20681
20773
  id: NETWORK_TYPES.ALGORAND,
20682
20774
  name: "Algorand",
20683
- description: "ASA"
20775
+ icon: "/algo.png"
20776
+ },
20777
+ {
20778
+ id: "solana",
20779
+ name: "Solana",
20780
+ icon: "/sol.png"
20781
+ },
20782
+ {
20783
+ id: NETWORK_TYPES.BSC,
20784
+ name: "Binance Smart Chain",
20785
+ icon: "/bnb.png"
20684
20786
  }
20685
20787
  ];
20788
+ const [dropdownOpen, setDropdownOpen] = useState(false);
20789
+ const dropdownRef = useRef(null);
20790
+ useEffect(() => {
20791
+ function handleClickOutside(event) {
20792
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
20793
+ setDropdownOpen(false);
20794
+ }
20795
+ }
20796
+ if (dropdownOpen) {
20797
+ document.addEventListener("mousedown", handleClickOutside);
20798
+ } else {
20799
+ document.removeEventListener("mousedown", handleClickOutside);
20800
+ }
20801
+ return () => document.removeEventListener("mousedown", handleClickOutside);
20802
+ }, [dropdownOpen]);
20803
+ useEffect(() => {
20804
+ setAvailableWallets(detectWallets());
20805
+ }, []);
20686
20806
  const getPaymentMethodsForNetwork = (network) => {
20687
20807
  const methods = [];
20688
20808
  switch (network) {
@@ -20734,7 +20854,7 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
20734
20854
  id: "ETH",
20735
20855
  name: "ETH",
20736
20856
  description: "Ethereum",
20737
- logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcyJyRKN0dRJWVZqoLzYgkRHdJsxKGq8nHUw&s",
20857
+ logo: "/eth.png",
20738
20858
  network: NETWORK_TYPES.ETHEREUM
20739
20859
  }
20740
20860
  );
@@ -20773,7 +20893,7 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
20773
20893
  id: "BNB",
20774
20894
  name: "BNB",
20775
20895
  description: "Binance Coin",
20776
- logo: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRHSjyW2sSnBhwztCwVW97i1BtV40g7heMMxg&s",
20896
+ logo: "/bnb.png",
20777
20897
  network: NETWORK_TYPES.BSC
20778
20898
  }
20779
20899
  );
@@ -20841,18 +20961,22 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
20841
20961
  const handleNetworkChange = (networkId) => {
20842
20962
  setSelectedNetwork(networkId);
20843
20963
  setShowMore(false);
20844
- if ((selected == null ? void 0 : selected.network) !== networkId) {
20845
- onSelect(null);
20846
- }
20964
+ setSelectedPaymentMethod(null);
20847
20965
  };
20848
20966
  const handleSelectPaymentMethod = (method) => {
20849
- var _a2;
20850
- onSelect({
20967
+ var _a3;
20968
+ const paymentMethodData = {
20851
20969
  currency: method.id,
20852
20970
  network: selectedNetwork,
20853
- tokenConfig: (_a2 = TOKEN_CONFIG[method.id]) == null ? void 0 : _a2[selectedNetwork],
20971
+ tokenConfig: (_a3 = TOKEN_CONFIG[method.id]) == null ? void 0 : _a3[selectedNetwork],
20854
20972
  method
20855
- });
20973
+ };
20974
+ setSelectedPaymentMethod(paymentMethodData);
20975
+ };
20976
+ const handleProceed = () => {
20977
+ if (selectedPaymentMethod) {
20978
+ onSelect(selectedPaymentMethod);
20979
+ }
20856
20980
  };
20857
20981
  const availableMethods = getPaymentMethodsForNetwork(selectedNetwork);
20858
20982
  const visibleMethods = showMore ? availableMethods : availableMethods.slice(0, 4);
@@ -20880,57 +21004,80 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
20880
21004
  };
20881
21005
  return isAvailable ? `${walletNames[wallet]} detected - Ready to pay` : `${walletNames[wallet]} required - Please install to continue`;
20882
21006
  }
20883
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { classname: "bg-white", children: [
21007
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "", children: [
20884
21008
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
20885
21009
  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: `block text-sm font-medium mb-2 ${theme2 === "dark" ? "text-white" : "text-gray-700"}`, children: "Blockchain Network" }),
20886
- /* @__PURE__ */ jsxRuntimeExports.jsx(
20887
- "select",
20888
- {
20889
- value: selectedNetwork,
20890
- onChange: (e) => handleNetworkChange(e.target.value),
20891
- className: `w-full p-3 rounded-lg border transition-colors ${theme2 === "dark" ? "bg-gray-700 border-gray-600 text-white focus:border-[#7042D2]" : "bg-white border-gray-300 text-gray-900 focus:border-[#7042D2]"} focus:outline-none focus:ring-2 focus:ring-[#7042D2] focus:ring-opacity-50`,
20892
- children: networks.filter((network) => supportedNetworks.length === 0 || supportedNetworks.includes(network.id)).map((network) => /* @__PURE__ */ jsxRuntimeExports.jsxs("option", { value: network.id, children: [
20893
- network.name,
20894
- " - ",
20895
- network.description
20896
- ] }, network.id))
20897
- }
20898
- )
21010
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", ref: dropdownRef, children: [
21011
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
21012
+ "button",
21013
+ {
21014
+ type: "button",
21015
+ className: "w-full flex items-center justify-between px-5 py-4 bg-white rounded-2xl shadow border border-gray-200 text-gray-900 text-base font-normal focus:outline-none focus:ring-2 focus:ring-[#7042D2] focus:ring-opacity-50 transition",
21016
+ onClick: () => setDropdownOpen((open) => !open),
21017
+ style: { minHeight: "56px" },
21018
+ children: [
21019
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-3", children: [
21020
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
21021
+ "img",
21022
+ {
21023
+ src: (_a2 = networks.find((n2) => n2.id === selectedNetwork)) == null ? void 0 : _a2.icon,
21024
+ alt: (_b = networks.find((n2) => n2.id === selectedNetwork)) == null ? void 0 : _b.name,
21025
+ className: "w-6 h-6"
21026
+ }
21027
+ ),
21028
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-base font-normal", children: (_c = networks.find((n2) => n2.id === selectedNetwork)) == null ? void 0 : _c.name })
21029
+ ] }),
21030
+ /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: `w-5 h-5 ml-2 transition-transform ${dropdownOpen ? "rotate-180" : ""}`, fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })
21031
+ ]
21032
+ }
21033
+ ),
21034
+ dropdownOpen && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute left-0 mt-2 w-full bg-white rounded-2xl shadow-lg border border-gray-100 z-20", style: { minWidth: "100%" }, children: networks.filter((network) => supportedNetworks.length === 0 || supportedNetworks.includes(network.id)).map((network) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
21035
+ "button",
21036
+ {
21037
+ type: "button",
21038
+ className: `w-full flex items-center gap-3 px-5 py-3 text-gray-900 text-base font-normal rounded-2xl transition hover:bg-gray-100 ${selectedNetwork === network.id ? "bg-gray-50" : ""}`,
21039
+ onClick: () => {
21040
+ setDropdownOpen(false);
21041
+ handleNetworkChange(network.id);
21042
+ },
21043
+ style: { minHeight: "48px" },
21044
+ children: [
21045
+ /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: network.icon, alt: network.name, className: "w-6 h-6" }),
21046
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: network.name })
21047
+ ]
21048
+ },
21049
+ network.id
21050
+ )) })
21051
+ ] })
20899
21052
  ] }),
20900
21053
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
20901
21054
  /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: `block text-sm font-medium mb-3 ${theme2 === "dark" ? "text-white" : "text-gray-700"}`, children: "Select Stablecoin" }),
20902
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-3 mb-4", children: visibleMethods.map((method) => /* @__PURE__ */ jsxRuntimeExports.jsx(
20903
- "button",
20904
- {
20905
- onClick: () => handleSelectPaymentMethod(method),
20906
- className: `p-1 rounded-xl transition-all duration-200 border ${(selected == null ? void 0 : selected.currency) === method.id && (selected == null ? void 0 : selected.network) === selectedNetwork ? theme2 === "dark" ? "bg-blue-900/30 border-[#7042D2] ring-2 ring-[#7042D2] ring-opacity-50" : "bg-blue-50 border-[#7042D2] ring-2 ring-[#7042D2] ring-opacity-50" : theme2 === "dark" ? "bg-gray-700 hover:bg-gray-600 border-gray-600 hover:border-gray-500" : "bg-white hover:bg-[#ECE3FF] border-gray-200 hover:border-gray-300"}`,
20907
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center text-center", children: [
20908
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 py-2 w-10 bg-white rounded-full flex items-center justify-center mb-2 shadow-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: method.logo, alt: method.name, className: "h-6 w-6" }) }),
20909
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-x-2 items-center", children: [
20910
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: `font-medium text-sm ${theme2 === "dark" ? "text-white" : "text-gray-900"}`, children: method.name }),
20911
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs ${theme2 === "dark" ? "text-gray-300" : "text-gray-500"}`, children: method.description })
20912
- ] }),
20913
- (selected == null ? void 0 : selected.currency) === method.id && (selected == null ? void 0 : selected.network) === selectedNetwork && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
20914
- "svg",
20915
- {
20916
- xmlns: "http://www.w3.org/2000/svg",
20917
- className: "h-4 w-4 text-[#7042D2]",
20918
- viewBox: "0 0 20 20",
20919
- fill: "currentColor",
20920
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
20921
- "path",
20922
- {
20923
- fillRule: "evenodd",
20924
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
20925
- clipRule: "evenodd"
20926
- }
20927
- )
20928
- }
20929
- ) })
20930
- ] })
20931
- },
20932
- `${method.id}-${method.network}`
20933
- )) }),
21055
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-3 mb-4", children: visibleMethods.map((method) => {
21056
+ const isSelected = (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.currency) === method.id && (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.network) === selectedNetwork;
21057
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
21058
+ "button",
21059
+ {
21060
+ onClick: () => handleSelectPaymentMethod(method),
21061
+ className: `group flex items-center justify-between w-full px-5 py-4 rounded-2xl border text-left transition-all duration-200 font-medium text-base
21062
+ ${isSelected ? "bg-[#E9DDFC] border-transparent shadow-none" : "bg-white border-gray-200 hover:bg-[#F6F2FF] hover:border-[#E9DDFC]"}
21063
+ `,
21064
+ style: { minHeight: "56px" },
21065
+ children: [
21066
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-3", children: [
21067
+ /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: method.logo, alt: method.name, className: "h-6 w-6" }),
21068
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-medium text-base text-gray-900", children: [
21069
+ method.description,
21070
+ " (",
21071
+ method.name,
21072
+ ")"
21073
+ ] })
21074
+ ] }),
21075
+ isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 flex items-center justify-center w-6 h-6 rounded-full bg-[#7042D2]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M4 8.5L7 11.5L12 6.5", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })
21076
+ ]
21077
+ },
21078
+ `${method.id}-${method.network}`
21079
+ );
21080
+ }) }),
20934
21081
  availableMethods.length > 4 && /* @__PURE__ */ jsxRuntimeExports.jsx(
20935
21082
  "button",
20936
21083
  {
@@ -20940,13 +21087,23 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
20940
21087
  }
20941
21088
  )
20942
21089
  ] }),
20943
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `p-3 rounded-lg text-sm ${theme2 === "dark" ? "bg-gray-800 text-gray-300" : "bg-gray-50 text-gray-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
21090
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `p-3 rounded-lg text-sm mb-6 ${theme2 === "dark" ? "bg-gray-800 text-gray-300" : "bg-gray-50 text-gray-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
20944
21091
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-2 h-2 rounded-full mr-2 ${availableWallets[getRequiredWallet(selectedNetwork)] ? "bg-green-500" : "bg-red-500"}` }),
20945
21092
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs", children: getNetworkRequirement(selectedNetwork) })
20946
- ] }) })
21093
+ ] }) }),
21094
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
21095
+ "button",
21096
+ {
21097
+ onClick: handleProceed,
21098
+ disabled: !selectedPaymentMethod,
21099
+ className: `w-full py-3 px-4 font-medium rounded-2xl text-lg shadow-md transition-colors ${selectedPaymentMethod ? "bg-[#7042D2] text-white hover:bg-[#5b34b1]" : "bg-gray-300 text-gray-500 cursor-not-allowed"}`,
21100
+ style: { borderRadius: "1.5rem" },
21101
+ children: "Proceed"
21102
+ }
21103
+ )
20947
21104
  ] });
20948
21105
  };
20949
- const logo = "data:image/png;base64,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";
21106
+ const logo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAbCAYAAABm409WAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMFSURBVHgBpVZBVtswEJXk7JsjmAM0hF13dWDTHeEEhF13MScgOQHmBIQT1Oy6KXFPACEHIDdouux7WNM/kuxIdvJeXpj3iOSR9P9oRjODFHtIevp6y2P21LsO9MlzLFQ0x3SKtdm2s0rsJ0PGS08XaXg6usFvjL+vuw7uS+BE3sDqLs/cOLJ6+rvrRMf/sFdWQ6F1nhUnqw2uXAmiGLMurObbzEQUJYLqHasGDvZ1xkK/P4Y3kGqCn1uAvKWny5taT3rh7bLuIEpqjdYv1fQ6WY75PDYAK4pDAtIz72OC4N47gHyjpr4z5thp1rhtYSyHUaQoMzclWmVFLw8IzEYpC081YpJAL2XXEcVuT16BW6stKYwd8KQd5PL9gtkbJCPopw547YjsqMupid0GHDpxXcWwRYAFy05U+xVgY+eGK0HyzhkyBfjAAEWd+9pyKS7gmll9lIMCv6XGb+ZqeBGSHo3flRrh+9IQz4+PxA5JB4tnQOFseRW8PibA9f848C0iJ9nTZ3ZB19zsAIm+HH3/B6BvO9YTrMts3v8pDhSVPR1n8OURfP4g2EVN0UiyD4hsKtJkmQjlnqAu80NdExDY1OaAynNoEm8dAceT+9XLxYHS8Upu3L4PdLYkHEyg8IZ/CFty28K5oP3ycQgB6d9tYFEIrpj8tlX0jKf8VpXpbcINKT17HW5bq2LABawCWKHUXgapz6LLEzNGUcwxwZkE866b99mQKm9aBL64zM7CG6E2cfngWBEtkNVDZO8MJeSciTl7bbeT3Fozv7UGtYgDDvCJaN/zwTQiEyv5yVvh12faqMknQWx96veSRrEzIN2G9S84PAHw2JLRwpG6/JCXVXzsPibhXmJJGh1N9ENwBBuucTGKjU5LV2WrkQ1C+3RiSHSJkq9HHKdmR8vM02RgLsXz3sBksoo84rKwROUmN5TXPoUp+blrOOtOY4GtOhEt4TYpzY2qcszE6dmysIkYxKXCMvv2+7eFXFxIPAT6usvtSNS9CUw/pju/Uzkrba+uAr9F/gPbu3s2LSnvkAAAAABJRU5ErkJggg==";
20950
21107
  const CoinleyModal = ({
20951
21108
  isOpen,
20952
21109
  onClose,
@@ -20986,13 +21143,6 @@ const CoinleyModal = ({
20986
21143
  const formatAmount = (amount) => {
20987
21144
  return parseFloat(amount).toFixed(2);
20988
21145
  };
20989
- const formatTransactionHash = (hash2) => {
20990
- if (!hash2)
20991
- return "";
20992
- if (hash2.length <= 14)
20993
- return hash2;
20994
- return `${hash2.slice(0, 8)}...${hash2.slice(-6)}`;
20995
- };
20996
21146
  const getNetworkDisplayName = (network) => {
20997
21147
  const names2 = {
20998
21148
  ethereum: "Ethereum",
@@ -21022,9 +21172,12 @@ const CoinleyModal = ({
21022
21172
  };
21023
21173
  if (!isOpen)
21024
21174
  return null;
21025
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 z-50 overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-modal relative p-6 w-full max-w-md mx-auto rounded-lg shadow-xl bg-gray-100", children: [
21026
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-header flex justify-between items-center mb-6 p-2 rounded-xl bg-white", children: [
21027
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, className: "w-24", alt: "Coinley Logo" }) }) }),
21175
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 z-50 overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-modal relative p-6 w-full max-w-[490px] mx-auto rounded-3xl shadow-xl bg-gray-100", children: [
21176
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white flex justify-between items-center mb-6 py-4 px-2 rounded-full", children: [
21177
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex items-center gap-2 px-4", children: [
21178
+ /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, className: "w-auto h-auto", alt: "Coinley Logo" }),
21179
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg font-semibold text-gray-800", children: "Payment Details" })
21180
+ ] }),
21028
21181
  /* @__PURE__ */ jsxRuntimeExports.jsx(
21029
21182
  "button",
21030
21183
  {
@@ -21034,288 +21187,223 @@ const CoinleyModal = ({
21034
21187
  }
21035
21188
  )
21036
21189
  ] }),
21037
- payment && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-payment-info mb-6", children: [
21038
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
21039
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600", children: "Total Amount" }),
21040
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-amount-display text-4xl font-bold text-[#7042D2] mt-2", children: [
21041
- "$",
21042
- formatAmount(payment.totalAmount || payment.amount)
21043
- ] })
21190
+ payment && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
21191
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600", children: "Total amount" }),
21192
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-amount-display text-5xl font-bold text-[#7042D2] mt-2", children: [
21193
+ "$",
21194
+ formatAmount(payment.totalAmount || payment.amount)
21044
21195
  ] }),
21045
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
21046
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600 mt-2", children: "Payment To:" }),
21047
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "coinley-merchant-name text-lg mt-2", children: merchantName })
21048
- ] }),
21049
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-center gap-4 text-sm", children: [
21050
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-3 py-2 rounded-lg", children: [
21051
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 text-xs", children: "Original Amount" }),
21052
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-semibold", children: [
21053
- "$",
21054
- formatAmount(payment.amount)
21055
- ] })
21056
- ] }),
21057
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-3 py-2 rounded-lg", children: [
21058
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 text-xs", children: "Fee (1.75%)" }),
21059
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-semibold", children: [
21060
- "$",
21061
- formatAmount((payment.totalAmount || payment.amount) - payment.amount)
21196
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600 mt-4", children: "Payment to:" }),
21197
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "coinley-merchant-name text-base font-semibold mt-1", children: merchantName })
21198
+ ] }) }),
21199
+ step === "select-currency" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
21200
+ PaymentMethods,
21201
+ {
21202
+ onSelect: onPaymentMethodSelect,
21203
+ selected: selectedPaymentMethod,
21204
+ theme: theme2,
21205
+ supportedNetworks
21206
+ }
21207
+ ) }),
21208
+ step === "confirm" && selectedPaymentMethod && payment && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21209
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 rounded-lg mb-4 bg-gray-100", children: [
21210
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium mb-2 text-gray-800", children: "Payment Details" }),
21211
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
21212
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
21213
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Currency:" }),
21214
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: selectedPaymentMethod.currency })
21215
+ ] }),
21216
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
21217
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Network:" }),
21218
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: getNetworkDisplayName(selectedPaymentMethod.network) })
21219
+ ] }),
21220
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
21221
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Fee:" }),
21222
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: "1.75%" })
21062
21223
  ] })
21063
21224
  ] })
21064
- ] })
21065
- ] }),
21066
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-6", children: [
21067
- step === "select-currency" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21225
+ ] }),
21226
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex border-b border-gray-200", children: [
21068
21227
  /* @__PURE__ */ jsxRuntimeExports.jsx(
21069
- PaymentMethods,
21228
+ "button",
21070
21229
  {
21071
- onSelect: onPaymentMethodSelect,
21072
- selected: selectedPaymentMethod,
21073
- theme: theme2,
21074
- supportedNetworks
21230
+ onClick: () => setPaymentType("wallet"),
21231
+ className: `py-2 px-4 text-sm font-medium ${paymentType === "wallet" ? "border-b-2 border-purple-600 text-purple-600" : "text-gray-500 hover:text-gray-700"}`,
21232
+ children: "Connect Wallet"
21075
21233
  }
21076
21234
  ),
21077
- selectedPaymentMethod && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
21235
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
21078
21236
  "button",
21079
21237
  {
21080
- onClick: () => {
21081
- console.log("Proceed button clicked, calling onPaymentMethodSelect");
21082
- onPaymentMethodSelect(selectedPaymentMethod);
21083
- },
21084
- className: "coinley-button-primary w-full py-3 px-4 font-medium rounded-lg transition-colors",
21085
- disabled: !selectedPaymentMethod,
21086
- children: [
21087
- "Proceed with ",
21088
- selectedPaymentMethod.currency,
21089
- " on ",
21090
- getNetworkDisplayName(selectedPaymentMethod.network)
21091
- ]
21238
+ onClick: () => setPaymentType("qrcode"),
21239
+ className: `py-2 px-4 text-sm font-medium ${paymentType === "qrcode" ? "border-b-2 border-purple-600 text-purple-600" : "text-gray-500 hover:text-gray-700"}`,
21240
+ children: "QR Code"
21092
21241
  }
21093
- ) })
21094
- ] }),
21095
- step === "confirm" && selectedPaymentMethod && payment && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21096
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 rounded-lg mb-4 bg-gray-100", children: [
21097
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium mb-2 text-gray-800", children: "Payment Details" }),
21098
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
21099
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
21100
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Currency:" }),
21101
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: selectedPaymentMethod.currency })
21102
- ] }),
21103
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
21104
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Network:" }),
21105
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: getNetworkDisplayName(selectedPaymentMethod.network) })
21106
- ] }),
21107
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
21108
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Fee:" }),
21109
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: "1.75%" })
21110
- ] })
21242
+ )
21243
+ ] }) }),
21244
+ testMode ? (
21245
+ // Test mode payment option
21246
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 rounded-lg mb-4 bg-blue-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
21247
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-purple-600 rounded-full p-2 mr-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) }),
21248
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21249
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "Test Mode Payment" }),
21250
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: 'Click "Pay Now" to simulate a successful payment' })
21111
21251
  ] })
21112
- ] }),
21113
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex border-b border-gray-200", children: [
21114
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21115
- "button",
21116
- {
21117
- onClick: () => setPaymentType("wallet"),
21118
- className: `py-2 px-4 text-sm font-medium ${paymentType === "wallet" ? "border-b-2 border-purple-600 text-purple-600" : "text-gray-500 hover:text-gray-700"}`,
21119
- children: "Connect Wallet"
21120
- }
21121
- ),
21122
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21123
- "button",
21124
- {
21125
- onClick: () => setPaymentType("qrcode"),
21126
- className: `py-2 px-4 text-sm font-medium ${paymentType === "qrcode" ? "border-b-2 border-purple-600 text-purple-600" : "text-gray-500 hover:text-gray-700"}`,
21127
- children: "QR Code"
21128
- }
21129
- )
21130
- ] }) }),
21131
- testMode ? (
21132
- // Test mode payment option
21133
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 rounded-lg mb-4 bg-blue-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
21134
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-purple-600 rounded-full p-2 mr-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) }),
21252
+ ] }) })
21253
+ ) : paymentType === "qrcode" ? (
21254
+ // QR Code payment option
21255
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
21256
+ QRCode,
21257
+ {
21258
+ walletAddress: getWalletAddressForNetwork(),
21259
+ amount: payment.totalAmount || payment.amount,
21260
+ currency: selectedPaymentMethod.currency,
21261
+ network: selectedPaymentMethod.network,
21262
+ theme: theme2
21263
+ }
21264
+ ) })
21265
+ ) : (
21266
+ // Wallet connection option
21267
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3 mb-4", children: [
21268
+ supportedWallets.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 rounded-lg bg-yellow-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
21269
+ /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-yellow-500 mr-2", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
21135
21270
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21136
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "Test Mode Payment" }),
21137
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: 'Click "Pay Now" to simulate a successful payment' })
21271
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "No Compatible Wallets" }),
21272
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
21273
+ "No wallets detected for ",
21274
+ getNetworkDisplayName(selectedPaymentMethod.network),
21275
+ " network"
21276
+ ] })
21138
21277
  ] })
21139
- ] }) })
21140
- ) : paymentType === "qrcode" ? (
21141
- // QR Code payment option
21142
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
21143
- QRCode,
21144
- {
21145
- walletAddress: getWalletAddressForNetwork(),
21146
- amount: payment.totalAmount || payment.amount,
21147
- currency: selectedPaymentMethod.currency,
21148
- network: selectedPaymentMethod.network,
21149
- theme: theme2
21150
- }
21151
- ) })
21152
- ) : (
21153
- // Wallet connection option
21154
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3 mb-4", children: [
21155
- supportedWallets.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 rounded-lg bg-yellow-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
21156
- /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 text-yellow-500 mr-2", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
21278
+ ] }) }) : supportedWallets.map((walletType) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 rounded-lg bg-blue-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
21279
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
21280
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
21281
+ "img",
21282
+ {
21283
+ src: getWalletIcon(walletType),
21284
+ alt: getWalletDisplayName(walletType),
21285
+ className: "w-8 h-8 mr-3",
21286
+ onError: (e) => {
21287
+ e.target.style.display = "none";
21288
+ }
21289
+ }
21290
+ ),
21157
21291
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21158
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "No Compatible Wallets" }),
21292
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: getWalletDisplayName(walletType) }),
21159
21293
  /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
21160
- "No wallets detected for ",
21161
- getNetworkDisplayName(selectedPaymentMethod.network),
21162
- " network"
21294
+ "Pay with ",
21295
+ getWalletDisplayName(walletType)
21163
21296
  ] })
21164
21297
  ] })
21165
- ] }) }) : supportedWallets.map((walletType) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 rounded-lg bg-blue-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
21166
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
21167
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21168
- "img",
21169
- {
21170
- src: getWalletIcon(walletType),
21171
- alt: getWalletDisplayName(walletType),
21172
- className: "w-8 h-8 mr-3",
21173
- onError: (e) => {
21174
- e.target.style.display = "none";
21175
- }
21176
- }
21177
- ),
21178
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21179
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: getWalletDisplayName(walletType) }),
21180
- /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
21181
- "Pay with ",
21182
- getWalletDisplayName(walletType)
21183
- ] })
21184
- ] })
21185
- ] }),
21186
- (walletConnection == null ? void 0 : walletConnection.walletType) === walletType ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
21187
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" }),
21188
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-green-600", children: "Connected" })
21189
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
21190
- "button",
21191
- {
21192
- onClick: () => {
21193
- console.log("Connect wallet button clicked for:", walletType);
21194
- onConnectWallet(walletType);
21195
- },
21196
- className: "coinley-button-primary py-2 px-4 font-medium rounded-md text-sm",
21197
- children: "Connect"
21198
- }
21199
- )
21200
- ] }) }, walletType)),
21201
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: Object.entries(availableWallets).filter(([walletType, isAvailable]) => !isAvailable).map(([walletType]) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 rounded-lg bg-gray-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
21202
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
21203
- getWalletDisplayName(walletType),
21204
- " not detected"
21205
- ] }),
21206
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21207
- "a",
21208
- {
21209
- href: getWalletInstallUrl(walletType),
21210
- target: "_blank",
21211
- rel: "noopener noreferrer",
21212
- className: "text-sm text-purple-600 hover:underline",
21213
- children: "Install"
21214
- }
21215
- )
21216
- ] }) }, walletType)) })
21217
- ] })
21218
- ),
21219
- error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 rounded-lg bg-red-50 mb-4 text-red-600 text-sm", children: error }),
21220
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
21221
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21222
- "button",
21223
- {
21224
- type: "button",
21225
- onClick: onBack,
21226
- className: "w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-purple-600 font-medium rounded-md",
21227
- children: "Back"
21228
- }
21229
- ),
21230
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21231
- "button",
21232
- {
21233
- type: "button",
21234
- onClick: () => onPayment(paymentType === "qrcode"),
21235
- className: "coinley-button-primary w-full py-2 px-4 font-medium rounded-md",
21236
- disabled: !testMode && paymentType === "wallet" && !walletConnection,
21237
- children: paymentType === "qrcode" ? "I have sent the payment" : "Pay Now"
21238
- }
21239
- )
21298
+ ] }),
21299
+ (walletConnection == null ? void 0 : walletConnection.walletType) === walletType ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
21300
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" }),
21301
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-green-600", children: "Connected" })
21302
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
21303
+ "button",
21304
+ {
21305
+ onClick: () => {
21306
+ console.log("Connect wallet button clicked for:", walletType);
21307
+ onConnectWallet(walletType);
21308
+ },
21309
+ className: "coinley-button-primary py-2 px-4 font-medium rounded-md text-sm",
21310
+ children: "Connect"
21311
+ }
21312
+ )
21313
+ ] }) }, walletType)),
21314
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2", children: Object.entries(availableWallets).filter(([walletType, isAvailable]) => !isAvailable).map(([walletType]) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 rounded-lg bg-gray-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
21315
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
21316
+ getWalletDisplayName(walletType),
21317
+ " not detected"
21318
+ ] }),
21319
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
21320
+ "a",
21321
+ {
21322
+ href: getWalletInstallUrl(walletType),
21323
+ target: "_blank",
21324
+ rel: "noopener noreferrer",
21325
+ className: "text-sm text-purple-600 hover:underline",
21326
+ children: "Install"
21327
+ }
21328
+ )
21329
+ ] }) }, walletType)) })
21240
21330
  ] })
21241
- ] }),
21242
- step === "processing" && /* @__PURE__ */ jsxRuntimeExports.jsx(
21243
- PaymentStatus,
21244
- {
21245
- status: "processing",
21246
- theme: theme2,
21247
- message: "Processing your payment..."
21248
- }
21249
21331
  ),
21250
- step === "success" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21251
- /* @__PURE__ */ jsxRuntimeExports.jsx(
21252
- PaymentStatus,
21253
- {
21254
- status: "success",
21255
- theme: theme2,
21256
- message: "Payment successful!"
21257
- }
21258
- ),
21259
- transactionHash && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 p-3 rounded-lg bg-gray-100", children: [
21260
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-600 mb-1", children: "Transaction Hash:" }),
21261
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-mono break-all text-gray-800", children: formatTransactionHash(transactionHash) }),
21262
- selectedPaymentMethod && /* @__PURE__ */ jsxRuntimeExports.jsx(
21263
- "a",
21264
- {
21265
- href: `${getExplorerUrl(selectedPaymentMethod.network)}/${getExplorerPath(selectedPaymentMethod.network)}/${transactionHash}`,
21266
- target: "_blank",
21267
- rel: "noopener noreferrer",
21268
- className: "text-xs text-purple-600 mt-2 inline-block",
21269
- children: "View on Explorer →"
21270
- }
21271
- )
21272
- ] })
21273
- ] }),
21274
- step === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21332
+ error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 rounded-lg bg-red-50 mb-4 text-red-600 text-sm", children: error }),
21333
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
21275
21334
  /* @__PURE__ */ jsxRuntimeExports.jsx(
21276
- PaymentStatus,
21335
+ "button",
21277
21336
  {
21278
- status: "error",
21279
- theme: theme2,
21280
- message: error || "An error occurred while processing your payment."
21337
+ type: "button",
21338
+ onClick: onBack,
21339
+ className: "w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-purple-600 font-medium rounded-md",
21340
+ children: "Back"
21281
21341
  }
21282
21342
  ),
21283
21343
  /* @__PURE__ */ jsxRuntimeExports.jsx(
21284
21344
  "button",
21285
21345
  {
21286
21346
  type: "button",
21287
- onClick: onBack,
21288
- className: "mt-4 w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium rounded-md",
21289
- children: "Try Again"
21347
+ onClick: () => onPayment(paymentType === "qrcode"),
21348
+ className: "coinley-button-primary w-full py-2 px-4 font-medium rounded-md",
21349
+ disabled: !testMode && paymentType === "wallet" && !walletConnection,
21350
+ children: paymentType === "qrcode" ? "I have sent the payment" : "Pay Now"
21290
21351
  }
21291
21352
  )
21292
21353
  ] })
21293
21354
  ] }),
21294
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center text-xs text-gray-500", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
21295
- "Powered by ",
21296
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600", children: "Coinley" }),
21297
- " - Secure Cryptocurrency Payments"
21298
- ] }) })
21355
+ step === "processing" && /* @__PURE__ */ jsxRuntimeExports.jsx(
21356
+ PaymentStatus,
21357
+ {
21358
+ status: "processing",
21359
+ theme: theme2,
21360
+ message: "Processing your payment..."
21361
+ }
21362
+ ),
21363
+ step === "success" && /* @__PURE__ */ jsxRuntimeExports.jsx(
21364
+ PaymentStatus,
21365
+ {
21366
+ status: "success",
21367
+ theme: theme2,
21368
+ message: "Payment successful!",
21369
+ payment,
21370
+ transactionHash,
21371
+ selectedPaymentMethod,
21372
+ merchantName
21373
+ }
21374
+ ),
21375
+ step === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
21376
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
21377
+ PaymentStatus,
21378
+ {
21379
+ status: "error",
21380
+ theme: theme2,
21381
+ message: error || "An error occurred while processing your payment."
21382
+ }
21383
+ ),
21384
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
21385
+ "button",
21386
+ {
21387
+ type: "button",
21388
+ onClick: onBack,
21389
+ className: "mt-4 w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium rounded-md",
21390
+ children: "Try Again"
21391
+ }
21392
+ )
21393
+ ] }),
21394
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center text-xs text-gray-500 flex items-center justify-center gap-1 mt-6", children: [
21395
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
21396
+ "Powered by ",
21397
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600", children: "Coinley" }),
21398
+ " - Secure Cryptocurrency Payments"
21399
+ ] }),
21400
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: "inline w-4 h-4 text-green-500 ml-1", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: [
21401
+ /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2", fill: "none" }),
21402
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M9 12l2 2 4-4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
21403
+ ] })
21404
+ ] })
21299
21405
  ] }) }) });
21300
21406
  };
21301
- const getExplorerUrl = (network) => {
21302
- const explorers = {
21303
- ethereum: "https://etherscan.io",
21304
- bsc: "https://bscscan.com",
21305
- tron: "https://tronscan.org",
21306
- algorand: "https://algoexplorer.io"
21307
- };
21308
- return explorers[network] || "https://etherscan.io";
21309
- };
21310
- const getExplorerPath = (network) => {
21311
- const paths = {
21312
- ethereum: "tx",
21313
- bsc: "tx",
21314
- tron: "transaction",
21315
- algorand: "tx"
21316
- };
21317
- return paths[network] || "tx";
21318
- };
21319
21407
  const CoinleyCheckout = forwardRef(({
21320
21408
  apiKey,
21321
21409
  apiSecret,