@reevit/svelte 0.5.9 → 0.6.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 +16 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1453 -1449
- package/dist/stores/reevit.d.ts.map +1 -1
- package/package.json +2 -2
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
|
|
8
|
+
npm install @reevit/svelte @reevit/core
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
@@ -31,6 +31,7 @@ The simplest way to integrate Reevit is using the `ReevitCheckout` component.
|
|
|
31
31
|
amount={10000}
|
|
32
32
|
currency="GHS"
|
|
33
33
|
email="customer@example.com"
|
|
34
|
+
idempotencyKey="order_12345"
|
|
34
35
|
on:success={handleSuccess}
|
|
35
36
|
on:error={handleError}
|
|
36
37
|
>
|
|
@@ -40,6 +41,19 @@ The simplest way to integrate Reevit is using the `ReevitCheckout` component.
|
|
|
40
41
|
</ReevitCheckout>
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
## Idempotency
|
|
45
|
+
|
|
46
|
+
Provide an `idempotencyKey` tied to your order/cart to avoid duplicate intent creation and enable safe retries.
|
|
47
|
+
|
|
48
|
+
```svelte
|
|
49
|
+
<ReevitCheckout
|
|
50
|
+
publicKey="pk_test_xxx"
|
|
51
|
+
amount={10000}
|
|
52
|
+
currency="GHS"
|
|
53
|
+
idempotencyKey="order_12345"
|
|
54
|
+
/>
|
|
55
|
+
```
|
|
56
|
+
|
|
43
57
|
## Controlled Modal
|
|
44
58
|
|
|
45
59
|
You can control the open state yourself.
|
|
@@ -122,6 +136,7 @@ For full control over the payment flow, use the `createReevitStore` factory.
|
|
|
122
136
|
| `phone` | `string` | Customer's phone number (recommended for Mobile Money) |
|
|
123
137
|
| `customerName` | `string` | Customer name (used in payment links and some PSPs) |
|
|
124
138
|
| `reference` | `string` | Your own unique transaction reference |
|
|
139
|
+
| `idempotencyKey` | `string` | Optional idempotency key to safely retry or dedupe intent creation |
|
|
125
140
|
| `metadata` | `object` | Key-value pairs to store with the transaction |
|
|
126
141
|
| `customFields` | `object` | Custom fields for payment links |
|
|
127
142
|
| `paymentLinkCode` | `string` | Hosted payment link code (uses the public link checkout flow) |
|