@reevit/vue 0.5.1 → 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 +15 -1
- package/dist/bridges/loaders.d.ts +1 -0
- package/dist/composables/useReevit.d.ts +9 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +699 -621
- package/dist/styles.css +1 -1
- package/dist/vue.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Vue 3 SDK for integrating Reevit unified payments into your application.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @reevit/vue
|
|
8
|
+
npm install @reevit/vue @reevit/core
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
@@ -32,6 +32,7 @@ const handleError = (error: any) => {
|
|
|
32
32
|
:amount="10000"
|
|
33
33
|
currency="GHS"
|
|
34
34
|
email="customer@example.com"
|
|
35
|
+
idempotencyKey="order_12345"
|
|
35
36
|
@success="handleSuccess"
|
|
36
37
|
@error="handleError"
|
|
37
38
|
>
|
|
@@ -48,6 +49,19 @@ const handleError = (error: any) => {
|
|
|
48
49
|
</template>
|
|
49
50
|
```
|
|
50
51
|
|
|
52
|
+
## Idempotency
|
|
53
|
+
|
|
54
|
+
Provide an `idempotencyKey` tied to your order/cart to avoid duplicate intent creation and enable safe retries.
|
|
55
|
+
|
|
56
|
+
```vue
|
|
57
|
+
<ReevitCheckout
|
|
58
|
+
publicKey="pk_test_xxx"
|
|
59
|
+
:amount="10000"
|
|
60
|
+
currency="GHS"
|
|
61
|
+
idempotencyKey="order_12345"
|
|
62
|
+
/>
|
|
63
|
+
```
|
|
64
|
+
|
|
51
65
|
## Controlled Modal
|
|
52
66
|
|
|
53
67
|
You can control the open state yourself.
|
|
@@ -24,6 +24,7 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
24
24
|
readonly recommendedPsp: PSPType;
|
|
25
25
|
readonly availableMethods: readonly PaymentMethod[];
|
|
26
26
|
readonly reference?: string | undefined;
|
|
27
|
+
readonly orgId?: string | undefined;
|
|
27
28
|
readonly connectionId?: string | undefined;
|
|
28
29
|
readonly provider?: string | undefined;
|
|
29
30
|
readonly feeAmount?: number | undefined;
|
|
@@ -41,7 +42,10 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
41
42
|
readonly branding?: {
|
|
42
43
|
readonly primaryColor?: string | undefined;
|
|
43
44
|
readonly primaryForegroundColor?: string | undefined;
|
|
45
|
+
readonly buttonBackgroundColor?: string | undefined;
|
|
46
|
+
readonly buttonTextColor?: string | undefined;
|
|
44
47
|
readonly backgroundColor?: string | undefined;
|
|
48
|
+
readonly borderColor?: string | undefined;
|
|
45
49
|
readonly surfaceColor?: string | undefined;
|
|
46
50
|
readonly textColor?: string | undefined;
|
|
47
51
|
readonly mutedTextColor?: string | undefined;
|
|
@@ -74,6 +78,7 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
74
78
|
readonly recommendedPsp: PSPType;
|
|
75
79
|
readonly availableMethods: readonly PaymentMethod[];
|
|
76
80
|
readonly reference?: string | undefined;
|
|
81
|
+
readonly orgId?: string | undefined;
|
|
77
82
|
readonly connectionId?: string | undefined;
|
|
78
83
|
readonly provider?: string | undefined;
|
|
79
84
|
readonly feeAmount?: number | undefined;
|
|
@@ -91,7 +96,10 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
91
96
|
readonly branding?: {
|
|
92
97
|
readonly primaryColor?: string | undefined;
|
|
93
98
|
readonly primaryForegroundColor?: string | undefined;
|
|
99
|
+
readonly buttonBackgroundColor?: string | undefined;
|
|
100
|
+
readonly buttonTextColor?: string | undefined;
|
|
94
101
|
readonly backgroundColor?: string | undefined;
|
|
102
|
+
readonly borderColor?: string | undefined;
|
|
95
103
|
readonly surfaceColor?: string | undefined;
|
|
96
104
|
readonly textColor?: string | undefined;
|
|
97
105
|
readonly mutedTextColor?: string | undefined;
|
|
@@ -167,7 +175,7 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
167
175
|
processPayment: (paymentData: Record<string, unknown>) => Promise<void>;
|
|
168
176
|
handlePspSuccess: (pspData: Record<string, unknown>) => Promise<void>;
|
|
169
177
|
handlePspError: (error: PaymentError) => void;
|
|
170
|
-
reset: () => void
|
|
178
|
+
reset: () => Promise<void>;
|
|
171
179
|
close: () => Promise<void>;
|
|
172
180
|
isLoading: Readonly<import('vue').Ref<boolean, boolean>>;
|
|
173
181
|
isReady: Readonly<import('vue').Ref<boolean, boolean>>;
|