@cedros/pay-react 1.1.28 → 1.1.30
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.
- package/README.md +8 -0
- package/dist/{AISettingsSection-BlIv3CzS.mjs → AISettingsSection-BMh3hAb5.mjs} +6 -4
- package/dist/{AISettingsSection-DELur7D2.js → AISettingsSection-C0zqPbd6.js} +2 -2
- package/dist/{AutosaveIndicator-Bed0-ekg.mjs → AutosaveIndicator-3ctAnz8Y.mjs} +1 -1
- package/dist/{AutosaveIndicator-Dn_qA2hK.js → AutosaveIndicator-DXRPr4P7.js} +1 -1
- package/dist/CedrosContext-5Gjveoba.mjs +2555 -0
- package/dist/CedrosContext-CCakH2SZ.js +3 -0
- package/dist/CedrosPayAdminDashboard-DaJ9JoGn.mjs +250 -0
- package/dist/CedrosPayAdminDashboard-Uvyh9p7A.js +1 -0
- package/dist/{ChatLogsSection-v4zwzCTC.mjs → ChatLogsSection-BtJixYAp.mjs} +19 -17
- package/dist/ChatLogsSection-FC3O536G.js +1 -0
- package/dist/{ComplianceSection-CemgfDrL.mjs → ComplianceSection-BMnb1p4w.mjs} +18 -15
- package/dist/ComplianceSection-BioTKm7k.js +1 -0
- package/dist/{CryptoButton-BV9owVe2.mjs → CryptoButton-Cl2kZbOP.mjs} +26 -24
- package/dist/CryptoButton-DxFCYDlJ.js +1 -0
- package/dist/{CustomersSection-D_j7OrfS.mjs → CustomersSection-dmwoBhcf.mjs} +21 -19
- package/dist/CustomersSection-z6ARxuex.js +1 -0
- package/dist/DisputesSection-BjHHQAi7.js +1 -0
- package/dist/{DisputesSection-BcAbXp3K.mjs → DisputesSection-CHyLne76.mjs} +19 -17
- package/dist/Dropdown-BRSZlhik.mjs +111 -0
- package/dist/Dropdown-j8o0OO5L.js +1 -0
- package/dist/ErrorBanner-CAgPnj62.js +1 -0
- package/dist/ErrorBanner-lZJhCmDX.mjs +22 -0
- package/dist/{FAQSection-Dn38OhB_.mjs → FAQSection-Di2xE9Sm.mjs} +8 -6
- package/dist/FAQSection-b34DMzgV.js +1 -0
- package/dist/{ImagesSection-Ctw9Icym.mjs → ImagesSection-D63PEjR6.mjs} +6 -4
- package/dist/ImagesSection-DGBA7iKY.js +1 -0
- package/dist/{InventorySection-DmhjUlRZ.mjs → InventorySection-Dp5Yu4TA.mjs} +25 -23
- package/dist/InventorySection-bVCECzX5.js +1 -0
- package/dist/LazyCedrosPayAdminDashboard-BqJDNrDI.mjs +9 -0
- package/dist/LazyCedrosPayAdminDashboard-CpfTtOBc.js +1 -0
- package/dist/{MessagingSection-B1FaGxkp.mjs → MessagingSection-BLCnCpEv.mjs} +5 -4
- package/dist/MessagingSection-DU0dYNMy.js +1 -0
- package/dist/{OrdersSection-Bj8bPdg8.mjs → OrdersSection-Bd56F3cj.mjs} +27 -24
- package/dist/OrdersSection-FOFEAgs1.js +1 -0
- package/dist/PaymentSettingsSection-52iw47Su.mjs +648 -0
- package/dist/PaymentSettingsSection-B5J56VAk.js +1 -0
- package/dist/ReturnsSection-BjpIVFfN.js +1 -0
- package/dist/{ReturnsSection-BC0L8r2e.mjs → ReturnsSection-DUVeKrCd.mjs} +11 -9
- package/dist/{SettingsSection-vdYFSNxB.js → SettingsSection-DKkHykaC.js} +1 -1
- package/dist/{SettingsSection-KYdEizq_.mjs → SettingsSection-vK9WIwXE.mjs} +1 -1
- package/dist/ShippingSection-B5lk7zpS.js +1 -0
- package/dist/{ShippingSection-BOgto6_9.mjs → ShippingSection-CZRrXrlh.mjs} +5 -3
- package/dist/{SingleCategorySettings-suJ8z9d8.mjs → SingleCategorySettings-C8xJ47_T.mjs} +143 -140
- package/dist/SingleCategorySettings-g7D-9lG1.js +3 -0
- package/dist/StatsBar-CWXw2ZT3.js +1 -0
- package/dist/StatsBar-D4cOKG2e.mjs +25 -0
- package/dist/StorefrontSection-BWnMB9k-.js +1 -0
- package/dist/{StorefrontSection-BRvIGBEJ.mjs → StorefrontSection-uXSVbEAa.mjs} +121 -119
- package/dist/{SubscriptionsSection-D60qrX9a.mjs → SubscriptionsSection-Ci_AZrWA.mjs} +11 -9
- package/dist/SubscriptionsSection-DQfXkuDv.js +1 -0
- package/dist/{TaxSection-C7-pv-Rl.mjs → TaxSection-BTukS_cU.mjs} +23 -21
- package/dist/TaxSection-cuPQISxZ.js +1 -0
- package/dist/ThemeContext-CFXyYx7A.js +1 -0
- package/dist/ThemeContext-l0bqcOGW.mjs +126 -0
- package/dist/Token22Section-CCfkDm8W.js +1 -0
- package/dist/{Token22Section-CrHLQ0EB.mjs → Token22Section-DRsPJuTq.mjs} +7 -6
- package/dist/{WalletManager-BIwH8Dw_.mjs → WalletManager-D-eoqUDy.mjs} +21 -19
- package/dist/WalletManager-DXChB9LA.js +1 -0
- package/dist/{WebhooksSection-COPW4Ec0.mjs → WebhooksSection-A8Y4ZGcj.mjs} +40 -38
- package/dist/WebhooksSection-CnEmaGH1.js +1 -0
- package/dist/admin.d.ts +2 -0
- package/dist/admin.js +1 -0
- package/dist/admin.mjs +7 -0
- package/dist/configApi-BS5UJfzm.js +1 -0
- package/dist/{configApi-6XhAJGKX.mjs → configApi-BUXZOMWK.mjs} +57 -3
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +215 -202
- package/dist/dateHelpers-BKW_lGND.js +1 -0
- package/dist/dateHelpers-yvPkofYQ.mjs +6 -0
- package/dist/fetchWithTimeout-CG0EKbhf.js +1 -0
- package/dist/fetchWithTimeout-DmMOwL0Q.mjs +195 -0
- package/dist/icons-C3yDMnKE.mjs +235 -0
- package/dist/icons-Cjgd9YVo.js +1 -0
- package/dist/index-9QF_UfSN.mjs +18668 -0
- package/dist/index-Cq9ya93W.js +84 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +74 -63
- package/dist/safeHref-DqJPLPl5.mjs +12 -0
- package/dist/safeHref-DyHIpVjY.js +1 -0
- package/dist/sectionIds-D46-_-h-.js +1 -0
- package/dist/sectionIds-YktNxmRt.mjs +124 -0
- package/dist/sections-511_XBh4.js +1 -0
- package/dist/sections-CRaMa8ZB.mjs +9 -0
- package/dist/sections-more-Cgw2qJlA.js +1 -0
- package/dist/sections-more-Ixw6mM6R.mjs +3082 -0
- package/dist/src/admin/index.d.ts +3 -3
- package/dist/src/admin/index.d.ts.map +1 -1
- package/dist/src/admin/plugin.d.ts.map +1 -1
- package/dist/src/admin/types.d.ts +2 -6
- package/dist/src/admin/types.d.ts.map +1 -1
- package/dist/src/admin.d.ts +9 -0
- package/dist/src/admin.d.ts.map +1 -0
- package/dist/src/components/admin/LazyCedrosPayAdminDashboard.d.ts +4 -0
- package/dist/src/components/admin/LazyCedrosPayAdminDashboard.d.ts.map +1 -0
- package/dist/src/components/admin/PaymentReadinessChecklist.d.ts +9 -0
- package/dist/src/components/admin/PaymentReadinessChecklist.d.ts.map +1 -0
- package/dist/src/components/admin/PaymentSettingsSection.d.ts.map +1 -1
- package/dist/src/components/admin/PaymentSetupGuide.d.ts +6 -0
- package/dist/src/components/admin/PaymentSetupGuide.d.ts.map +1 -0
- package/dist/src/components/admin/ProductsSection.d.ts.map +1 -1
- package/dist/src/components/admin/configApi.d.ts +1 -1
- package/dist/src/components/admin/configApi.d.ts.map +1 -1
- package/dist/src/components/admin/icons.d.ts +3 -50
- package/dist/src/components/admin/icons.d.ts.map +1 -1
- package/dist/src/components/admin/index.d.ts +1 -1
- package/dist/src/components/admin/index.d.ts.map +1 -1
- package/dist/src/components/admin/types.d.ts +43 -0
- package/dist/src/components/admin/types.d.ts.map +1 -1
- package/dist/src/context/CedrosContext.d.ts +2 -0
- package/dist/src/context/CedrosContext.d.ts.map +1 -1
- package/dist/src/ecommerce/__tests__/featureFlags.test.d.ts +2 -0
- package/dist/src/ecommerce/__tests__/featureFlags.test.d.ts.map +1 -0
- package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -1
- package/dist/src/ecommerce/components/general/ErrorBoundary.d.ts +1 -1
- package/dist/src/ecommerce/components/ui/button.d.ts +1 -1
- package/dist/src/ecommerce/components/ui/sheet.d.ts +1 -1
- package/dist/src/ecommerce/config/context.d.ts +2 -0
- package/dist/src/ecommerce/config/context.d.ts.map +1 -1
- package/dist/src/ecommerce/config/types.d.ts +2 -0
- package/dist/src/ecommerce/config/types.d.ts.map +1 -1
- package/dist/src/ecommerce/index.d.ts +2 -0
- package/dist/src/ecommerce/index.d.ts.map +1 -1
- package/dist/src/featureFlags.d.ts +41 -0
- package/dist/src/featureFlags.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/managers/StripeManager.d.ts.map +1 -1
- package/dist/src/managers/SubscriptionManager.d.ts +1 -0
- package/dist/src/managers/SubscriptionManager.d.ts.map +1 -1
- package/dist/src/standalone-admin.d.ts +8 -0
- package/dist/src/standalone-admin.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +14 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/subscription.d.ts +47 -1
- package/dist/src/types/subscription.d.ts.map +1 -1
- package/dist/src/utils/validateConfig.d.ts.map +1 -1
- package/dist/standalone-admin.d.ts +2 -0
- package/dist/standalone-admin.js +1 -0
- package/dist/standalone-admin.mjs +4 -0
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +35 -33
- package/dist/styles--fxb3lCl.js +1 -0
- package/dist/{styles-D4SQkuV3.mjs → styles-DGagylUj.mjs} +53 -51
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/tokenMintValidator-DAjQld0r.mjs +98 -0
- package/dist/tokenMintValidator-DNBhoefh.js +4 -0
- package/dist/{walletPool-DE-t1wSW.mjs → walletPool-9MylB2QK.mjs} +1 -1
- package/dist/walletPool-BjTXX6Vn.js +1 -0
- package/package.json +9 -3
- package/dist/CedrosContext-C2RjHLaQ.js +0 -6
- package/dist/CedrosContext-CY6zvjvJ.mjs +0 -2801
- package/dist/ChatLogsSection-BH5tLA4T.js +0 -1
- package/dist/ComplianceSection-DP2a9-S0.js +0 -1
- package/dist/CryptoButton-DpiCnyXE.js +0 -1
- package/dist/CustomersSection-CBwy_waO.js +0 -1
- package/dist/DisputesSection-BLjIk60n.js +0 -1
- package/dist/FAQSection-wNeH0i6Q.js +0 -1
- package/dist/ImagesSection-0ZzKlzMJ.js +0 -1
- package/dist/InventorySection-zV6lTmue.js +0 -1
- package/dist/MessagingSection-B_wdFR0j.js +0 -1
- package/dist/OrdersSection-Dw2FX-1d.js +0 -1
- package/dist/PaymentSettingsSection-BYF4D-GR.js +0 -1
- package/dist/PaymentSettingsSection-EnMxeWjv.mjs +0 -94
- package/dist/ReturnsSection-D_pJVxuG.js +0 -1
- package/dist/ShippingSection-1DRSTu49.js +0 -1
- package/dist/SingleCategorySettings-DwCnBdRf.js +0 -3
- package/dist/StorefrontSection-RumGkb3C.js +0 -1
- package/dist/SubscriptionsSection-C2aLLn7L.js +0 -1
- package/dist/TaxSection-Dt1DnM51.js +0 -1
- package/dist/Token22Section-DY3mUwTY.js +0 -1
- package/dist/WalletManager-B3UdQ5pQ.js +0 -1
- package/dist/WebhooksSection-CKeiJ7Py.js +0 -1
- package/dist/configApi-DkduMQg1.js +0 -1
- package/dist/index-C0g-JxJk.js +0 -84
- package/dist/index-DXnuQp5x.mjs +0 -22128
- package/dist/sections-C1NpK7hk.mjs +0 -9
- package/dist/sections-DVVSZBhW.js +0 -1
- package/dist/styles-BT4bhFey.js +0 -1
- package/dist/walletPool-IS7R3MR1.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),A=require("./icons-Cjgd9YVo.js"),B=require("./ErrorBanner-CAgPnj62.js"),k=require("./dateHelpers-BKW_lGND.js"),C=require("./safeHref-DyHIpVjY.js");function P({serverUrl:n,apiKey:r,pageSize:o=20,authManager:d}){const[l,s]=a.useState([]),[c,f]=a.useState(0),[L,y]=a.useState(!0),[v,b]=a.useState(null),[u,S]=a.useState(null),[R,p]=a.useState(null),[$,_]=a.useState([]),[F,N]=a.useState(!1),[x,O]=a.useState(""),h=a.useCallback(async(t,i)=>{if(d?.isAuthenticated())return d.fetchWithAuth(t,i);const g={"Content-Type":"application/json"};r&&(g["X-API-Key"]=r);const m=await fetch(`${n}${t}`,{...i,headers:{...g,...i?.headers}});if(!m.ok){const I=await m.text().catch(()=>`HTTP ${m.status}`);throw new Error(I)}return m.json()},[n,r,d]),j=a.useCallback(async()=>{y(!0);try{b(null);const t=new URLSearchParams({limit:String(o)});x&&t.set("status",x);const i=await h(`/admin/orders?${t}`);s(i.orders),f(i.total)}catch{b("Failed to load orders")}finally{y(!1)}},[h,o,x]);a.useEffect(()=>{j()},[j]);const T=a.useCallback(async t=>{N(!0);try{const[i,g]=await Promise.all([h(`/admin/orders/${encodeURIComponent(t)}`),h("/admin/gift-card-redemptions?limit=50").catch(()=>[])]);p(i),_(g.filter(m=>m.orderId===t))}catch{p(null),_([])}finally{N(!1)}},[h]),D=t=>{u===t?(S(null),p(null),_([])):(S(t),T(t))},E=(t,i)=>i==="USD"||i==="usd"?`$${(t/100).toFixed(2)}`:`${t} ${i}`;return e.jsxs("div",{className:"cedros-admin__section",children:[e.jsxs("div",{className:"cedros-admin__section-header",children:[e.jsx("h2",{className:"cedros-admin__section-title",children:"Orders"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsxs("select",{className:"cedros-admin__input",style:{width:"auto",minWidth:"120px"},value:x,onChange:t=>O(t.target.value),children:[e.jsx("option",{value:"",children:"All statuses"}),e.jsx("option",{value:"paid",children:"Paid"}),e.jsx("option",{value:"processing",children:"Processing"}),e.jsx("option",{value:"fulfilled",children:"Fulfilled"}),e.jsx("option",{value:"shipped",children:"Shipped"}),e.jsx("option",{value:"delivered",children:"Delivered"}),e.jsx("option",{value:"cancelled",children:"Cancelled"}),e.jsx("option",{value:"refunded",children:"Refunded"})]}),e.jsxs("button",{type:"button",className:"cedros-admin__button cedros-admin__button--secondary",onClick:j,children:[A.Icons.refresh," Refresh"]})]})]}),v?e.jsx(B.ErrorBanner,{message:v,onRetry:j}):null,L?e.jsx("div",{className:"cedros-admin__loading-text",children:"Loading orders..."}):l.length===0?e.jsx("div",{className:"cedros-admin__empty",children:"No orders found."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cedros-admin__table-info",children:[c," order",c===1?"":"s"," total"]}),e.jsxs("table",{className:"cedros-admin__table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Order"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Amount"}),e.jsx("th",{children:"Source"}),e.jsx("th",{children:"Customer"}),e.jsx("th",{children:"Date"})]})}),e.jsx("tbody",{children:l.map(t=>e.jsx(q,{order:t,expanded:u===t.id,detail:u===t.id?R:null,redemptions:u===t.id?$:[],detailLoading:u===t.id&&F,onToggle:()=>D(t.id),formatAmount:E},t.id))})]})]})]})}function q({order:n,expanded:r,detail:o,redemptions:d,detailLoading:l,onToggle:s,formatAmount:c}){const f=n.metadata?.recipient_email||d.length>0;return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:s,style:{cursor:"pointer"},className:r?"cedros-admin__table-row--active":"",children:[e.jsxs("td",{children:[e.jsxs("span",{className:"cedros-admin__mono",children:[n.id.slice(0,12),"..."]}),f?e.jsx("span",{className:"cedros-admin__badge cedros-admin__badge--info",style:{marginLeft:"0.5rem"},children:"Gift Card"}):null]}),e.jsx("td",{children:e.jsx("span",{className:`cedros-admin__badge cedros-admin__badge--${w(n.status)}`,children:n.status})}),e.jsx("td",{children:c(n.amount,n.amountAsset)}),e.jsx("td",{children:n.source}),e.jsx("td",{children:n.customerEmail||n.customerName||"—"}),e.jsx("td",{children:k.formatDateTime(n.createdAt)})]}),r?e.jsx("tr",{children:e.jsx("td",{colSpan:6,style:{padding:0},children:e.jsx(H,{detail:o,redemptions:d,loading:l,formatAmount:c,metadata:n.metadata})})}):null]})}function H({detail:n,redemptions:r,loading:o,formatAmount:d,metadata:l}){return o?e.jsx("div",{style:{padding:"1rem"},className:"cedros-admin__loading-text",children:"Loading details..."}):e.jsxs("div",{style:{padding:"1rem",background:"var(--cedros-admin-bg-muted, #f9fafb)"},children:[Object.keys(l).length>0?e.jsxs("div",{style:{marginBottom:"1rem"},children:[e.jsx("div",{className:"cedros-admin__label",children:"Order Metadata"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"0.25rem 1rem",fontSize:"0.8125rem"},children:Object.entries(l).map(([s,c])=>e.jsxs("div",{style:{display:"contents"},children:[e.jsx("span",{style:{fontWeight:500,color:"var(--cedros-admin-text-muted)"},children:s}),e.jsx("span",{children:c})]},s))})]}):null,r.length>0?e.jsxs("div",{style:{marginBottom:"1rem"},children:[e.jsx("div",{className:"cedros-admin__label",children:"Gift Card Fulfillment"}),r.map(s=>e.jsxs("div",{style:{fontSize:"0.8125rem",padding:"0.5rem",border:"1px solid var(--cedros-admin-border)",borderRadius:"0.5rem",marginBottom:"0.5rem"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("span",{children:["Face value: ",d(s.faceValueCents,s.currency)]}),e.jsx("span",{className:`cedros-admin__badge cedros-admin__badge--${s.creditsIssued>0?"success":"warning"}`,children:s.creditsIssued>0?"Credits issued":"Pending"})]}),e.jsxs("div",{style:{marginTop:"0.25rem",color:"var(--cedros-admin-text-muted)"},children:["Recipient: ",s.recipientUserId||"—",s.tokenMinted?e.jsx("span",{className:"cedros-admin__badge cedros-admin__badge--info",style:{marginLeft:"0.5rem"},children:"Token minted"}):null]})]},s.id))]}):null,n?.fulfillments&&n.fulfillments.length>0?e.jsxs("div",{style:{marginBottom:"1rem"},children:[e.jsx("div",{className:"cedros-admin__label",children:"Fulfillments"}),n.fulfillments.map(s=>e.jsxs("div",{style:{fontSize:"0.8125rem",marginBottom:"0.25rem"},children:[e.jsx("span",{className:`cedros-admin__badge cedros-admin__badge--${w(s.status)}`,children:s.status}),s.carrier?e.jsx("span",{style:{marginLeft:"0.5rem"},children:s.carrier}):null,s.trackingNumber?C.safeHref(s.trackingUrl)?e.jsx("a",{href:C.safeHref(s.trackingUrl),target:"_blank",rel:"noreferrer",style:{marginLeft:"0.5rem"},children:s.trackingNumber}):e.jsx("span",{style:{marginLeft:"0.5rem"},children:s.trackingNumber}):null]},s.id))]}):null,n?.history&&n.history.length>0?e.jsxs("div",{children:[e.jsx("div",{className:"cedros-admin__label",children:"Status History"}),n.history.map(s=>e.jsxs("div",{style:{fontSize:"0.8125rem",marginBottom:"0.25rem"},children:[e.jsx("span",{style:{color:"var(--cedros-admin-text-muted)"},children:k.formatDateTime(s.createdAt)})," ",s.fromStatus," → ",s.toStatus,s.note?e.jsx("span",{style:{marginLeft:"0.5rem",fontStyle:"italic"},children:s.note}):null]},s.id))]}):null]})}function w(n){switch(n){case"paid":case"fulfilled":case"delivered":case"success":return"success";case"processing":case"shipped":case"pending":return"warning";case"cancelled":case"refunded":case"failed":return"error";default:return"default"}}exports.OrdersSection=P;
|
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as B, useState as h, useEffect as z } from "react";
|
|
3
|
+
import { S as M } from "./SingleCategorySettings-C8xJ47_T.mjs";
|
|
4
|
+
import { C as U } from "./configApi-BUXZOMWK.mjs";
|
|
5
|
+
import { E as j } from "./ErrorBanner-lZJhCmDX.mjs";
|
|
6
|
+
import { S as H } from "./StatsBar-D4cOKG2e.mjs";
|
|
7
|
+
const q = "https://github.com/conorholds/cedros-pay/tree/main/ui/docs/cross-channel-setup.md";
|
|
8
|
+
function V({ title: e, description: i, steps: r }) {
|
|
9
|
+
return /* @__PURE__ */ s(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
style: {
|
|
13
|
+
border: "1px solid var(--cedros-admin-border, #e5e7eb)",
|
|
14
|
+
borderRadius: "0.75rem",
|
|
15
|
+
padding: "1rem",
|
|
16
|
+
background: "var(--cedros-admin-surface, #ffffff)"
|
|
17
|
+
},
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ t("div", { style: { fontWeight: 700, marginBottom: "0.35rem" }, children: e }),
|
|
20
|
+
/* @__PURE__ */ t(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
style: {
|
|
24
|
+
color: "var(--cedros-admin-text-muted, #64748b)",
|
|
25
|
+
fontSize: "0.9rem",
|
|
26
|
+
marginBottom: "0.75rem",
|
|
27
|
+
lineHeight: 1.5
|
|
28
|
+
},
|
|
29
|
+
children: i
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ t("ol", { style: { margin: 0, paddingLeft: "1.1rem", lineHeight: 1.6, fontSize: "0.9rem" }, children: r.map((o) => /* @__PURE__ */ t("li", { children: o }, o)) })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function G({ children: e }) {
|
|
38
|
+
return /* @__PURE__ */ t(
|
|
39
|
+
"code",
|
|
40
|
+
{
|
|
41
|
+
style: {
|
|
42
|
+
display: "block",
|
|
43
|
+
padding: "0.65rem 0.75rem",
|
|
44
|
+
background: "rgba(15, 23, 42, 0.04)",
|
|
45
|
+
borderRadius: "0.5rem",
|
|
46
|
+
marginTop: "0.5rem",
|
|
47
|
+
wordBreak: "break-all"
|
|
48
|
+
},
|
|
49
|
+
children: e
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function Q({ serverUrl: e }) {
|
|
54
|
+
const i = `${e.replace(/\/$/, "")}/webhook/stripe`, r = `${e.replace(/\/$/, "")}/paywall/v1/native-store/apple/notifications`, o = `${e.replace(/\/$/, "")}/paywall/v1/native-store/google/notifications`;
|
|
55
|
+
return /* @__PURE__ */ s(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
style: {
|
|
59
|
+
display: "grid",
|
|
60
|
+
gap: "1rem",
|
|
61
|
+
marginBottom: "1rem"
|
|
62
|
+
},
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ s(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
style: {
|
|
68
|
+
padding: "1rem",
|
|
69
|
+
borderRadius: "0.75rem",
|
|
70
|
+
background: "var(--cedros-admin-subtle, rgba(15, 23, 42, 0.03))",
|
|
71
|
+
border: "1px solid var(--cedros-admin-border, #e5e7eb)"
|
|
72
|
+
},
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ t("div", { style: { fontWeight: 700, marginBottom: "0.4rem" }, children: "Turnkey setup path" }),
|
|
75
|
+
/* @__PURE__ */ t(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
style: {
|
|
79
|
+
color: "var(--cedros-admin-text-muted, #64748b)",
|
|
80
|
+
lineHeight: 1.6,
|
|
81
|
+
fontSize: "0.9rem"
|
|
82
|
+
},
|
|
83
|
+
children: "Create the product once in Cedros, configure each payment channel here, then point Stripe, App Store Connect, and Google Play Console at the Cedros endpoints below. Cedros packages can then load the same product catalog and apply the right rail at runtime."
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ t(G, { children: i }),
|
|
87
|
+
/* @__PURE__ */ t(G, { children: r }),
|
|
88
|
+
/* @__PURE__ */ t(G, { children: o }),
|
|
89
|
+
/* @__PURE__ */ t(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
style: {
|
|
93
|
+
marginTop: "0.5rem",
|
|
94
|
+
color: "var(--cedros-admin-text-muted, #64748b)",
|
|
95
|
+
fontSize: "0.8rem",
|
|
96
|
+
lineHeight: 1.5
|
|
97
|
+
},
|
|
98
|
+
children: "Store notifications must target a tenant-specific Cedros deployment URL. If your deployment injects tenant context via domain, path prefix, or headers, use that tenant-scoped URL here instead of a generic shared endpoint."
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ t(
|
|
102
|
+
"a",
|
|
103
|
+
{
|
|
104
|
+
href: q,
|
|
105
|
+
target: "_blank",
|
|
106
|
+
rel: "noopener noreferrer",
|
|
107
|
+
style: {
|
|
108
|
+
display: "inline-block",
|
|
109
|
+
marginTop: "0.75rem",
|
|
110
|
+
fontSize: "0.85rem",
|
|
111
|
+
fontWeight: 600,
|
|
112
|
+
textDecoration: "underline",
|
|
113
|
+
color: "inherit"
|
|
114
|
+
},
|
|
115
|
+
children: "Open the full cross-channel setup guide"
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ t(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
style: {
|
|
125
|
+
display: "grid",
|
|
126
|
+
gap: "1rem",
|
|
127
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(260px, 1fr))"
|
|
128
|
+
},
|
|
129
|
+
children: [
|
|
130
|
+
{
|
|
131
|
+
title: "Stripe Web Checkout",
|
|
132
|
+
description: "Use this for website payments and any mobile redirect Checkout flows. Cedros owns the checkout session creation, but Stripe still needs your API keys and webhook endpoint configured.",
|
|
133
|
+
steps: [
|
|
134
|
+
"Add your Stripe publishable key, secret key, and webhook signing secret in Payment Options → Stripe.",
|
|
135
|
+
"Create a Stripe webhook endpoint that sends subscription and checkout events to the Cedros webhook URL shown below.",
|
|
136
|
+
"If your app uses custom deep links for Stripe redirects, add the scheme in Stripe → allowed redirect schemes."
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: "Apple App Store Billing",
|
|
141
|
+
description: "Use this for digital goods and subscriptions distributed through the Apple App Store. Cedros verifies purchases and handles server notifications, but you still need to create App Store Connect products and credentials.",
|
|
142
|
+
steps: [
|
|
143
|
+
"In Products, map each store-managed product to its Apple product ID and choose the correct store-managed kind.",
|
|
144
|
+
"In Payment Options → App Stores, enter your App Store Server API issuer ID, key ID, private key, and bundle ID.",
|
|
145
|
+
"Create the matching products and subscriptions in App Store Connect, then point App Store Server Notifications at the Cedros Apple notification URL.",
|
|
146
|
+
"If you rely on reader, US external purchase link, or similar exceptions, configure those policies in the app build and only after Apple approves the relevant entitlement."
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: "Google Play Billing",
|
|
151
|
+
description: "Use this for digital goods and subscriptions distributed through Google Play. Cedros verifies purchases, acknowledges them server-side, and processes RTDNs, but you still need Play Console catalog and service-account setup.",
|
|
152
|
+
steps: [
|
|
153
|
+
"In Products, map each Play product ID and, for subscriptions, the package name, base plan ID, and optional offer ID.",
|
|
154
|
+
"In Payment Options → App Stores, enter your Google Play service-account email, private key, package name, push service-account email, and push audience.",
|
|
155
|
+
"Create the matching one-time products or subscriptions in Google Play Console and point RTDN delivery at the Cedros Google notification URL.",
|
|
156
|
+
"If you participate in User Choice Billing, Alternative Billing Only, or External Offers programs, configure those policies explicitly in the app build only for approved storefronts."
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
].map((l) => /* @__PURE__ */ t(V, { ...l }, l.title))
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function u(e) {
|
|
167
|
+
return typeof e == "string" && e.trim().length > 0;
|
|
168
|
+
}
|
|
169
|
+
function E(e) {
|
|
170
|
+
switch (e) {
|
|
171
|
+
case "complete":
|
|
172
|
+
return "Complete";
|
|
173
|
+
case "manual":
|
|
174
|
+
return "Manual check";
|
|
175
|
+
case "incomplete":
|
|
176
|
+
default:
|
|
177
|
+
return "Needs setup";
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function L(e) {
|
|
181
|
+
switch (e) {
|
|
182
|
+
case "complete":
|
|
183
|
+
return {
|
|
184
|
+
background: "rgba(34, 197, 94, 0.12)",
|
|
185
|
+
color: "#166534",
|
|
186
|
+
border: "rgba(34, 197, 94, 0.24)"
|
|
187
|
+
};
|
|
188
|
+
case "manual":
|
|
189
|
+
return {
|
|
190
|
+
background: "rgba(245, 158, 11, 0.12)",
|
|
191
|
+
color: "#92400e",
|
|
192
|
+
border: "rgba(245, 158, 11, 0.24)"
|
|
193
|
+
};
|
|
194
|
+
case "incomplete":
|
|
195
|
+
default:
|
|
196
|
+
return {
|
|
197
|
+
background: "rgba(239, 68, 68, 0.12)",
|
|
198
|
+
color: "#991b1b",
|
|
199
|
+
border: "rgba(239, 68, 68, 0.24)"
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function X(e) {
|
|
204
|
+
const i = e.metadata?.store_policy_fulfillment_type;
|
|
205
|
+
if (i === "digital_in_app" || i === "physical_goods" || i === "real_world_service" || i === "reader_content" || i === "other")
|
|
206
|
+
return i;
|
|
207
|
+
switch (e.fulfillment?.type) {
|
|
208
|
+
case "shipping":
|
|
209
|
+
return "physical_goods";
|
|
210
|
+
case "service":
|
|
211
|
+
return "real_world_service";
|
|
212
|
+
case "digital_download":
|
|
213
|
+
return "digital_in_app";
|
|
214
|
+
default:
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function J(e) {
|
|
219
|
+
let i = 0, r = 0, o = 0, n = 0, l = 0;
|
|
220
|
+
return e.forEach((c) => {
|
|
221
|
+
if (X(c) !== "digital_in_app")
|
|
222
|
+
return;
|
|
223
|
+
i += 1;
|
|
224
|
+
const a = c.storeBilling, A = !!a?.apple?.productId, b = !!a?.google?.productId, v = a?.kind === "auto_renewable_subscription" && b, P = !!a?.google?.basePlanId;
|
|
225
|
+
A && b && (!v || P) && (r += 1), A || (o += 1), b || (n += 1), v && !P && (l += 1);
|
|
226
|
+
}), {
|
|
227
|
+
digitalCount: i,
|
|
228
|
+
fullyMappedCount: r,
|
|
229
|
+
missingAppleCount: o,
|
|
230
|
+
missingGoogleCount: n,
|
|
231
|
+
missingBasePlanCount: l
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function K(e) {
|
|
235
|
+
return e.some((i) => i.status === "incomplete") ? "incomplete" : e.some((i) => i.status === "manual") ? "manual" : "complete";
|
|
236
|
+
}
|
|
237
|
+
async function Y(e) {
|
|
238
|
+
const { serverUrl: i, apiKey: r, authManager: o } = e;
|
|
239
|
+
if (o?.isAuthenticated())
|
|
240
|
+
return (await o.fetchWithAuth(
|
|
241
|
+
"/admin/products?limit=500"
|
|
242
|
+
)).products ?? [];
|
|
243
|
+
const n = { "Content-Type": "application/json" };
|
|
244
|
+
r && (n["X-API-Key"] = r);
|
|
245
|
+
const l = await fetch(`${i.replace(/\/$/, "")}/admin/products?limit=500`, {
|
|
246
|
+
headers: n
|
|
247
|
+
});
|
|
248
|
+
if (!l.ok)
|
|
249
|
+
throw new Error(`Failed to fetch products (${l.status})`);
|
|
250
|
+
return (await l.json()).products ?? [];
|
|
251
|
+
}
|
|
252
|
+
function Z({ section: e }) {
|
|
253
|
+
const i = K(e.items), r = L(i);
|
|
254
|
+
return /* @__PURE__ */ s(
|
|
255
|
+
"div",
|
|
256
|
+
{
|
|
257
|
+
style: {
|
|
258
|
+
border: "1px solid var(--cedros-admin-border, #e5e7eb)",
|
|
259
|
+
borderRadius: "0.75rem",
|
|
260
|
+
padding: "1rem",
|
|
261
|
+
background: "var(--cedros-admin-surface, #ffffff)"
|
|
262
|
+
},
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ s(
|
|
265
|
+
"div",
|
|
266
|
+
{
|
|
267
|
+
style: {
|
|
268
|
+
display: "flex",
|
|
269
|
+
justifyContent: "space-between",
|
|
270
|
+
alignItems: "flex-start",
|
|
271
|
+
gap: "1rem",
|
|
272
|
+
marginBottom: "0.5rem"
|
|
273
|
+
},
|
|
274
|
+
children: [
|
|
275
|
+
/* @__PURE__ */ s("div", { children: [
|
|
276
|
+
/* @__PURE__ */ t("div", { style: { fontWeight: 700 }, children: e.title }),
|
|
277
|
+
/* @__PURE__ */ t("div", { style: { color: "var(--cedros-admin-text-muted, #64748b)", fontSize: "0.9rem", lineHeight: 1.5 }, children: e.description })
|
|
278
|
+
] }),
|
|
279
|
+
/* @__PURE__ */ t(
|
|
280
|
+
"span",
|
|
281
|
+
{
|
|
282
|
+
style: {
|
|
283
|
+
background: r.background,
|
|
284
|
+
color: r.color,
|
|
285
|
+
border: `1px solid ${r.border}`,
|
|
286
|
+
borderRadius: "999px",
|
|
287
|
+
padding: "0.2rem 0.6rem",
|
|
288
|
+
fontSize: "0.78rem",
|
|
289
|
+
fontWeight: 600,
|
|
290
|
+
whiteSpace: "nowrap"
|
|
291
|
+
},
|
|
292
|
+
children: E(i)
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
/* @__PURE__ */ t("div", { style: { display: "grid", gap: "0.65rem", marginTop: "0.85rem" }, children: e.items.map((o) => {
|
|
299
|
+
const n = L(o.status);
|
|
300
|
+
return /* @__PURE__ */ s(
|
|
301
|
+
"div",
|
|
302
|
+
{
|
|
303
|
+
style: {
|
|
304
|
+
border: "1px solid var(--cedros-admin-border, #e5e7eb)",
|
|
305
|
+
borderRadius: "0.65rem",
|
|
306
|
+
padding: "0.8rem",
|
|
307
|
+
background: "rgba(15, 23, 42, 0.015)"
|
|
308
|
+
},
|
|
309
|
+
children: [
|
|
310
|
+
/* @__PURE__ */ s(
|
|
311
|
+
"div",
|
|
312
|
+
{
|
|
313
|
+
style: {
|
|
314
|
+
display: "flex",
|
|
315
|
+
alignItems: "center",
|
|
316
|
+
justifyContent: "space-between",
|
|
317
|
+
gap: "1rem",
|
|
318
|
+
marginBottom: "0.35rem"
|
|
319
|
+
},
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ t("div", { style: { fontWeight: 600 }, children: o.title }),
|
|
322
|
+
/* @__PURE__ */ t(
|
|
323
|
+
"span",
|
|
324
|
+
{
|
|
325
|
+
style: {
|
|
326
|
+
background: n.background,
|
|
327
|
+
color: n.color,
|
|
328
|
+
border: `1px solid ${n.border}`,
|
|
329
|
+
borderRadius: "999px",
|
|
330
|
+
padding: "0.15rem 0.5rem",
|
|
331
|
+
fontSize: "0.75rem",
|
|
332
|
+
fontWeight: 600,
|
|
333
|
+
whiteSpace: "nowrap"
|
|
334
|
+
},
|
|
335
|
+
children: E(o.status)
|
|
336
|
+
}
|
|
337
|
+
)
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
),
|
|
341
|
+
/* @__PURE__ */ t(
|
|
342
|
+
"div",
|
|
343
|
+
{
|
|
344
|
+
style: {
|
|
345
|
+
color: "var(--cedros-admin-text-muted, #64748b)",
|
|
346
|
+
fontSize: "0.88rem",
|
|
347
|
+
lineHeight: 1.5
|
|
348
|
+
},
|
|
349
|
+
children: o.detail
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
]
|
|
353
|
+
},
|
|
354
|
+
`${e.title}-${o.title}`
|
|
355
|
+
);
|
|
356
|
+
}) })
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
function ee({
|
|
362
|
+
serverUrl: e,
|
|
363
|
+
apiKey: i,
|
|
364
|
+
authManager: r
|
|
365
|
+
}) {
|
|
366
|
+
const o = B(
|
|
367
|
+
() => new U(e, void 0, r),
|
|
368
|
+
[e, r]
|
|
369
|
+
), [n, l] = h([]), [c, I] = h({}), [a, A] = h({}), [b, v] = h(!0), [P, N] = h(null), [O, F] = h(0);
|
|
370
|
+
z(() => {
|
|
371
|
+
let d = !1;
|
|
372
|
+
return (async () => {
|
|
373
|
+
v(!0), N(null);
|
|
374
|
+
try {
|
|
375
|
+
const [g, m, k] = await Promise.all([
|
|
376
|
+
o.getConfig("stripe", !0),
|
|
377
|
+
o.getConfig("native_store", !0),
|
|
378
|
+
Y({ serverUrl: e, apiKey: i, authManager: r })
|
|
379
|
+
]);
|
|
380
|
+
if (d)
|
|
381
|
+
return;
|
|
382
|
+
I(g.config ?? {}), A(m.config ?? {}), l(k);
|
|
383
|
+
} catch (g) {
|
|
384
|
+
if (d)
|
|
385
|
+
return;
|
|
386
|
+
N(
|
|
387
|
+
g instanceof Error ? g.message : "Failed to load payment readiness data"
|
|
388
|
+
);
|
|
389
|
+
} finally {
|
|
390
|
+
d || v(!1);
|
|
391
|
+
}
|
|
392
|
+
})(), () => {
|
|
393
|
+
d = !0;
|
|
394
|
+
};
|
|
395
|
+
}, [i, r, o, O, e]);
|
|
396
|
+
const C = B(() => {
|
|
397
|
+
const d = u(c.secret_key) && u(c.publishable_key), S = u(c.webhook_secret), g = a.apple_enabled === !0, m = g && u(a.apple_issuer_id) && u(a.apple_key_id) && u(a.apple_private_key) && u(a.apple_bundle_id), k = a.google_enabled === !0, f = k && u(a.google_service_account_email) && u(a.google_private_key) && u(a.google_package_name) && u(a.google_push_service_account_email) && u(a.google_push_audience), {
|
|
398
|
+
digitalCount: p,
|
|
399
|
+
fullyMappedCount: x,
|
|
400
|
+
missingAppleCount: R,
|
|
401
|
+
missingGoogleCount: D,
|
|
402
|
+
missingBasePlanCount: w
|
|
403
|
+
} = J(n), T = [
|
|
404
|
+
{
|
|
405
|
+
title: "Website / Stripe",
|
|
406
|
+
description: "Web checkout and browser-based mobile Stripe flows rely on your Stripe keys and webhook wiring.",
|
|
407
|
+
items: [
|
|
408
|
+
{
|
|
409
|
+
title: "Stripe API keys",
|
|
410
|
+
status: d ? "complete" : "incomplete",
|
|
411
|
+
detail: d ? "Publishable and secret keys are configured in Cedros." : "Add both the Stripe publishable key and secret key in Payment Options → Stripe."
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
title: "Stripe webhook signing secret",
|
|
415
|
+
status: S ? "complete" : "incomplete",
|
|
416
|
+
detail: S ? "Cedros has a webhook signing secret configured." : "Add the Stripe webhook signing secret so Cedros can trust subscription and checkout lifecycle events."
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
title: "Stripe dashboard webhook endpoint",
|
|
420
|
+
status: d && S ? "manual" : "incomplete",
|
|
421
|
+
detail: d && S ? `Confirm Stripe sends events to ${e.replace(/\/$/, "")}/webhook/stripe and that test events succeed.` : "Finish the Stripe config above, then create the webhook in Stripe Dashboard and point it at Cedros."
|
|
422
|
+
}
|
|
423
|
+
]
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
title: "Apple App Store",
|
|
427
|
+
description: "Apple digital goods require App Store billing plus matching App Store Connect catalog and server credentials.",
|
|
428
|
+
items: [
|
|
429
|
+
{
|
|
430
|
+
title: "Apple native-store credentials",
|
|
431
|
+
status: m ? "complete" : "incomplete",
|
|
432
|
+
detail: m ? "Issuer ID, key ID, private key, and bundle ID are configured." : g ? "Apple billing is enabled, but Cedros is still missing one or more App Store Server API credentials." : "Enable Apple App Store billing and add the App Store Server API credentials in Payment Options → App Stores."
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
title: "Apple product mapping",
|
|
436
|
+
status: p === 0 ? "manual" : R === 0 ? "complete" : "incomplete",
|
|
437
|
+
detail: p === 0 ? "No digital in-app products are classified yet. Create or classify a digital product before shipping on the App Store." : R === 0 ? `All ${p} digital in-app products have an Apple product ID.` : `${R} of ${p} digital in-app products still need an Apple product ID.`
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
title: "App Store Connect server notifications",
|
|
441
|
+
status: m ? "manual" : "incomplete",
|
|
442
|
+
detail: m ? `Confirm App Store Server Notifications point to ${e.replace(/\/$/, "")}/paywall/v1/native-store/apple/notifications using your tenant-scoped Cedros URL.` : "Finish the Apple credentials first, then configure App Store Server Notifications in App Store Connect."
|
|
443
|
+
}
|
|
444
|
+
]
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
title: "Google Play",
|
|
448
|
+
description: "Google digital goods require Play Billing plus Play Console product mapping, service-account access, and RTDN wiring.",
|
|
449
|
+
items: [
|
|
450
|
+
{
|
|
451
|
+
title: "Google Play API and RTDN credentials",
|
|
452
|
+
status: f ? "complete" : "incomplete",
|
|
453
|
+
detail: f ? "Service account, package name, RTDN push identity, and audience are configured." : k ? "Google Play billing is enabled, but Cedros is still missing one or more API or RTDN verification fields." : "Enable Google Play billing and add the Android Publisher / RTDN credentials in Payment Options → App Stores."
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
title: "Google product and base-plan mapping",
|
|
457
|
+
status: p === 0 ? "manual" : D === 0 && w === 0 ? "complete" : "incomplete",
|
|
458
|
+
detail: p === 0 ? "No digital in-app products are classified yet. Create or classify a digital product before shipping on Google Play." : D === 0 && w === 0 ? `All ${p} digital in-app products have a Google Play mapping${w === 0 ? "" : " and required base plans"}.` : `${D} products still need a Google product ID and ${w} subscription products still need a base plan ID.`
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
title: "Play Console RTDN delivery",
|
|
462
|
+
status: f ? "manual" : "incomplete",
|
|
463
|
+
detail: f ? `Confirm Real-time developer notifications are configured to reach ${e.replace(/\/$/, "")}/paywall/v1/native-store/google/notifications through your approved Pub/Sub push identity.` : "Finish the Google Play credentials first, then configure RTDN delivery in Google Play Console and Google Cloud Pub/Sub."
|
|
464
|
+
}
|
|
465
|
+
]
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
title: "Cedros product catalog",
|
|
469
|
+
description: "Cedros packages can only route correctly when the catalog itself is classified and mapped cleanly.",
|
|
470
|
+
items: [
|
|
471
|
+
{
|
|
472
|
+
title: "Products created in Cedros",
|
|
473
|
+
status: n.length > 0 ? "complete" : "incomplete",
|
|
474
|
+
detail: n.length > 0 ? `${n.length} products are present in the Cedros catalog.` : "Create at least one product in Admin → Products."
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
title: "Digital product app-store mapping coverage",
|
|
478
|
+
status: p === 0 ? "manual" : x === p ? "complete" : "incomplete",
|
|
479
|
+
detail: p === 0 ? "No digital in-app products are currently classified. If you sell only physical goods or real-world services, this is expected." : `${x} of ${p} digital in-app products currently have both Apple/Google mapping requirements satisfied.`
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
title: "Manual end-to-end store test purchases",
|
|
483
|
+
status: d || m || f ? "manual" : "incomplete",
|
|
484
|
+
detail: d || m || f ? "Run at least one website purchase, one App Store sandbox purchase, and one Google Play test purchase before shipping." : "Finish the payment channel setup first, then run real test purchases through every channel you plan to support."
|
|
485
|
+
}
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
];
|
|
489
|
+
return {
|
|
490
|
+
sections: T,
|
|
491
|
+
stats: {
|
|
492
|
+
products: n.length,
|
|
493
|
+
digitalProducts: p,
|
|
494
|
+
fullyMappedProducts: x,
|
|
495
|
+
autoVerifiedChecks: T.flatMap(($) => $.items).filter(($) => $.status === "complete").length
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
}, [a, n, e, c]);
|
|
499
|
+
return /* @__PURE__ */ s("div", { style: { marginBottom: "1rem" }, children: [
|
|
500
|
+
/* @__PURE__ */ s("div", { className: "cedros-admin__page-header", style: { marginBottom: "1rem" }, children: [
|
|
501
|
+
/* @__PURE__ */ t("h3", { className: "cedros-admin__page-title", children: "Readiness Checklist" }),
|
|
502
|
+
/* @__PURE__ */ t("p", { className: "cedros-admin__page-description", children: "Cedros can verify configuration and product mapping automatically, but external console wiring and test purchases still require a human check." })
|
|
503
|
+
] }),
|
|
504
|
+
/* @__PURE__ */ t(
|
|
505
|
+
j,
|
|
506
|
+
{
|
|
507
|
+
message: P,
|
|
508
|
+
onRetry: () => {
|
|
509
|
+
F((d) => d + 1);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
),
|
|
513
|
+
/* @__PURE__ */ t(
|
|
514
|
+
H,
|
|
515
|
+
{
|
|
516
|
+
stats: [
|
|
517
|
+
{ label: "Products", value: C.stats.products },
|
|
518
|
+
{ label: "Digital App Products", value: C.stats.digitalProducts },
|
|
519
|
+
{ label: "Fully Mapped", value: C.stats.fullyMappedProducts },
|
|
520
|
+
{ label: "Auto-Verified Checks", value: C.stats.autoVerifiedChecks }
|
|
521
|
+
],
|
|
522
|
+
isLoading: b
|
|
523
|
+
}
|
|
524
|
+
),
|
|
525
|
+
/* @__PURE__ */ t(
|
|
526
|
+
"div",
|
|
527
|
+
{
|
|
528
|
+
style: {
|
|
529
|
+
display: "grid",
|
|
530
|
+
gap: "1rem",
|
|
531
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))",
|
|
532
|
+
marginTop: "1rem"
|
|
533
|
+
},
|
|
534
|
+
children: C.sections.map((d) => /* @__PURE__ */ t(Z, { section: d }, d.title))
|
|
535
|
+
}
|
|
536
|
+
)
|
|
537
|
+
] });
|
|
538
|
+
}
|
|
539
|
+
function y({ href: e, children: i }) {
|
|
540
|
+
return /* @__PURE__ */ t(
|
|
541
|
+
"a",
|
|
542
|
+
{
|
|
543
|
+
href: e,
|
|
544
|
+
target: "_blank",
|
|
545
|
+
rel: "noopener noreferrer",
|
|
546
|
+
style: { color: "inherit", textDecoration: "underline" },
|
|
547
|
+
children: i
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
const W = [
|
|
552
|
+
{
|
|
553
|
+
id: "app_stores",
|
|
554
|
+
label: "App Stores",
|
|
555
|
+
category: "native_store",
|
|
556
|
+
description: /* @__PURE__ */ t(_, { children: "Configure Apple App Store and Google Play verification, lifecycle notifications, and server credentials. Use the setup guide below to connect App Store Connect and Google Play Console to Cedros." })
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
id: "stripe",
|
|
560
|
+
label: "Stripe",
|
|
561
|
+
category: "stripe",
|
|
562
|
+
description: /* @__PURE__ */ s(_, { children: [
|
|
563
|
+
"Configure your Stripe integration for card payments. Get your API keys from the",
|
|
564
|
+
" ",
|
|
565
|
+
/* @__PURE__ */ t(y, { href: "https://dashboard.stripe.com/apikeys", children: "Stripe Dashboard" }),
|
|
566
|
+
"."
|
|
567
|
+
] })
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
id: "crypto",
|
|
571
|
+
label: "Crypto",
|
|
572
|
+
category: "x402",
|
|
573
|
+
description: /* @__PURE__ */ s(_, { children: [
|
|
574
|
+
"Configure Solana wallet and token settings for crypto payments. Get a fast RPC endpoint from",
|
|
575
|
+
" ",
|
|
576
|
+
/* @__PURE__ */ t(y, { href: "https://www.helius.dev", children: "Helius" }),
|
|
577
|
+
" or",
|
|
578
|
+
" ",
|
|
579
|
+
/* @__PURE__ */ t(y, { href: "https://www.quicknode.com/chains/sol", children: "QuickNode" }),
|
|
580
|
+
". Set up a payment address using",
|
|
581
|
+
" ",
|
|
582
|
+
/* @__PURE__ */ t(y, { href: "https://phantom.app", children: "Phantom" }),
|
|
583
|
+
" or",
|
|
584
|
+
" ",
|
|
585
|
+
/* @__PURE__ */ t(y, { href: "https://solflare.com", children: "Solflare" }),
|
|
586
|
+
" wallet."
|
|
587
|
+
] })
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
id: "credits",
|
|
591
|
+
label: "Credits",
|
|
592
|
+
category: "cedros_login",
|
|
593
|
+
description: /* @__PURE__ */ s(_, { children: [
|
|
594
|
+
"Configure Cedros Login integration for credits payments. See the",
|
|
595
|
+
" ",
|
|
596
|
+
/* @__PURE__ */ t(y, { href: "https://docs.cedros.dev/credits", children: "Credits API documentation" }),
|
|
597
|
+
"."
|
|
598
|
+
] })
|
|
599
|
+
}
|
|
600
|
+
];
|
|
601
|
+
function se({ serverUrl: e, apiKey: i, authManager: r }) {
|
|
602
|
+
const [o, n] = h("app_stores"), l = W.find((c) => c.id === o);
|
|
603
|
+
return /* @__PURE__ */ s("div", { className: "cedros-admin__payment-settings", children: [
|
|
604
|
+
/* @__PURE__ */ s("div", { className: "cedros-admin__page-header", children: [
|
|
605
|
+
/* @__PURE__ */ t("h2", { className: "cedros-admin__page-title", children: "Payment Options" }),
|
|
606
|
+
/* @__PURE__ */ t("p", { className: "cedros-admin__page-description", children: "Configure the payment rails Cedros can use across web, iOS, Android, and crypto flows." })
|
|
607
|
+
] }),
|
|
608
|
+
/* @__PURE__ */ t("div", { className: "cedros-admin__tabs cedros-admin__tabs--line", children: W.map((c) => /* @__PURE__ */ t(
|
|
609
|
+
"button",
|
|
610
|
+
{
|
|
611
|
+
type: "button",
|
|
612
|
+
className: `cedros-admin__tab ${o === c.id ? "cedros-admin__tab--active" : ""}`,
|
|
613
|
+
onClick: () => n(c.id),
|
|
614
|
+
children: c.label
|
|
615
|
+
},
|
|
616
|
+
c.id
|
|
617
|
+
)) }),
|
|
618
|
+
/* @__PURE__ */ s("div", { style: { marginTop: "1rem" }, children: [
|
|
619
|
+
o === "app_stores" && /* @__PURE__ */ s(_, { children: [
|
|
620
|
+
/* @__PURE__ */ t(Q, { serverUrl: e }),
|
|
621
|
+
/* @__PURE__ */ t(
|
|
622
|
+
ee,
|
|
623
|
+
{
|
|
624
|
+
serverUrl: e,
|
|
625
|
+
apiKey: i,
|
|
626
|
+
authManager: r
|
|
627
|
+
}
|
|
628
|
+
)
|
|
629
|
+
] }),
|
|
630
|
+
/* @__PURE__ */ t(
|
|
631
|
+
M,
|
|
632
|
+
{
|
|
633
|
+
serverUrl: e,
|
|
634
|
+
apiKey: i,
|
|
635
|
+
authManager: r,
|
|
636
|
+
category: l.category,
|
|
637
|
+
title: `${l.label} Settings`,
|
|
638
|
+
description: l.description,
|
|
639
|
+
showEnabledToggle: !0
|
|
640
|
+
},
|
|
641
|
+
l.category
|
|
642
|
+
)
|
|
643
|
+
] })
|
|
644
|
+
] });
|
|
645
|
+
}
|
|
646
|
+
export {
|
|
647
|
+
se as PaymentSettingsSection
|
|
648
|
+
};
|