spaark-payapi-sdk 1.2.0 → 1.2.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 +56 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,8 +47,9 @@ console.log(deposit.depositId, deposit.status);
|
|
|
47
47
|
- **Toolkit**: Predict Provider, Active Configuration, Provider Availability
|
|
48
48
|
- **Finances**: Wallet Balances, Statement Generation
|
|
49
49
|
- **Webhooks**: Signature verification, Event parsing
|
|
50
|
-
- **React
|
|
50
|
+
- **React Components**: Test dashboard + Finance dashboard
|
|
51
51
|
- **Full TypeScript**: Complete type definitions
|
|
52
|
+
- **i18n**: French/English support
|
|
52
53
|
|
|
53
54
|
## Supported Providers
|
|
54
55
|
|
|
@@ -284,12 +285,12 @@ const provider = sdk.utils.detectCorrespondent('237670000000');
|
|
|
284
285
|
const limits = await sdk.utils.getTransactionLimits('MTN_MOMO_CMR');
|
|
285
286
|
```
|
|
286
287
|
|
|
287
|
-
## React
|
|
288
|
+
## React Components
|
|
288
289
|
|
|
289
|
-
|
|
290
|
-
'use client';
|
|
290
|
+
### Test Dashboard
|
|
291
291
|
|
|
292
|
-
|
|
292
|
+
```tsx
|
|
293
|
+
import { PawapayTestDashboard } from 'spaark-payapi-sdk/react';
|
|
293
294
|
|
|
294
295
|
export default function TestPage() {
|
|
295
296
|
return (
|
|
@@ -307,6 +308,54 @@ export default function TestPage() {
|
|
|
307
308
|
|
|
308
309
|
Use `demoMode={true}` to test without API key.
|
|
309
310
|
|
|
311
|
+
### Finance Dashboard
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import {
|
|
315
|
+
SpaarkPaySdkFinanceDashboard,
|
|
316
|
+
type Transaction
|
|
317
|
+
} from 'spaark-payapi-sdk/react';
|
|
318
|
+
|
|
319
|
+
const transactions: Transaction[] = [
|
|
320
|
+
{
|
|
321
|
+
id: 'tx-001',
|
|
322
|
+
type: 'deposit',
|
|
323
|
+
amount: 5000,
|
|
324
|
+
currency: 'XAF',
|
|
325
|
+
status: 'COMPLETED',
|
|
326
|
+
provider: 'MTN_MOMO_CMR',
|
|
327
|
+
phoneNumber: '237670000000',
|
|
328
|
+
createdAt: '2025-01-15T10:00:00Z',
|
|
329
|
+
},
|
|
330
|
+
// ... more transactions
|
|
331
|
+
];
|
|
332
|
+
|
|
333
|
+
export default function FinancePage() {
|
|
334
|
+
return (
|
|
335
|
+
<SpaarkPaySdkFinanceDashboard
|
|
336
|
+
transactions={transactions}
|
|
337
|
+
title="My Finance Dashboard" // Customizable
|
|
338
|
+
locale="fr" // 'fr' | 'en'
|
|
339
|
+
onRefresh={() => fetchData()} // Refresh button handler
|
|
340
|
+
onTransactionClick={(tx) => {}} // Row click handler
|
|
341
|
+
onExpertModeClick={() => {}} // Expert mode button
|
|
342
|
+
showExpertMode={true} // Show/hide expert button
|
|
343
|
+
isLoading={false} // Loading state
|
|
344
|
+
/>
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Features:**
|
|
350
|
+
- 5 KPI cards (Total Volume, Deposits, Payouts, Failed, Refunds)
|
|
351
|
+
- Search by transaction ID or phone number
|
|
352
|
+
- Filter by type (deposit/payout/refund) and status
|
|
353
|
+
- Paginated transactions table
|
|
354
|
+
- Copy transaction ID to clipboard
|
|
355
|
+
- i18n support (French/English)
|
|
356
|
+
- Customizable title
|
|
357
|
+
- Expert Mode button integration
|
|
358
|
+
|
|
310
359
|
## TypeScript Types
|
|
311
360
|
|
|
312
361
|
```typescript
|
|
@@ -320,6 +369,8 @@ import type {
|
|
|
320
369
|
TransactionStatusResponse,
|
|
321
370
|
Correspondent,
|
|
322
371
|
Currency,
|
|
372
|
+
Transaction,
|
|
373
|
+
TransactionType,
|
|
323
374
|
// ... and more
|
|
324
375
|
} from 'spaark-payapi-sdk';
|
|
325
376
|
```
|
package/package.json
CHANGED