@reevit/svelte 0.4.8 → 0.5.0

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 CHANGED
@@ -5,7 +5,7 @@ Svelte SDK for integrating Reevit unified payments into your application.
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @reevit/svelte @reevit/core
8
+ npm install @reevit/svelte@0.5.0 @reevit/core@0.5.0
9
9
  ```
10
10
 
11
11
  ## Quick Start
@@ -40,6 +40,32 @@ The simplest way to integrate Reevit is using the `ReevitCheckout` component.
40
40
  </ReevitCheckout>
41
41
  ```
42
42
 
43
+ ## Controlled Modal
44
+
45
+ You can control the open state yourself.
46
+
47
+ ```svelte
48
+ <script>
49
+ let open = false;
50
+ </script>
51
+
52
+ <ReevitCheckout
53
+ publicKey="pk_test_your_key"
54
+ amount={10000}
55
+ currency="GHS"
56
+ bind:isOpen={open}
57
+ on:close={() => open = false}
58
+ />
59
+ ```
60
+
61
+ ## Success Screen Delay
62
+
63
+ By default, the checkout shows a success screen for 5 seconds before calling `on:success` and closing. Override with `successDelayMs` (set to `0` for immediate close).
64
+
65
+ ```svelte
66
+ <ReevitCheckout successDelayMs={0} />
67
+ ```
68
+
43
69
  ## Custom Theme
44
70
 
45
71
  ```svelte
@@ -89,12 +115,43 @@ For full control over the payment flow, use the `createReevitStore` factory.
89
115
 
90
116
  | Prop | Type | Description |
91
117
  |------|------|-------------|
92
- | `publicKey` | `string` | Your project's public key |
93
- | `amount` | `number` | Amount in smallest unit |
94
- | `currency` | `string` | 3-letter currency code |
95
- | `email` | `string` | Customer's email |
96
- | `theme` | `ReevitTheme` | Customization options |
97
- | `isOpen` | `boolean` | Control modal visibility manually |
118
+ | `publicKey` | `string` | Your project's public key (required for API-created intents; optional when using `paymentLinkCode`) |
119
+ | `amount` | `number` | **Required**. Amount in the smallest unit (e.g., 500 for 5.00) |
120
+ | `currency` | `string` | **Required**. 3-letter ISO currency code (GHS, NGN, USD, etc.) |
121
+ | `email` | `string` | Customer's email address |
122
+ | `phone` | `string` | Customer's phone number (recommended for Mobile Money) |
123
+ | `customerName` | `string` | Customer name (used in payment links and some PSPs) |
124
+ | `reference` | `string` | Your own unique transaction reference |
125
+ | `metadata` | `object` | Key-value pairs to store with the transaction |
126
+ | `customFields` | `object` | Custom fields for payment links |
127
+ | `paymentLinkCode` | `string` | Hosted payment link code (uses the public link checkout flow) |
128
+ | `paymentMethods` | `PaymentMethod[]` | Enabled methods: `card`, `mobile_money`, `bank_transfer`, `apple_pay`, `google_pay` (PSP/country dependent) |
129
+ | `initialPaymentIntent` | `PaymentIntent` | Use an existing intent instead of creating a new one |
130
+ | `isOpen` | `boolean` | Controlled open state |
131
+ | `theme` | `ReevitTheme` | Customization options for the widget |
132
+ | `apiBaseUrl` | `string` | Override API base URL (self-hosted/testing) |
133
+ | `successDelayMs` | `number` | Delay before calling `on:success` and closing (default `5000`) |
134
+
135
+ ## Theme Reference
136
+
137
+ | Field | Description |
138
+ |-------|-------------|
139
+ | `primaryColor` | Primary text/brand color |
140
+ | `primaryForegroundColor` | Text color on primary brand surfaces |
141
+ | `backgroundColor` | Background color for the modal |
142
+ | `borderColor` | Border and divider color |
143
+ | `borderRadius` | Border radius for inputs and buttons |
144
+ | `darkMode` | Force dark mode when `true` |
145
+ | `logoUrl` | Logo URL shown in the header |
146
+ | `companyName` | Brand name shown in the header |
147
+ | `selectedBackgroundColor` | Background color for selected provider/methods |
148
+ | `selectedTextColor` | Primary text color for selected items |
149
+ | `selectedDescriptionColor` | Description/muted text color for selected items |
150
+ | `selectedBorderColor` | Border color for selected items |
151
+ | `pspSelectorBgColor` | PSP selector background color (where supported) |
152
+ | `pspSelectorTextColor` | PSP selector text color (where supported) |
153
+ | `pspSelectorBorderColor` | PSP selector border color (where supported) |
154
+ | `pspSelectorUseBorder` | Use border-only PSP selector styling |
98
155
 
99
156
  ## Events
100
157
 
@@ -162,6 +219,17 @@ const result = await initiateMPesaSTKPush(
162
219
  );
163
220
  ```
164
221
 
222
+ ## Supported PSPs
223
+
224
+ | Provider | Countries | Payment Methods |
225
+ |----------|-----------|-----------------|
226
+ | Paystack | NG, GH, ZA, KE | Card, Mobile Money, Bank Transfer |
227
+ | Flutterwave | NG, GH, KE, ZA + | Card, Mobile Money, Bank Transfer |
228
+ | Hubtel | GH | Mobile Money |
229
+ | Stripe | Global (50+) | Card, Apple Pay, Google Pay |
230
+ | Monnify | NG | Card, Bank Transfer, USSD |
231
+ | M-Pesa | KE, TZ | Mobile Money (STK Push) |
232
+
165
233
  ## License
166
234
 
167
235
  MIT © Reevit