spaark-payapi-sdk 1.2.2 → 1.3.1
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 +16 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{react-ByYFxpk4.d.mts → react-C9ThSRq3.d.mts} +3 -3
- package/dist/{react-ByYFxpk4.d.ts → react-C9ThSRq3.d.ts} +3 -3
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/package.json +6 -15
|
@@ -177,7 +177,7 @@ interface SpaarkPaySdkFinanceDashboardProps {
|
|
|
177
177
|
}
|
|
178
178
|
declare function SpaarkPaySdkFinanceDashboard({ transactions, title, subtitle, locale, className, showExpertMode, onExpertModeClick, onTransactionClick, onRefresh, isLoading, }: SpaarkPaySdkFinanceDashboardProps): react_jsx_runtime.JSX.Element;
|
|
179
179
|
|
|
180
|
-
interface
|
|
180
|
+
interface SpaarkPaySdkTestDashboardProps {
|
|
181
181
|
apiKey?: string;
|
|
182
182
|
environment?: 'sandbox' | 'production';
|
|
183
183
|
className?: string;
|
|
@@ -188,6 +188,6 @@ interface PawapayTestDashboardProps {
|
|
|
188
188
|
onPayoutComplete?: (response: PayoutResponse) => void;
|
|
189
189
|
onError?: (error: Error) => void;
|
|
190
190
|
}
|
|
191
|
-
declare function
|
|
191
|
+
declare function SpaarkPaySdkTestDashboard({ apiKey: initialApiKey, environment: initialEnvironment, className, demoMode: initialDemoMode, apiBasePath, onDepositComplete, onPayoutComplete, onError, }: SpaarkPaySdkTestDashboardProps): react_jsx_runtime.JSX.Element;
|
|
192
192
|
|
|
193
|
-
export { type ActionResponse as A, type Currency as C, type DepositRequest as D, type FailureReason as F, type MMOAccount as M, type PayoutRequest as P, type RefundRequest as R,
|
|
193
|
+
export { type ActionResponse as A, type Currency as C, type DepositRequest as D, type FailureReason as F, type MMOAccount as M, type PayoutRequest as P, type RefundRequest as R, SpaarkPaySdkTestDashboard as S, type TransactionStatusResponse as T, type DepositResponse as a, type PayoutResponse as b, type PaymentPageRequest as c, type PaymentPageResponse as d, type RefundResponse as e, type PollOptions as f, type TransactionFilters as g, type Correspondent as h, type TransactionLimits as i, type CorrespondentInfo as j, CORRESPONDENTS as k, CORRESPONDENT_INFO as l, type CorrespondentFeature as m, DEFAULT_LIMITS as n, type DepositFailureCode as o, type FinancialAddress as p, type PayoutFailureCode as q, type SpaarkPaySdkTestDashboardProps as r, type TransactionStatus$1 as s, SpaarkPaySdkFinanceDashboard as t, type SpaarkPaySdkFinanceDashboardProps as u, type Transaction as v, type TransactionStatus as w, type TransactionType as x };
|
|
@@ -177,7 +177,7 @@ interface SpaarkPaySdkFinanceDashboardProps {
|
|
|
177
177
|
}
|
|
178
178
|
declare function SpaarkPaySdkFinanceDashboard({ transactions, title, subtitle, locale, className, showExpertMode, onExpertModeClick, onTransactionClick, onRefresh, isLoading, }: SpaarkPaySdkFinanceDashboardProps): react_jsx_runtime.JSX.Element;
|
|
179
179
|
|
|
180
|
-
interface
|
|
180
|
+
interface SpaarkPaySdkTestDashboardProps {
|
|
181
181
|
apiKey?: string;
|
|
182
182
|
environment?: 'sandbox' | 'production';
|
|
183
183
|
className?: string;
|
|
@@ -188,6 +188,6 @@ interface PawapayTestDashboardProps {
|
|
|
188
188
|
onPayoutComplete?: (response: PayoutResponse) => void;
|
|
189
189
|
onError?: (error: Error) => void;
|
|
190
190
|
}
|
|
191
|
-
declare function
|
|
191
|
+
declare function SpaarkPaySdkTestDashboard({ apiKey: initialApiKey, environment: initialEnvironment, className, demoMode: initialDemoMode, apiBasePath, onDepositComplete, onPayoutComplete, onError, }: SpaarkPaySdkTestDashboardProps): react_jsx_runtime.JSX.Element;
|
|
192
192
|
|
|
193
|
-
export { type ActionResponse as A, type Currency as C, type DepositRequest as D, type FailureReason as F, type MMOAccount as M, type PayoutRequest as P, type RefundRequest as R,
|
|
193
|
+
export { type ActionResponse as A, type Currency as C, type DepositRequest as D, type FailureReason as F, type MMOAccount as M, type PayoutRequest as P, type RefundRequest as R, SpaarkPaySdkTestDashboard as S, type TransactionStatusResponse as T, type DepositResponse as a, type PayoutResponse as b, type PaymentPageRequest as c, type PaymentPageResponse as d, type RefundResponse as e, type PollOptions as f, type TransactionFilters as g, type Correspondent as h, type TransactionLimits as i, type CorrespondentInfo as j, CORRESPONDENTS as k, CORRESPONDENT_INFO as l, type CorrespondentFeature as m, DEFAULT_LIMITS as n, type DepositFailureCode as o, type FinancialAddress as p, type PayoutFailureCode as q, type SpaarkPaySdkTestDashboardProps as r, type TransactionStatus$1 as s, SpaarkPaySdkFinanceDashboard as t, type SpaarkPaySdkFinanceDashboardProps as u, type Transaction as v, type TransactionStatus as w, type TransactionType as x };
|
package/dist/react.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
|
-
export {
|
|
2
|
+
export { t as SpaarkPaySdkFinanceDashboard, u as SpaarkPaySdkFinanceDashboardProps, S as SpaarkPaySdkTestDashboard, r as SpaarkPaySdkTestDashboardProps, v as Transaction, w as TransactionStatus, x as TransactionType, S as default } from './react-C9ThSRq3.mjs';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
|
-
export {
|
|
2
|
+
export { t as SpaarkPaySdkFinanceDashboard, u as SpaarkPaySdkFinanceDashboardProps, S as SpaarkPaySdkTestDashboard, r as SpaarkPaySdkTestDashboardProps, v as Transaction, w as TransactionStatus, x as TransactionType, S as default } from './react-C9ThSRq3.js';
|
package/dist/react.js
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
callbackUrl: 'https://your-site.com/callback',
|
|
4
4
|
startDate: '2025-01-01T00:00:00Z',
|
|
5
5
|
endDate: '2025-01-31T23:59:59Z',
|
|
6
|
-
});`})]})]})]}),w==="webhooks"&&jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Webhook Secret"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure the secret used for signing webhooks"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Secret Key"}),jsxRuntime.jsx("input",{type:"text",placeholder:"whsec_...",value:ee,onChange:t=>v(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Webhook Simulator"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate mock webhook events for testing"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Event Type"}),jsxRuntime.jsx("select",{value:te,onChange:t=>Ge(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:Se.map(t=>jsxRuntime.jsx("option",{value:t,children:t},t))})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Amount"}),jsxRuntime.jsx("input",{type:"number",placeholder:"5000",value:ge,onChange:t=>Ue(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Phone Number"}),jsxRuntime.jsx("input",{placeholder:"237670000000",value:fe,onChange:t=>Ve(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Provider"}),jsxRuntime.jsx("select",{value:xe,onChange:t=>$e(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:pe.map(t=>jsxRuntime.jsxs("option",{value:t.value,children:[t.label," (",t.country,")"]},t.value))})]})]}),jsxRuntime.jsxs("button",{onClick:async()=>{let t=Te(te,{amount:ge,phoneNumber:fe,correspondent:xe}),r=JSON.stringify(t,null,2),u=await Ae(JSON.stringify(t),ee);Je(r),ze(u);let F={id:oe(),eventType:te,payload:t,signature:u,receivedAt:new Date().toLocaleTimeString(),isVerified:null};be(de=>[F,...de].slice(0,50)),c("Generate Webhook","success",{eventType:te,eventId:t.eventId});},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(se,{}),"Generate Event"]}),re&&jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Generated Payload"}),jsxRuntime.jsx("button",{onClick:()=>ie(re),className:"text-xs text-muted-foreground hover:text-foreground",children:"Copy"})]}),jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-3 overflow-x-auto max-h-48",children:re}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Signature:"}),jsxRuntime.jsx("code",{className:"text-xs bg-muted px-2 py-1 font-mono flex-1 overflow-x-auto",children:ve}),jsxRuntime.jsx("button",{onClick:()=>ie(ve),className:"w-8 h-8 border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center",children:jsxRuntime.jsx(We,{})})]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Signature Verifier"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Test webhook signature verification"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Payload (JSON)"}),jsxRuntime.jsx("textarea",{placeholder:'{"eventId": "...", "eventType": "deposit.completed", ...}',value:he,onChange:t=>Be(t.target.value),rows:4,className:"w-full px-2.5 py-2 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring resize-none"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Signature"}),jsxRuntime.jsx("input",{placeholder:"HMAC-SHA256 signature",value:ne,onChange:t=>He(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Secret"}),jsxRuntime.jsx("input",{type:"password",placeholder:"whsec_...",value:ye,onChange:t=>Ke(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("button",{onClick:async()=>{try{let t=JSON.parse(he),r=await Ae(JSON.stringify(t),ye),u=r===ne;Ne(u),c("Verify Signature",u?"success":"error",{isValid:u,expected:r,received:ne});}catch{Ne(false),c("Verify Signature","error",void 0,"Invalid JSON payload");}},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(zt,{}),"Verify Signature"]}),ae!==null&&jsxRuntime.jsxs("div",{className:`p-3 text-xs flex items-center gap-2 ${ae?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[ae?jsxRuntime.jsx(_e,{className:"text-green-600"}):jsxRuntime.jsx(je,{className:"text-red-600"}),ae?"Signature is valid":"Signature is invalid"]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Event Parser"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Parse and analyze raw webhook JSON"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Raw JSON"}),jsxRuntime.jsx("textarea",{placeholder:"Paste webhook JSON here...",value:ke,onChange:t=>Xe(t.target.value),rows:4,className:"w-full px-2.5 py-2 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring resize-none"})]}),jsxRuntime.jsxs("button",{onClick:()=>{try{let t=JSON.parse(ke);Ce(t),Ee(""),c("Parse Event","success",{eventType:t.eventType,eventId:t.eventId});}catch(t){Ce(null),Ee(t instanceof Error?t.message:"Invalid JSON"),c("Parse Event","error",void 0,"Invalid JSON");}},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Bt,{}),"Parse Event"]}),we&&jsxRuntime.jsx("div",{className:"p-3 text-xs bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",children:we}),z&&jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Event ID:"}),jsxRuntime.jsx("p",{className:"font-mono truncate",children:String(z.eventId??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Event Type:"}),jsxRuntime.jsx("p",{className:"font-medium",children:String(z.eventType??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Timestamp:"}),jsxRuntime.jsx("p",{className:"font-mono truncate",children:String(z.timestamp??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Status:"}),jsxRuntime.jsx("p",{className:"font-medium",children:String(z.data?.status??"N/A")})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Full Data"}),jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-3 overflow-x-auto max-h-48",children:JSON.stringify(z,null,2)})]})]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Event Log"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"History of generated webhook events"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("select",{value:H,onChange:t=>Qe(t.target.value),className:"h-8 px-2 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:[jsxRuntime.jsx("option",{value:"all",children:"All"}),jsxRuntime.jsx("option",{value:"deposit",children:"Deposits"}),jsxRuntime.jsx("option",{value:"payout",children:"Payouts"}),jsxRuntime.jsx("option",{value:"refund",children:"Refunds"})]}),R.length>0&&jsxRuntime.jsx("button",{onClick:()=>be([]),className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}),jsxRuntime.jsx("div",{className:"divide-y divide-border max-h-64 overflow-y-auto",children:R.filter(t=>H==="all"||t.eventType.startsWith(H)).length===0?jsxRuntime.jsx("div",{className:"p-4 text-center text-muted-foreground text-xs",children:"No events yet. Generate a webhook event to see it here."}):R.filter(t=>H==="all"||t.eventType.startsWith(H)).map(t=>jsxRuntime.jsxs("div",{className:"py-3 space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsx("span",{className:`px-1.5 py-0.5 text-xs font-medium ${t.eventType.includes("completed")?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":t.eventType.includes("failed")?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"}`,children:t.eventType})}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:t.receivedAt})]}),jsxRuntime.jsxs("div",{className:"text-xs text-muted-foreground font-mono truncate",children:["sig: ",t.signature.slice(0,32),"..."]})]},t.id))})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Results"}),V.length>0&&jsxRuntime.jsx("button",{onClick:()=>q([]),className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),jsxRuntime.jsx("div",{className:"border border-border bg-background divide-y divide-border max-h-[600px] overflow-y-auto",children:V.length===0?jsxRuntime.jsx("div",{className:"p-6 text-center text-muted-foreground text-xs",children:"No results yet. Execute an operation to see results here."}):V.map(t=>jsxRuntime.jsxs("div",{className:"p-4 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[t.status==="success"?jsxRuntime.jsx(_e,{className:"text-green-600"}):jsxRuntime.jsx(je,{className:"text-red-600"}),jsxRuntime.jsx("span",{className:"font-medium text-sm",children:t.operation})]}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:t.timestamp})]}),t.error?jsxRuntime.jsx("p",{className:"text-xs text-red-600",children:t.error}):jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-2 overflow-x-auto max-h-48",children:JSON.stringify(t.response,null,2)})]},t.id))})]})]})]}):jsxRuntime.jsxs("div",{className:`space-y-8 ${y}`,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Spaark Pay Console"}),jsxRuntime.jsx("p",{className:"text-muted-foreground mt-1",children:"Configurez vos identifiants PawaPay pour commencer"})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 max-w-md space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 bg-muted flex items-center justify-center",children:jsxRuntime.jsx(me,{})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"font-semibold",children:"SDK Configuration"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your API credentials"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"API Key"}),jsxRuntime.jsx("input",{type:"password",placeholder:"pk_sandbox_...",value:l,onChange:t=>I(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Environnement"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("button",{onClick:()=>h("sandbox"),className:`h-8 px-3 text-xs font-medium border transition-colors flex items-center gap-1.5 ${s==="sandbox"?"bg-blue-600 text-white border-blue-600":"bg-background border-border hover:bg-muted"}`,children:[jsxRuntime.jsx("span",{className:`w-2 h-2 rounded-full ${s==="sandbox"?"bg-blue-200":"bg-blue-500"}`}),"Sandbox"]}),jsxRuntime.jsxs("button",{onClick:()=>h("production"),className:`h-8 px-3 text-xs font-medium border transition-colors flex items-center gap-1.5 ${s==="production"?"bg-green-600 text-white border-green-600":"bg-background border-border hover:bg-muted"}`,children:[jsxRuntime.jsx("span",{className:`w-2 h-2 rounded-full ${s==="production"?"bg-green-200":"bg-green-500"}`}),"Production"]})]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:s==="sandbox"?"Utilisez le sandbox pour tester sans frais r\xE9els":"Attention : les transactions en production sont r\xE9elles"})]}),jsxRuntime.jsxs("button",{onClick:Ye,className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(se,{}),"Initialize SDK"]}),jsxRuntime.jsxs("div",{className:"relative flex items-center py-2",children:[jsxRuntime.jsx("div",{className:"flex-grow border-t border-border"}),jsxRuntime.jsx("span",{className:"flex-shrink mx-3 text-xs text-muted-foreground",children:"ou"}),jsxRuntime.jsx("div",{className:"flex-grow border-t border-border"})]}),jsxRuntime.jsxs("button",{onClick:Ze,className:"w-full h-8 px-3 text-xs font-medium border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(_t,{}),"Mode D\xE9mo (sans API key)"]})]})]})]})}var me=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),se=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),Le=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})}),Wt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),Fe=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),Q=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),We=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),_e=({className:n=""})=>jsxRuntime.jsx("svg",{className:`w-4 h-4 ${n}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),je=({className:n=""})=>jsxRuntime.jsx("svg",{className:`w-4 h-4 ${n}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),_t=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"})}),jt=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),Gt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),Ut=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),Vt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})}),$t=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),Jt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),zt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),Bt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),ea=Ft;exports.PawapayTestDashboard=Ft;exports.SpaarkPaySdkFinanceDashboard=Tt;exports.default=ea;//# sourceMappingURL=react.js.map
|
|
6
|
+
});`})]})]})]}),w==="webhooks"&&jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Webhook Secret"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure the secret used for signing webhooks"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Secret Key"}),jsxRuntime.jsx("input",{type:"text",placeholder:"whsec_...",value:ee,onChange:t=>v(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Webhook Simulator"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate mock webhook events for testing"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Event Type"}),jsxRuntime.jsx("select",{value:te,onChange:t=>Ge(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:Se.map(t=>jsxRuntime.jsx("option",{value:t,children:t},t))})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Amount"}),jsxRuntime.jsx("input",{type:"number",placeholder:"5000",value:ge,onChange:t=>Ue(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Phone Number"}),jsxRuntime.jsx("input",{placeholder:"237670000000",value:fe,onChange:t=>Ve(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Provider"}),jsxRuntime.jsx("select",{value:xe,onChange:t=>$e(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:pe.map(t=>jsxRuntime.jsxs("option",{value:t.value,children:[t.label," (",t.country,")"]},t.value))})]})]}),jsxRuntime.jsxs("button",{onClick:async()=>{let t=Te(te,{amount:ge,phoneNumber:fe,correspondent:xe}),r=JSON.stringify(t,null,2),u=await Ae(JSON.stringify(t),ee);Je(r),ze(u);let F={id:oe(),eventType:te,payload:t,signature:u,receivedAt:new Date().toLocaleTimeString(),isVerified:null};be(de=>[F,...de].slice(0,50)),c("Generate Webhook","success",{eventType:te,eventId:t.eventId});},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(se,{}),"Generate Event"]}),re&&jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Generated Payload"}),jsxRuntime.jsx("button",{onClick:()=>ie(re),className:"text-xs text-muted-foreground hover:text-foreground",children:"Copy"})]}),jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-3 overflow-x-auto max-h-48",children:re}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Signature:"}),jsxRuntime.jsx("code",{className:"text-xs bg-muted px-2 py-1 font-mono flex-1 overflow-x-auto",children:ve}),jsxRuntime.jsx("button",{onClick:()=>ie(ve),className:"w-8 h-8 border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center",children:jsxRuntime.jsx(We,{})})]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Signature Verifier"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Test webhook signature verification"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Payload (JSON)"}),jsxRuntime.jsx("textarea",{placeholder:'{"eventId": "...", "eventType": "deposit.completed", ...}',value:he,onChange:t=>Be(t.target.value),rows:4,className:"w-full px-2.5 py-2 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring resize-none"})]}),jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Signature"}),jsxRuntime.jsx("input",{placeholder:"HMAC-SHA256 signature",value:ne,onChange:t=>He(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Secret"}),jsxRuntime.jsx("input",{type:"password",placeholder:"whsec_...",value:ye,onChange:t=>Ke(t.target.value),className:"w-full h-8 px-2.5 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring"})]})]}),jsxRuntime.jsxs("button",{onClick:async()=>{try{let t=JSON.parse(he),r=await Ae(JSON.stringify(t),ye),u=r===ne;Ne(u),c("Verify Signature",u?"success":"error",{isValid:u,expected:r,received:ne});}catch{Ne(false),c("Verify Signature","error",void 0,"Invalid JSON payload");}},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(zt,{}),"Verify Signature"]}),ae!==null&&jsxRuntime.jsxs("div",{className:`p-3 text-xs flex items-center gap-2 ${ae?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[ae?jsxRuntime.jsx(_e,{className:"text-green-600"}):jsxRuntime.jsx(je,{className:"text-red-600"}),ae?"Signature is valid":"Signature is invalid"]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Event Parser"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Parse and analyze raw webhook JSON"})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Raw JSON"}),jsxRuntime.jsx("textarea",{placeholder:"Paste webhook JSON here...",value:ke,onChange:t=>Xe(t.target.value),rows:4,className:"w-full px-2.5 py-2 text-xs font-mono border border-input bg-transparent rounded-none outline-none focus:border-ring resize-none"})]}),jsxRuntime.jsxs("button",{onClick:()=>{try{let t=JSON.parse(ke);Ce(t),Ee(""),c("Parse Event","success",{eventType:t.eventType,eventId:t.eventId});}catch(t){Ce(null),Ee(t instanceof Error?t.message:"Invalid JSON"),c("Parse Event","error",void 0,"Invalid JSON");}},className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(Bt,{}),"Parse Event"]}),we&&jsxRuntime.jsx("div",{className:"p-3 text-xs bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",children:we}),z&&jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Event ID:"}),jsxRuntime.jsx("p",{className:"font-mono truncate",children:String(z.eventId??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Event Type:"}),jsxRuntime.jsx("p",{className:"font-medium",children:String(z.eventType??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Timestamp:"}),jsxRuntime.jsx("p",{className:"font-mono truncate",children:String(z.timestamp??"N/A")})]}),jsxRuntime.jsxs("div",{className:"p-2 bg-muted",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Status:"}),jsxRuntime.jsx("p",{className:"font-medium",children:String(z.data?.status??"N/A")})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Full Data"}),jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-3 overflow-x-auto max-h-48",children:JSON.stringify(z,null,2)})]})]})]})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Event Log"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"History of generated webhook events"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("select",{value:H,onChange:t=>Qe(t.target.value),className:"h-8 px-2 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring",children:[jsxRuntime.jsx("option",{value:"all",children:"All"}),jsxRuntime.jsx("option",{value:"deposit",children:"Deposits"}),jsxRuntime.jsx("option",{value:"payout",children:"Payouts"}),jsxRuntime.jsx("option",{value:"refund",children:"Refunds"})]}),R.length>0&&jsxRuntime.jsx("button",{onClick:()=>be([]),className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}),jsxRuntime.jsx("div",{className:"divide-y divide-border max-h-64 overflow-y-auto",children:R.filter(t=>H==="all"||t.eventType.startsWith(H)).length===0?jsxRuntime.jsx("div",{className:"p-4 text-center text-muted-foreground text-xs",children:"No events yet. Generate a webhook event to see it here."}):R.filter(t=>H==="all"||t.eventType.startsWith(H)).map(t=>jsxRuntime.jsxs("div",{className:"py-3 space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsx("span",{className:`px-1.5 py-0.5 text-xs font-medium ${t.eventType.includes("completed")?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":t.eventType.includes("failed")?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"}`,children:t.eventType})}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:t.receivedAt})]}),jsxRuntime.jsxs("div",{className:"text-xs text-muted-foreground font-mono truncate",children:["sig: ",t.signature.slice(0,32),"..."]})]},t.id))})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{className:"font-semibold",children:"Results"}),V.length>0&&jsxRuntime.jsx("button",{onClick:()=>q([]),className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),jsxRuntime.jsx("div",{className:"border border-border bg-background divide-y divide-border max-h-[600px] overflow-y-auto",children:V.length===0?jsxRuntime.jsx("div",{className:"p-6 text-center text-muted-foreground text-xs",children:"No results yet. Execute an operation to see results here."}):V.map(t=>jsxRuntime.jsxs("div",{className:"p-4 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[t.status==="success"?jsxRuntime.jsx(_e,{className:"text-green-600"}):jsxRuntime.jsx(je,{className:"text-red-600"}),jsxRuntime.jsx("span",{className:"font-medium text-sm",children:t.operation})]}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:t.timestamp})]}),t.error?jsxRuntime.jsx("p",{className:"text-xs text-red-600",children:t.error}):jsxRuntime.jsx("pre",{className:"text-xs bg-muted p-2 overflow-x-auto max-h-48",children:JSON.stringify(t.response,null,2)})]},t.id))})]})]})]}):jsxRuntime.jsxs("div",{className:`space-y-8 ${y}`,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Spaark Pay Console"}),jsxRuntime.jsx("p",{className:"text-muted-foreground mt-1",children:"Configurez vos identifiants PawaPay pour commencer"})]}),jsxRuntime.jsxs("div",{className:"border border-border bg-background p-6 max-w-md space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 bg-muted flex items-center justify-center",children:jsxRuntime.jsx(me,{})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"font-semibold",children:"SDK Configuration"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your API credentials"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"API Key"}),jsxRuntime.jsx("input",{type:"password",placeholder:"pk_sandbox_...",value:l,onChange:t=>I(t.target.value),className:"w-full h-8 px-2.5 text-xs border border-input bg-transparent rounded-none outline-none focus:border-ring"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-xs font-medium",children:"Environnement"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("button",{onClick:()=>h("sandbox"),className:`h-8 px-3 text-xs font-medium border transition-colors flex items-center gap-1.5 ${s==="sandbox"?"bg-blue-600 text-white border-blue-600":"bg-background border-border hover:bg-muted"}`,children:[jsxRuntime.jsx("span",{className:`w-2 h-2 rounded-full ${s==="sandbox"?"bg-blue-200":"bg-blue-500"}`}),"Sandbox"]}),jsxRuntime.jsxs("button",{onClick:()=>h("production"),className:`h-8 px-3 text-xs font-medium border transition-colors flex items-center gap-1.5 ${s==="production"?"bg-green-600 text-white border-green-600":"bg-background border-border hover:bg-muted"}`,children:[jsxRuntime.jsx("span",{className:`w-2 h-2 rounded-full ${s==="production"?"bg-green-200":"bg-green-500"}`}),"Production"]})]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:s==="sandbox"?"Utilisez le sandbox pour tester sans frais r\xE9els":"Attention : les transactions en production sont r\xE9elles"})]}),jsxRuntime.jsxs("button",{onClick:Ye,className:"w-full h-8 px-3 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(se,{}),"Initialize SDK"]}),jsxRuntime.jsxs("div",{className:"relative flex items-center py-2",children:[jsxRuntime.jsx("div",{className:"flex-grow border-t border-border"}),jsxRuntime.jsx("span",{className:"flex-shrink mx-3 text-xs text-muted-foreground",children:"ou"}),jsxRuntime.jsx("div",{className:"flex-grow border-t border-border"})]}),jsxRuntime.jsxs("button",{onClick:Ze,className:"w-full h-8 px-3 text-xs font-medium border border-border bg-background hover:bg-muted transition-colors flex items-center justify-center gap-2",children:[jsxRuntime.jsx(_t,{}),"Mode D\xE9mo (sans API key)"]})]})]})]})}var me=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),se=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),Le=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})}),Wt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),Fe=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),Q=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),We=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),_e=({className:n=""})=>jsxRuntime.jsx("svg",{className:`w-4 h-4 ${n}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),je=({className:n=""})=>jsxRuntime.jsx("svg",{className:`w-4 h-4 ${n}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),_t=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"})}),jt=()=>jsxRuntime.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),Gt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),Ut=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),Vt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})}),$t=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),Jt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),zt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),Bt=()=>jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),ea=Ft;exports.SpaarkPaySdkFinanceDashboard=Tt;exports.SpaarkPaySdkTestDashboard=Ft;exports.default=ea;//# sourceMappingURL=react.js.map
|
|
7
7
|
//# sourceMappingURL=react.js.map
|