coinley-checkout 0.7.0 → 0.7.2
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.
@@ -21118,13 +21118,12 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
21118
21118
|
"button",
|
21119
21119
|
{
|
21120
21120
|
onClick: () => handleSelectPaymentMethod(method),
|
21121
|
-
className: `group flex items-center
|
21122
|
-
|
21123
|
-
|
21124
|
-
style: { minHeight: "56px", padding: "0.5rem" },
|
21121
|
+
className: `group relative flex items-center w-full px-2.5 py-3 rounded-xl border transition-all duration-200
|
21122
|
+
${isSelected ? "bg-[#E9DDFC]" : "bg-white border-gray-200 hover:bg-gray-50 hover:border-gray-300"}
|
21123
|
+
`,
|
21125
21124
|
children: [
|
21126
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("
|
21127
|
-
typeof method.logo === "function" ? /* @__PURE__ */ jsxRuntimeExports.jsx(method.logo, { size: 24 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: method.logo, alt: method.name, className: "h-
|
21125
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
|
21126
|
+
typeof method.logo === "function" ? /* @__PURE__ */ jsxRuntimeExports.jsx(method.logo, { size: 24 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: method.logo, alt: method.name, className: "h-6 w-6 object-contain" }),
|
21128
21127
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-medium text-sm text-gray-900", children: [
|
21129
21128
|
method.description,
|
21130
21129
|
" (",
|
@@ -21132,20 +21131,12 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
21132
21131
|
")"
|
21133
21132
|
] })
|
21134
21133
|
] }),
|
21135
|
-
isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "
|
21134
|
+
isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex items-center justify-center w-5 h-5 rounded-full bg-[#7042D2] ml-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "12", height: "12", 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" }) }) })
|
21136
21135
|
]
|
21137
21136
|
},
|
21138
21137
|
`${method.id}-${method.network}`
|
21139
21138
|
);
|
21140
|
-
}) })
|
21141
|
-
availableMethods.length > 4 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21142
|
-
"button",
|
21143
|
-
{
|
21144
|
-
onClick: () => setShowMore(!showMore),
|
21145
|
-
className: `w-full py-2 px-4 rounded-lg text-sm font-medium transition-colors ${theme2 === "dark" ? "bg-gray-700 text-gray-300 hover:bg-gray-600" : "bg-gray-100 text-gray-600 hover:bg-gray-200"}`,
|
21146
|
-
children: showMore ? "Show Less" : `Show More (${availableMethods.length - 4} more)`
|
21147
|
-
}
|
21148
|
-
)
|
21139
|
+
}) })
|
21149
21140
|
] }),
|
21150
21141
|
/* @__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: [
|
21151
21142
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-2 h-2 rounded-full mr-2 ${availableWallets[getRequiredWallet(selectedNetwork)] ? "bg-green-500" : "bg-red-500"}` }),
|
@@ -21242,248 +21233,261 @@ const CoinleyModal = ({
|
|
21242
21233
|
};
|
21243
21234
|
if (!isOpen)
|
21244
21235
|
return null;
|
21245
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
21246
|
-
|
21247
|
-
|
21248
|
-
|
21249
|
-
|
21250
|
-
|
21251
|
-
|
21252
|
-
|
21253
|
-
|
21254
|
-
|
21255
|
-
|
21256
|
-
|
21257
|
-
|
21258
|
-
|
21259
|
-
|
21260
|
-
|
21261
|
-
|
21262
|
-
|
21263
|
-
|
21264
|
-
|
21265
|
-
|
21266
|
-
|
21267
|
-
"
|
21268
|
-
formatAmount(payment.totalAmount || payment.amount)
|
21269
|
-
] }),
|
21270
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600 mt-4", children: "Payment to:" }),
|
21271
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "coinley-merchant-name text-base font-semibold mt-1", children: merchantName })
|
21272
|
-
] }) }),
|
21273
|
-
step === "select-currency" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pb-6 pt-6 px-6 bg-white rounded-t-2xl blockchain-network", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21274
|
-
PaymentMethods,
|
21275
|
-
{
|
21276
|
-
onSelect: onPaymentMethodSelect,
|
21277
|
-
selected: selectedPaymentMethod,
|
21278
|
-
theme: theme2,
|
21279
|
-
supportedNetworks
|
21280
|
-
}
|
21281
|
-
) }),
|
21282
|
-
step === "confirm" && selectedPaymentMethod && payment && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21283
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 rounded-lg mb-4 bg-gray-100", children: [
|
21284
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium mb-2 text-gray-800", children: "Payment Details" }),
|
21285
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
21286
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
21287
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Currency:" }),
|
21288
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: selectedPaymentMethod.currency })
|
21289
|
-
] }),
|
21290
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
21291
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Network:" }),
|
21292
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: getNetworkDisplayName(selectedPaymentMethod.network) })
|
21293
|
-
] }),
|
21294
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
21295
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Fee:" }),
|
21296
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: "1.75%" })
|
21297
|
-
] })
|
21298
|
-
] })
|
21299
|
-
] }),
|
21300
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex border-b border-gray-200", children: [
|
21301
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21302
|
-
"button",
|
21303
|
-
{
|
21304
|
-
onClick: () => setPaymentType("wallet"),
|
21305
|
-
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"}`,
|
21306
|
-
children: "Connect Wallet"
|
21307
|
-
}
|
21308
|
-
),
|
21309
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21236
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed inset-0 z-50 overflow-y-auto", children: [
|
21237
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21238
|
+
"div",
|
21239
|
+
{
|
21240
|
+
className: "fixed inset-0 bg-black bg-opacity-50 backdrop-blur-sm transition-opacity",
|
21241
|
+
onClick: onClose
|
21242
|
+
}
|
21243
|
+
),
|
21244
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex min-h-screen items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21245
|
+
"div",
|
21246
|
+
{
|
21247
|
+
className: "coinley-modal relative w-full shadow-xl bg-gray-100 rounded-3xl",
|
21248
|
+
style: {
|
21249
|
+
maxWidth: "534px",
|
21250
|
+
aspectRatio: "534 / 800"
|
21251
|
+
},
|
21252
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "py-6 px-4", children: [
|
21253
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white flex justify-between items-center mb-6 mr-3 ml-3 py-4 px-2 rounded-full", children: [
|
21254
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex items-center gap-2 px-4", children: [
|
21255
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, className: "w-auto h-auto", alt: "Coinley Logo" }),
|
21256
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg font-semibold text-gray-800", children: "Payment Details" })
|
21257
|
+
] }),
|
21258
|
+
step !== "success" && step !== "processing" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21310
21259
|
"button",
|
21311
21260
|
{
|
21312
|
-
onClick:
|
21313
|
-
className:
|
21314
|
-
children: "
|
21261
|
+
onClick: onClose,
|
21262
|
+
className: "text-gray-500 hover:text-gray-700 focus:outline-none",
|
21263
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6 mr-2", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
21315
21264
|
}
|
21316
21265
|
)
|
21266
|
+
] }),
|
21267
|
+
payment && step !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
|
21268
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600", children: "Total amount" }),
|
21269
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-[50px] md:text-[60px] lg:text-[70px] font-bold leading-[100%] tracking-[0] text-center text-[#7042D2] mt-2", children: [
|
21270
|
+
"$",
|
21271
|
+
formatAmount(payment.totalAmount || payment.amount)
|
21272
|
+
] }),
|
21273
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600 mt-4", children: "Payment to:" }),
|
21274
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-merchant-name text-base font-semibold mt-1 flex items-center justify-center gap-2", children: [
|
21275
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "16", height: "14", viewBox: "0 0 16 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M13.3 4.50065L13.8 7.00065H2.2L2.7 4.50065H13.3ZM14.6667 0.333984H1.33333V2.00065H14.6667V0.333984ZM14.6667 2.83398H1.33333L0.5 7.00065V8.66732H1.33333V13.6673H9.66667V8.66732H13V13.6673H14.6667V8.66732H15.5V7.00065L14.6667 2.83398ZM3 12.0007V8.66732H8V12.0007H3Z", fill: "#7042D2" }) }),
|
21276
|
+
merchantName
|
21277
|
+
] })
|
21317
21278
|
] }) }),
|
21318
|
-
|
21319
|
-
|
21320
|
-
|
21321
|
-
/* @__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" }) }) }),
|
21322
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21323
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "Test Mode Payment" }),
|
21324
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: 'Click "Pay Now" to simulate a successful payment' })
|
21325
|
-
] })
|
21326
|
-
] }) })
|
21327
|
-
) : paymentType === "qrcode" ? (
|
21328
|
-
// QR Code payment option
|
21329
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21330
|
-
QRCode,
|
21279
|
+
step === "select-currency" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
21280
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white rounded-t-[24px] pb-6 px-6 pt-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21281
|
+
PaymentMethods,
|
21331
21282
|
{
|
21332
|
-
|
21333
|
-
|
21334
|
-
|
21335
|
-
|
21336
|
-
theme: theme2
|
21283
|
+
onSelect: onPaymentMethodSelect,
|
21284
|
+
selected: selectedPaymentMethod,
|
21285
|
+
theme: theme2,
|
21286
|
+
supportedNetworks
|
21337
21287
|
}
|
21338
|
-
) })
|
21339
|
-
|
21340
|
-
|
21341
|
-
|
21342
|
-
|
21343
|
-
|
21288
|
+
) }),
|
21289
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-white px-6 pb-6 rounded-b-2xl", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-gray-500", children: [
|
21290
|
+
"Powered by ",
|
21291
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[#7042D2] font-medium", children: "Coinley" }),
|
21292
|
+
" - Secure Cryptocurrency Payments",
|
21293
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "inline-block ml-1 w-4 h-4", width: "11", height: "11", viewBox: "0 0 11 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0.82975 1.7534C0.625 2.04482 0.625 2.91148 0.625 4.64319V5.49578C0.625 8.54969 2.92113 10.0322 4.36196 10.6611C4.7525 10.8317 4.94804 10.9173 5.5 10.9173C6.0525 10.9173 6.2475 10.8317 6.63804 10.6611C8.07888 10.0317 10.375 8.55023 10.375 5.49578V4.64319C10.375 2.91094 10.375 2.04482 10.1702 1.7534C9.96604 1.46253 9.15192 1.18357 7.52313 0.626193L7.21275 0.520026C6.36396 0.229151 5.93983 0.0839844 5.5 0.0839844C5.06017 0.0839844 4.63604 0.229151 3.78725 0.520026L3.47688 0.625651C1.84808 1.18357 1.03396 1.46253 0.82975 1.7534ZM7.1575 4.68815C7.19303 4.64832 7.22037 4.60187 7.23795 4.55148C7.25553 4.50108 7.26302 4.44771 7.25997 4.39442C7.25693 4.34113 7.24342 4.28896 7.22021 4.24089C7.19701 4.19282 7.16456 4.14979 7.12473 4.11426C7.0849 4.07872 7.03845 4.05139 6.98805 4.03381C6.93765 4.01622 6.88429 4.00874 6.83099 4.01178C6.7777 4.01483 6.72553 4.02834 6.67746 4.05154C6.62939 4.07475 6.58636 4.10719 6.55083 4.14703L4.91988 5.97461L4.44863 5.44703C4.3766 5.36744 4.27601 5.31959 4.16883 5.31393C4.06164 5.30828 3.95657 5.34526 3.87657 5.41682C3.79657 5.48838 3.74814 5.58869 3.74185 5.69584C3.73557 5.80299 3.77195 5.90828 3.84304 5.98869L4.61654 6.85536C4.65465 6.89805 4.70135 6.93221 4.75357 6.95559C4.8058 6.97898 4.86238 6.99107 4.9196 6.99107C4.97683 6.99107 5.03341 6.97898 5.08563 6.95559C5.13786 6.93221 5.18456 6.89805 5.22267 6.85536L7.1575 4.68815Z", fill: "#0D9A22" }) })
|
21294
|
+
] }) }) })
|
21295
|
+
] }),
|
21296
|
+
step === "confirm" && selectedPaymentMethod && payment && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21297
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 rounded-lg mb-4 bg-gray-100", children: [
|
21298
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium mb-2 text-gray-800", children: "Payment Details" }),
|
21299
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
21300
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
21301
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Currency:" }),
|
21302
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: selectedPaymentMethod.currency })
|
21303
|
+
] }),
|
21304
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
21305
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Network:" }),
|
21306
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: getNetworkDisplayName(selectedPaymentMethod.network) })
|
21307
|
+
] }),
|
21308
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
21309
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600 font-semibold", children: "Fee:" }),
|
21310
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: "1.75%" })
|
21311
|
+
] })
|
21312
|
+
] })
|
21313
|
+
] }),
|
21314
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex border-b border-gray-200", children: [
|
21315
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21316
|
+
"button",
|
21317
|
+
{
|
21318
|
+
onClick: () => setPaymentType("wallet"),
|
21319
|
+
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"}`,
|
21320
|
+
children: "Connect Wallet"
|
21321
|
+
}
|
21322
|
+
),
|
21323
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21324
|
+
"button",
|
21325
|
+
{
|
21326
|
+
onClick: () => setPaymentType("qrcode"),
|
21327
|
+
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"}`,
|
21328
|
+
children: "QR Code"
|
21329
|
+
}
|
21330
|
+
)
|
21331
|
+
] }) }),
|
21332
|
+
testMode ? (
|
21333
|
+
// Test mode payment option
|
21334
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 rounded-lg mb-4 bg-blue-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
21335
|
+
/* @__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" }) }) }),
|
21344
21336
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21345
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "
|
21346
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
21347
|
-
"No wallets detected for ",
|
21348
|
-
getNetworkDisplayName(selectedPaymentMethod.network),
|
21349
|
-
" network"
|
21350
|
-
] })
|
21337
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "Test Mode Payment" }),
|
21338
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: 'Click "Pay Now" to simulate a successful payment' })
|
21351
21339
|
] })
|
21352
|
-
] }) })
|
21353
|
-
|
21354
|
-
|
21355
|
-
|
21356
|
-
|
21357
|
-
|
21358
|
-
|
21359
|
-
|
21360
|
-
|
21361
|
-
|
21362
|
-
|
21363
|
-
|
21364
|
-
|
21340
|
+
] }) })
|
21341
|
+
) : paymentType === "qrcode" ? (
|
21342
|
+
// QR Code payment option
|
21343
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21344
|
+
QRCode,
|
21345
|
+
{
|
21346
|
+
walletAddress: getWalletAddressForNetwork(),
|
21347
|
+
amount: payment.totalAmount || payment.amount,
|
21348
|
+
currency: selectedPaymentMethod.currency,
|
21349
|
+
network: selectedPaymentMethod.network,
|
21350
|
+
theme: theme2
|
21351
|
+
}
|
21352
|
+
) })
|
21353
|
+
) : (
|
21354
|
+
// Wallet connection option
|
21355
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3 mb-4", children: [
|
21356
|
+
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: [
|
21357
|
+
/* @__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" }) }),
|
21365
21358
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21366
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children:
|
21359
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "No Compatible Wallets" }),
|
21367
21360
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
|
21368
|
-
"
|
21369
|
-
|
21361
|
+
"No wallets detected for ",
|
21362
|
+
getNetworkDisplayName(selectedPaymentMethod.network),
|
21363
|
+
" network"
|
21370
21364
|
] })
|
21371
21365
|
] })
|
21372
|
-
] }),
|
21373
|
-
|
21374
|
-
|
21375
|
-
|
21376
|
-
|
21377
|
-
|
21378
|
-
|
21379
|
-
|
21380
|
-
|
21381
|
-
|
21382
|
-
|
21383
|
-
|
21384
|
-
|
21385
|
-
|
21386
|
-
|
21387
|
-
|
21388
|
-
|
21389
|
-
|
21390
|
-
|
21391
|
-
|
21392
|
-
|
21393
|
-
|
21394
|
-
|
21395
|
-
|
21396
|
-
|
21397
|
-
|
21398
|
-
|
21399
|
-
|
21400
|
-
|
21401
|
-
|
21402
|
-
|
21403
|
-
|
21366
|
+
] }) }) : 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: [
|
21367
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
21368
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21369
|
+
"img",
|
21370
|
+
{
|
21371
|
+
src: getWalletIcon(walletType),
|
21372
|
+
alt: getWalletDisplayName(walletType),
|
21373
|
+
className: "w-8 h-8 mr-3",
|
21374
|
+
onError: (e) => {
|
21375
|
+
e.target.style.display = "none";
|
21376
|
+
}
|
21377
|
+
}
|
21378
|
+
),
|
21379
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21380
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: getWalletDisplayName(walletType) }),
|
21381
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
|
21382
|
+
"Pay with ",
|
21383
|
+
getWalletDisplayName(walletType)
|
21384
|
+
] })
|
21385
|
+
] })
|
21386
|
+
] }),
|
21387
|
+
(walletConnection == null ? void 0 : walletConnection.walletType) === walletType ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
21388
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" }),
|
21389
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-green-600", children: "Connected" })
|
21390
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21391
|
+
"button",
|
21392
|
+
{
|
21393
|
+
onClick: () => {
|
21394
|
+
console.log("Connect wallet button clicked for:", walletType);
|
21395
|
+
onConnectWallet(walletType);
|
21396
|
+
},
|
21397
|
+
className: "coinley-button-primary py-2 px-4 font-medium rounded-md text-sm",
|
21398
|
+
children: "Connect"
|
21399
|
+
}
|
21400
|
+
)
|
21401
|
+
] }) }, walletType)),
|
21402
|
+
/* @__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: [
|
21403
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
|
21404
|
+
getWalletDisplayName(walletType),
|
21405
|
+
" not detected"
|
21406
|
+
] }),
|
21407
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21408
|
+
"a",
|
21409
|
+
{
|
21410
|
+
href: getWalletInstallUrl(walletType),
|
21411
|
+
target: "_blank",
|
21412
|
+
rel: "noopener noreferrer",
|
21413
|
+
className: "text-sm text-purple-600 hover:underline",
|
21414
|
+
children: "Install"
|
21415
|
+
}
|
21416
|
+
)
|
21417
|
+
] }) }, walletType)) })
|
21418
|
+
] })
|
21419
|
+
),
|
21420
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 rounded-lg bg-red-50 mb-4 text-red-600 text-sm", children: error }),
|
21421
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [
|
21422
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21423
|
+
"button",
|
21424
|
+
{
|
21425
|
+
type: "button",
|
21426
|
+
onClick: onBack,
|
21427
|
+
className: "w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-purple-600 font-medium rounded-md",
|
21428
|
+
children: "Back"
|
21429
|
+
}
|
21430
|
+
),
|
21431
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21432
|
+
"button",
|
21433
|
+
{
|
21434
|
+
type: "button",
|
21435
|
+
onClick: () => onPayment(paymentType === "qrcode"),
|
21436
|
+
className: "coinley-button-primary w-full py-2 px-4 font-medium rounded-md",
|
21437
|
+
disabled: !testMode && paymentType === "wallet" && !walletConnection,
|
21438
|
+
children: paymentType === "qrcode" ? "I have sent the payment" : "Pay Now"
|
21439
|
+
}
|
21440
|
+
)
|
21404
21441
|
] })
|
21442
|
+
] }),
|
21443
|
+
step === "processing" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21444
|
+
PaymentStatus,
|
21445
|
+
{
|
21446
|
+
status: "processing",
|
21447
|
+
theme: theme2,
|
21448
|
+
message: "Processing your payment...",
|
21449
|
+
processingStartTime,
|
21450
|
+
paymentNetwork: paymentNetwork || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.network),
|
21451
|
+
transactionHash
|
21452
|
+
}
|
21405
21453
|
),
|
21406
|
-
|
21407
|
-
|
21454
|
+
step === "success" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21455
|
+
PaymentStatus,
|
21456
|
+
{
|
21457
|
+
status: "success",
|
21458
|
+
theme: theme2,
|
21459
|
+
message: "Payment successful!",
|
21460
|
+
payment,
|
21461
|
+
transactionHash,
|
21462
|
+
selectedPaymentMethod,
|
21463
|
+
merchantName,
|
21464
|
+
onClose: handleSuccessClose,
|
21465
|
+
pendingBackendConfirmation
|
21466
|
+
}
|
21467
|
+
),
|
21468
|
+
step === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21408
21469
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21409
|
-
|
21470
|
+
PaymentStatus,
|
21410
21471
|
{
|
21411
|
-
|
21412
|
-
|
21413
|
-
|
21414
|
-
children: "Back"
|
21472
|
+
status: "error",
|
21473
|
+
theme: theme2,
|
21474
|
+
message: error || "An error occurred while processing your payment."
|
21415
21475
|
}
|
21416
21476
|
),
|
21417
21477
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21418
21478
|
"button",
|
21419
21479
|
{
|
21420
21480
|
type: "button",
|
21421
|
-
onClick:
|
21422
|
-
className: "
|
21423
|
-
|
21424
|
-
children: paymentType === "qrcode" ? "I have sent the payment" : "Pay Now"
|
21481
|
+
onClick: onBack,
|
21482
|
+
className: "mt-4 w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium rounded-md",
|
21483
|
+
children: "Try Again"
|
21425
21484
|
}
|
21426
21485
|
)
|
21427
21486
|
] })
|
21428
|
-
] }),
|
21429
|
-
step === "processing" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21430
|
-
PaymentStatus,
|
21431
|
-
{
|
21432
|
-
status: "processing",
|
21433
|
-
theme: theme2,
|
21434
|
-
message: "Processing your payment...",
|
21435
|
-
processingStartTime,
|
21436
|
-
paymentNetwork: paymentNetwork || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.network),
|
21437
|
-
transactionHash
|
21438
|
-
}
|
21439
|
-
),
|
21440
|
-
step === "success" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21441
|
-
PaymentStatus,
|
21442
|
-
{
|
21443
|
-
status: "success",
|
21444
|
-
theme: theme2,
|
21445
|
-
message: "Payment successful!",
|
21446
|
-
payment,
|
21447
|
-
transactionHash,
|
21448
|
-
selectedPaymentMethod,
|
21449
|
-
merchantName,
|
21450
|
-
onClose: handleSuccessClose,
|
21451
|
-
pendingBackendConfirmation
|
21452
|
-
}
|
21453
|
-
),
|
21454
|
-
step === "error" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21455
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21456
|
-
PaymentStatus,
|
21457
|
-
{
|
21458
|
-
status: "error",
|
21459
|
-
theme: theme2,
|
21460
|
-
message: error || "An error occurred while processing your payment."
|
21461
|
-
}
|
21462
|
-
),
|
21463
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21464
|
-
"button",
|
21465
|
-
{
|
21466
|
-
type: "button",
|
21467
|
-
onClick: onBack,
|
21468
|
-
className: "mt-4 w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium rounded-md",
|
21469
|
-
children: "Try Again"
|
21470
|
-
}
|
21471
|
-
)
|
21472
|
-
] }),
|
21473
|
-
step !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center text-xs text-gray-500 flex items-center justify-center gap-1 py-6 bg-white rounded-b-[12px] ", children: [
|
21474
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
|
21475
|
-
"Powered by ",
|
21476
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-purple-600", children: "Coinley" }),
|
21477
|
-
" - Secure Cryptocurrency Payments"
|
21478
|
-
] }),
|
21479
|
-
/* @__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: [
|
21480
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2", fill: "none" }),
|
21481
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M9 12l2 2 4-4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
21482
|
-
] })
|
21483
21487
|
] })
|
21484
|
-
|
21485
|
-
}
|
21486
|
-
|
21488
|
+
}
|
21489
|
+
) })
|
21490
|
+
] });
|
21487
21491
|
};
|
21488
21492
|
const CoinleyCheckout = forwardRef(({
|
21489
21493
|
apiKey,
|