coinley-checkout 0.7.2 → 0.7.3
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,12 +21118,13 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
21118
21118
|
"button",
|
21119
21119
|
{
|
21120
21120
|
onClick: () => handleSelectPaymentMethod(method),
|
21121
|
-
className: `group
|
21122
|
-
|
21123
|
-
|
21121
|
+
className: `group flex items-center justify-between w-full px-2 py-2 rounded-2xl border text-left transition-all duration-200 font-medium text-base
|
21122
|
+
${isSelected ? "bg-[#E9DDFC] border-transparent shadow-none" : "bg-white border-gray-200 hover:bg-[#F6F2FF] hover:border-[#E9DDFC]"}
|
21123
|
+
`,
|
21124
|
+
style: { minHeight: "56px", padding: "0.5rem" },
|
21124
21125
|
children: [
|
21125
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("
|
21126
|
-
typeof method.logo === "function" ? /* @__PURE__ */ jsxRuntimeExports.jsx(method.logo, { size: 24 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: method.logo, alt: method.name, className: "h-
|
21126
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-x-2", children: [
|
21127
|
+
typeof method.logo === "function" ? /* @__PURE__ */ jsxRuntimeExports.jsx(method.logo, { size: 24 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: method.logo, alt: method.name, className: "h-4 w-4" }),
|
21127
21128
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-medium text-sm text-gray-900", children: [
|
21128
21129
|
method.description,
|
21129
21130
|
" (",
|
@@ -21131,12 +21132,20 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
21131
21132
|
")"
|
21132
21133
|
] })
|
21133
21134
|
] }),
|
21134
|
-
isSelected && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex items-center justify-center w-
|
21135
|
+
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" }) }) })
|
21135
21136
|
]
|
21136
21137
|
},
|
21137
21138
|
`${method.id}-${method.network}`
|
21138
21139
|
);
|
21139
|
-
}) })
|
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
|
+
)
|
21140
21149
|
] }),
|
21141
21150
|
/* @__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: [
|
21142
21151
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-2 h-2 rounded-full mr-2 ${availableWallets[getRequiredWallet(selectedNetwork)] ? "bg-green-500" : "bg-red-500"}` }),
|
@@ -21233,261 +21242,248 @@ const CoinleyModal = ({
|
|
21233
21242
|
};
|
21234
21243
|
if (!isOpen)
|
21235
21244
|
return null;
|
21236
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
21237
|
-
|
21238
|
-
|
21239
|
-
|
21240
|
-
|
21241
|
-
|
21242
|
-
|
21243
|
-
|
21244
|
-
|
21245
|
-
|
21246
|
-
|
21247
|
-
|
21248
|
-
|
21249
|
-
|
21250
|
-
|
21251
|
-
|
21252
|
-
|
21253
|
-
|
21254
|
-
|
21255
|
-
|
21256
|
-
|
21257
|
-
|
21258
|
-
|
21245
|
+
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(
|
21246
|
+
"div",
|
21247
|
+
{
|
21248
|
+
className: "coinley-modal relative py-6 px-2 w-full max-w-md mx-auto shadow-xl bg-gray-100 rounded-3xl",
|
21249
|
+
children: [
|
21250
|
+
/* @__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: [
|
21251
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex items-center gap-2 px-4", children: [
|
21252
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: logo, className: "w-auto h-auto", alt: "Coinley Logo" }),
|
21253
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg font-semibold text-gray-800", children: "Payment Details" })
|
21254
|
+
] }),
|
21255
|
+
step !== "success" && step !== "processing" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21256
|
+
"button",
|
21257
|
+
{
|
21258
|
+
onClick: onClose,
|
21259
|
+
className: "text-gray-500 hover:text-gray-700 focus:outline-none",
|
21260
|
+
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" }) })
|
21261
|
+
}
|
21262
|
+
)
|
21263
|
+
] }),
|
21264
|
+
payment && step !== "success" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
|
21265
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-600", children: "Total amount" }),
|
21266
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "coinley-amount-display text-2xl md:text-4xl lg:text-6xl font-bold text-[#7042D2] mt-2 leading-tight tracking-tight", children: [
|
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(
|
21259
21310
|
"button",
|
21260
21311
|
{
|
21261
|
-
onClick:
|
21262
|
-
className: "text-gray-500 hover:text-gray-700
|
21263
|
-
children:
|
21312
|
+
onClick: () => setPaymentType("qrcode"),
|
21313
|
+
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"}`,
|
21314
|
+
children: "QR Code"
|
21264
21315
|
}
|
21265
21316
|
)
|
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
|
-
] })
|
21278
21317
|
] }) }),
|
21279
|
-
|
21280
|
-
|
21281
|
-
|
21318
|
+
testMode ? (
|
21319
|
+
// Test mode payment option
|
21320
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 rounded-lg mb-4 bg-blue-50", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
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,
|
21282
21331
|
{
|
21283
|
-
|
21284
|
-
|
21285
|
-
|
21286
|
-
|
21332
|
+
walletAddress: getWalletAddressForNetwork(),
|
21333
|
+
amount: payment.totalAmount || payment.amount,
|
21334
|
+
currency: selectedPaymentMethod.currency,
|
21335
|
+
network: selectedPaymentMethod.network,
|
21336
|
+
theme: theme2
|
21287
21337
|
}
|
21288
|
-
) })
|
21289
|
-
|
21290
|
-
|
21291
|
-
|
21292
|
-
" -
|
21293
|
-
|
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" }) }) }),
|
21338
|
+
) })
|
21339
|
+
) : (
|
21340
|
+
// Wallet connection option
|
21341
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3 mb-4", children: [
|
21342
|
+
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: [
|
21343
|
+
/* @__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" }) }),
|
21336
21344
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21337
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "
|
21338
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
21345
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: "No Compatible Wallets" }),
|
21346
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
|
21347
|
+
"No wallets detected for ",
|
21348
|
+
getNetworkDisplayName(selectedPaymentMethod.network),
|
21349
|
+
" network"
|
21350
|
+
] })
|
21339
21351
|
] })
|
21340
|
-
] }) })
|
21341
|
-
|
21342
|
-
|
21343
|
-
|
21344
|
-
|
21345
|
-
|
21346
|
-
|
21347
|
-
|
21348
|
-
|
21349
|
-
|
21350
|
-
|
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" }) }),
|
21352
|
+
] }) }) : 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: [
|
21353
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
21354
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21355
|
+
"img",
|
21356
|
+
{
|
21357
|
+
src: getWalletIcon(walletType),
|
21358
|
+
alt: getWalletDisplayName(walletType),
|
21359
|
+
className: "w-8 h-8 mr-3",
|
21360
|
+
onError: (e) => {
|
21361
|
+
e.target.style.display = "none";
|
21362
|
+
}
|
21363
|
+
}
|
21364
|
+
),
|
21358
21365
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
21359
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children:
|
21366
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-medium text-gray-800", children: getWalletDisplayName(walletType) }),
|
21360
21367
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-600", children: [
|
21361
|
-
"
|
21362
|
-
|
21363
|
-
" network"
|
21368
|
+
"Pay with ",
|
21369
|
+
getWalletDisplayName(walletType)
|
21364
21370
|
] })
|
21365
21371
|
] })
|
21366
|
-
] })
|
21367
|
-
|
21368
|
-
|
21369
|
-
|
21370
|
-
|
21371
|
-
|
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
|
-
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
|
-
)
|
21372
|
+
] }),
|
21373
|
+
(walletConnection == null ? void 0 : walletConnection.walletType) === walletType ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
21374
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" }),
|
21375
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-green-600", children: "Connected" })
|
21376
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
21377
|
+
"button",
|
21378
|
+
{
|
21379
|
+
onClick: () => {
|
21380
|
+
console.log("Connect wallet button clicked for:", walletType);
|
21381
|
+
onConnectWallet(walletType);
|
21382
|
+
},
|
21383
|
+
className: "coinley-button-primary py-2 px-4 font-medium rounded-md text-sm",
|
21384
|
+
children: "Connect"
|
21385
|
+
}
|
21386
|
+
)
|
21387
|
+
] }) }, walletType)),
|
21388
|
+
/* @__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: [
|
21389
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-sm text-gray-600", children: [
|
21390
|
+
getWalletDisplayName(walletType),
|
21391
|
+
" not detected"
|
21392
|
+
] }),
|
21393
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21394
|
+
"a",
|
21395
|
+
{
|
21396
|
+
href: getWalletInstallUrl(walletType),
|
21397
|
+
target: "_blank",
|
21398
|
+
rel: "noopener noreferrer",
|
21399
|
+
className: "text-sm text-purple-600 hover:underline",
|
21400
|
+
children: "Install"
|
21401
|
+
}
|
21402
|
+
)
|
21403
|
+
] }) }, walletType)) })
|
21441
21404
|
] })
|
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
|
-
}
|
21453
21405
|
),
|
21454
|
-
|
21455
|
-
|
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: [
|
21406
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 rounded-lg bg-red-50 mb-4 text-red-600 text-sm", children: error }),
|
21407
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [
|
21469
21408
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21470
|
-
|
21409
|
+
"button",
|
21471
21410
|
{
|
21472
|
-
|
21473
|
-
|
21474
|
-
|
21411
|
+
type: "button",
|
21412
|
+
onClick: onBack,
|
21413
|
+
className: "w-full py-2 px-4 bg-gray-200 hover:bg-gray-300 text-purple-600 font-medium rounded-md",
|
21414
|
+
children: "Back"
|
21475
21415
|
}
|
21476
21416
|
),
|
21477
21417
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
21478
21418
|
"button",
|
21479
21419
|
{
|
21480
21420
|
type: "button",
|
21481
|
-
onClick:
|
21482
|
-
className: "
|
21483
|
-
|
21421
|
+
onClick: () => onPayment(paymentType === "qrcode"),
|
21422
|
+
className: "coinley-button-primary w-full py-2 px-4 font-medium rounded-md",
|
21423
|
+
disabled: !testMode && paymentType === "wallet" && !walletConnection,
|
21424
|
+
children: paymentType === "qrcode" ? "I have sent the payment" : "Pay Now"
|
21484
21425
|
}
|
21485
21426
|
)
|
21486
21427
|
] })
|
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
|
+
] })
|
21487
21483
|
] })
|
21488
|
-
|
21489
|
-
|
21490
|
-
|
21484
|
+
]
|
21485
|
+
}
|
21486
|
+
) }) });
|
21491
21487
|
};
|
21492
21488
|
const CoinleyCheckout = forwardRef(({
|
21493
21489
|
apiKey,
|