@reevit/vue 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 +77 -7
- package/dist/components/PaymentMethodSelector.vue.d.ts +8 -0
- package/dist/components/ProviderSelector.vue.d.ts +1 -0
- package/dist/components/ReevitCheckout.vue.d.ts +3 -2
- package/dist/composables/useReevit.d.ts +10 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +869 -742
- package/dist/styles.css +1 -1
- package/dist/vue.css +1 -1
- package/package.json +4 -3
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 @reevit/core
|
|
8
|
+
npm install @reevit/vue@0.5.0 @reevit/core@0.5.0
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
@@ -48,6 +48,34 @@ const handleError = (error: any) => {
|
|
|
48
48
|
</template>
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
## Controlled Modal
|
|
52
|
+
|
|
53
|
+
You can control the open state yourself.
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<script setup>
|
|
57
|
+
const open = ref(false);
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<ReevitCheckout
|
|
62
|
+
publicKey="pk_test_your_key"
|
|
63
|
+
:amount="10000"
|
|
64
|
+
currency="GHS"
|
|
65
|
+
:isOpen="open"
|
|
66
|
+
@close="open = false"
|
|
67
|
+
/>
|
|
68
|
+
</template>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Success Screen Delay
|
|
72
|
+
|
|
73
|
+
By default, the checkout shows a success screen for 5 seconds before calling `@success` and closing. Override with `successDelayMs` (set to `0` for immediate close).
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<ReevitCheckout :successDelayMs="0" />
|
|
77
|
+
```
|
|
78
|
+
|
|
51
79
|
## Custom Theme
|
|
52
80
|
|
|
53
81
|
```vue
|
|
@@ -102,12 +130,43 @@ const {
|
|
|
102
130
|
|
|
103
131
|
| Prop | Type | Description |
|
|
104
132
|
|------|------|-------------|
|
|
105
|
-
| `publicKey` | `string` | Your project's public key |
|
|
106
|
-
| `amount` | `number` | Amount in smallest unit |
|
|
107
|
-
| `currency` | `string` | 3-letter currency code |
|
|
108
|
-
| `email` | `string` | Customer's email |
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
133
|
+
| `publicKey` | `string` | Your project's public key (required for API-created intents; optional when using `paymentLinkCode`) |
|
|
134
|
+
| `amount` | `number` | **Required**. Amount in the smallest unit (e.g., 500 for 5.00) |
|
|
135
|
+
| `currency` | `string` | **Required**. 3-letter ISO currency code (GHS, NGN, USD, etc.) |
|
|
136
|
+
| `email` | `string` | Customer's email address |
|
|
137
|
+
| `phone` | `string` | Customer's phone number (recommended for Mobile Money) |
|
|
138
|
+
| `customerName` | `string` | Customer name (used in payment links and some PSPs) |
|
|
139
|
+
| `reference` | `string` | Your own unique transaction reference |
|
|
140
|
+
| `metadata` | `object` | Key-value pairs to store with the transaction |
|
|
141
|
+
| `customFields` | `object` | Custom fields for payment links |
|
|
142
|
+
| `paymentLinkCode` | `string` | Hosted payment link code (uses the public link checkout flow) |
|
|
143
|
+
| `paymentMethods` | `PaymentMethod[]` | Enabled methods: `card`, `mobile_money`, `bank_transfer`, `apple_pay`, `google_pay` (PSP/country dependent) |
|
|
144
|
+
| `initialPaymentIntent` | `PaymentIntent` | Use an existing intent instead of creating a new one |
|
|
145
|
+
| `isOpen` | `boolean` | Controlled open state |
|
|
146
|
+
| `theme` | `ReevitTheme` | Customization options for the widget |
|
|
147
|
+
| `apiBaseUrl` | `string` | Override API base URL (self-hosted/testing) |
|
|
148
|
+
| `successDelayMs` | `number` | Delay before calling `@success` and closing (default `5000`) |
|
|
149
|
+
|
|
150
|
+
## Theme Reference
|
|
151
|
+
|
|
152
|
+
| Field | Description |
|
|
153
|
+
|-------|-------------|
|
|
154
|
+
| `primaryColor` | Primary text/brand color |
|
|
155
|
+
| `primaryForegroundColor` | Text color on primary brand surfaces |
|
|
156
|
+
| `backgroundColor` | Background color for the modal |
|
|
157
|
+
| `borderColor` | Border and divider color |
|
|
158
|
+
| `borderRadius` | Border radius for inputs and buttons |
|
|
159
|
+
| `darkMode` | Force dark mode when `true` |
|
|
160
|
+
| `logoUrl` | Logo URL shown in the header |
|
|
161
|
+
| `companyName` | Brand name shown in the header |
|
|
162
|
+
| `selectedBackgroundColor` | Background color for selected provider/methods |
|
|
163
|
+
| `selectedTextColor` | Primary text color for selected items |
|
|
164
|
+
| `selectedDescriptionColor` | Description/muted text color for selected items |
|
|
165
|
+
| `selectedBorderColor` | Border color for selected items |
|
|
166
|
+
| `pspSelectorBgColor` | PSP selector background color (where supported) |
|
|
167
|
+
| `pspSelectorTextColor` | PSP selector text color (where supported) |
|
|
168
|
+
| `pspSelectorBorderColor` | PSP selector border color (where supported) |
|
|
169
|
+
| `pspSelectorUseBorder` | Use border-only PSP selector styling |
|
|
111
170
|
|
|
112
171
|
## Events
|
|
113
172
|
|
|
@@ -178,6 +237,17 @@ const result = await initiateMPesaSTKPush(
|
|
|
178
237
|
);
|
|
179
238
|
```
|
|
180
239
|
|
|
240
|
+
## Supported PSPs
|
|
241
|
+
|
|
242
|
+
| Provider | Countries | Payment Methods |
|
|
243
|
+
|----------|-----------|-----------------|
|
|
244
|
+
| Paystack | NG, GH, ZA, KE | Card, Mobile Money, Bank Transfer |
|
|
245
|
+
| Flutterwave | NG, GH, KE, ZA + | Card, Mobile Money, Bank Transfer |
|
|
246
|
+
| Hubtel | GH | Mobile Money |
|
|
247
|
+
| Stripe | Global (50+) | Card, Apple Pay, Google Pay |
|
|
248
|
+
| Monnify | NG | Card, Bank Transfer, USSD |
|
|
249
|
+
| M-Pesa | KE, TZ | Mobile Money (STK Push) |
|
|
250
|
+
|
|
181
251
|
## License
|
|
182
252
|
|
|
183
253
|
MIT © Reevit
|
|
@@ -5,6 +5,14 @@ type __VLS_Props = {
|
|
|
5
5
|
provider?: string;
|
|
6
6
|
layout?: 'grid' | 'list';
|
|
7
7
|
showLabel?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
country?: string;
|
|
10
|
+
selectedTheme?: {
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
textColor?: string;
|
|
13
|
+
descriptionColor?: string;
|
|
14
|
+
borderColor?: string;
|
|
15
|
+
};
|
|
8
16
|
};
|
|
9
17
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
10
18
|
select: (method: PaymentMethod) => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReevitTheme } from '../../../core/src/index.ts';
|
|
1
|
+
import { ReevitTheme, PaymentMethod } from '../../../core/src/index.ts';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
publicKey?: string;
|
|
4
4
|
amount: number;
|
|
@@ -10,11 +10,12 @@ type __VLS_Props = {
|
|
|
10
10
|
metadata?: Record<string, unknown>;
|
|
11
11
|
customFields?: Record<string, unknown>;
|
|
12
12
|
paymentLinkCode?: string;
|
|
13
|
-
paymentMethods?:
|
|
13
|
+
paymentMethods?: PaymentMethod[];
|
|
14
14
|
theme?: ReevitTheme;
|
|
15
15
|
isOpen?: boolean;
|
|
16
16
|
apiBaseUrl?: string;
|
|
17
17
|
initialPaymentIntent?: any;
|
|
18
|
+
successDelayMs?: number;
|
|
18
19
|
};
|
|
19
20
|
declare function __VLS_template(): {
|
|
20
21
|
attrs: Partial<{}>;
|
|
@@ -20,7 +20,7 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
20
20
|
} | undefined;
|
|
21
21
|
readonly amount: number;
|
|
22
22
|
readonly currency: string;
|
|
23
|
-
readonly status: "pending" | "processing" | "succeeded" | "failed" | "cancelled";
|
|
23
|
+
readonly status: "pending" | "requires_action" | "processing" | "succeeded" | "failed" | "canceled" | "cancelled";
|
|
24
24
|
readonly recommendedPsp: PSPType;
|
|
25
25
|
readonly availableMethods: readonly PaymentMethod[];
|
|
26
26
|
readonly reference?: string | undefined;
|
|
@@ -54,6 +54,10 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
54
54
|
readonly pspSelectorTextColor?: string | undefined;
|
|
55
55
|
readonly pspSelectorBorderColor?: string | undefined;
|
|
56
56
|
readonly pspSelectorUseBorder?: boolean | undefined;
|
|
57
|
+
readonly selectedBackgroundColor?: string | undefined;
|
|
58
|
+
readonly selectedTextColor?: string | undefined;
|
|
59
|
+
readonly selectedDescriptionColor?: string | undefined;
|
|
60
|
+
readonly selectedBorderColor?: string | undefined;
|
|
57
61
|
} | undefined;
|
|
58
62
|
} | null, {
|
|
59
63
|
readonly id: string;
|
|
@@ -66,7 +70,7 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
66
70
|
} | undefined;
|
|
67
71
|
readonly amount: number;
|
|
68
72
|
readonly currency: string;
|
|
69
|
-
readonly status: "pending" | "processing" | "succeeded" | "failed" | "cancelled";
|
|
73
|
+
readonly status: "pending" | "requires_action" | "processing" | "succeeded" | "failed" | "canceled" | "cancelled";
|
|
70
74
|
readonly recommendedPsp: PSPType;
|
|
71
75
|
readonly availableMethods: readonly PaymentMethod[];
|
|
72
76
|
readonly reference?: string | undefined;
|
|
@@ -100,6 +104,10 @@ export declare function useReevit(options: UseReevitOptions): {
|
|
|
100
104
|
readonly pspSelectorTextColor?: string | undefined;
|
|
101
105
|
readonly pspSelectorBorderColor?: string | undefined;
|
|
102
106
|
readonly pspSelectorUseBorder?: boolean | undefined;
|
|
107
|
+
readonly selectedBackgroundColor?: string | undefined;
|
|
108
|
+
readonly selectedTextColor?: string | undefined;
|
|
109
|
+
readonly selectedDescriptionColor?: string | undefined;
|
|
110
|
+
readonly selectedBorderColor?: string | undefined;
|
|
103
111
|
} | undefined;
|
|
104
112
|
} | null>>;
|
|
105
113
|
selectedMethod: Readonly<import('vue').Ref<PaymentMethod | null, PaymentMethod | null>>;
|