@reevit/react 0.3.2 → 0.3.4
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/dist/index.d.mts +20 -7
- package/dist/index.d.ts +20 -7
- package/dist/index.js +689 -553
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +689 -553
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
* Core type definitions for the unified payment widget
|
|
6
|
-
*/
|
|
4
|
+
/** Minimal ReactNode-compatible type to avoid hard dependency on @types/react */
|
|
5
|
+
type ReevitReactNode = ReactNode;
|
|
7
6
|
type PaymentMethod = 'card' | 'mobile_money' | 'bank_transfer';
|
|
8
7
|
type MobileMoneyNetwork = 'mtn' | 'vodafone' | 'airteltigo';
|
|
8
|
+
/** Payment source type - indicates where the payment originated from */
|
|
9
|
+
type PaymentSource = 'payment_link' | 'api' | 'subscription';
|
|
9
10
|
interface ReevitCheckoutConfig {
|
|
10
11
|
/** Your Reevit public key (pk_live_xxx or pk_test_xxx) */
|
|
11
12
|
publicKey: string;
|
|
@@ -38,7 +39,7 @@ interface ReevitCheckoutCallbacks {
|
|
|
38
39
|
}
|
|
39
40
|
interface ReevitCheckoutProps extends ReevitCheckoutConfig, ReevitCheckoutCallbacks {
|
|
40
41
|
/** Custom trigger element */
|
|
41
|
-
children?:
|
|
42
|
+
children?: ReevitReactNode;
|
|
42
43
|
/** Whether to open automatically */
|
|
43
44
|
autoOpen?: boolean;
|
|
44
45
|
/** Controlled open state */
|
|
@@ -70,6 +71,12 @@ interface PaymentResult {
|
|
|
70
71
|
status: 'success' | 'pending';
|
|
71
72
|
/** Any additional data from the PSP */
|
|
72
73
|
metadata?: Record<string, unknown>;
|
|
74
|
+
/** Payment source type (payment_link, api, subscription) */
|
|
75
|
+
source?: PaymentSource;
|
|
76
|
+
/** ID of the source (payment link ID, subscription ID, etc.) */
|
|
77
|
+
sourceId?: string;
|
|
78
|
+
/** Human-readable description of the source (e.g., payment link name) */
|
|
79
|
+
sourceDescription?: string;
|
|
73
80
|
}
|
|
74
81
|
interface PaymentError {
|
|
75
82
|
/** Error code */
|
|
@@ -115,7 +122,7 @@ interface PaymentIntent {
|
|
|
115
122
|
/** Payment status */
|
|
116
123
|
status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'cancelled';
|
|
117
124
|
/** Recommended PSP based on routing rules */
|
|
118
|
-
recommendedPsp: 'paystack' | 'hubtel' | 'flutterwave';
|
|
125
|
+
recommendedPsp: 'paystack' | 'hubtel' | 'flutterwave' | 'monnify' | 'mpesa' | 'stripe';
|
|
119
126
|
/** Available payment methods for this intent */
|
|
120
127
|
availableMethods: PaymentMethod[];
|
|
121
128
|
/** Reference provided or generated */
|
|
@@ -564,6 +571,12 @@ interface PaymentDetailResponse {
|
|
|
564
571
|
metadata?: Record<string, unknown>;
|
|
565
572
|
created_at: string;
|
|
566
573
|
updated_at: string;
|
|
574
|
+
/** Payment source type (payment_link, api, subscription) */
|
|
575
|
+
source?: 'payment_link' | 'api' | 'subscription';
|
|
576
|
+
/** ID of the source (payment link ID, subscription ID, etc.) */
|
|
577
|
+
source_id?: string;
|
|
578
|
+
/** Human-readable description of the source (e.g., payment link name) */
|
|
579
|
+
source_description?: string;
|
|
567
580
|
}
|
|
568
581
|
interface ReevitAPIClientConfig {
|
|
569
582
|
/** Your Reevit public key */
|
|
@@ -650,4 +663,4 @@ declare function formatPhone(phone: string): string;
|
|
|
650
663
|
*/
|
|
651
664
|
declare function detectNetwork(phone: string): string | null;
|
|
652
665
|
|
|
653
|
-
export { type CheckoutState, FlutterwaveBridge, HubtelBridge, MPesaBridge, type MPesaBridgeProps, MobileMoneyForm, type MobileMoneyFormData, type MobileMoneyNetwork, MonnifyBridge, type MonnifyBridgeProps, type PaymentDetailResponse, type PaymentError, type PaymentIntent, type PaymentIntentResponse, type PaymentMethod, PaymentMethodSelector, type PaymentResult, PaystackBridge, ReevitAPIClient, type ReevitAPIClientConfig, ReevitCheckout, type ReevitCheckoutCallbacks, type ReevitCheckoutConfig, type ReevitCheckoutProps, type ReevitTheme, StripeBridge, type StripeBridgeProps, createReevitClient, detectNetwork, formatAmount, formatPhone, loadFlutterwaveScript, loadHubtelScript, loadMonnifyScript, loadPaystackScript, loadStripeScript, useMPesaStatusPolling, useReevit, useReevitContext, validatePhone };
|
|
666
|
+
export { type CheckoutState, FlutterwaveBridge, HubtelBridge, MPesaBridge, type MPesaBridgeProps, MobileMoneyForm, type MobileMoneyFormData, type MobileMoneyNetwork, MonnifyBridge, type MonnifyBridgeProps, type PaymentDetailResponse, type PaymentError, type PaymentIntent, type PaymentIntentResponse, type PaymentMethod, PaymentMethodSelector, type PaymentResult, type PaymentSource, PaystackBridge, ReevitAPIClient, type ReevitAPIClientConfig, ReevitCheckout, type ReevitCheckoutCallbacks, type ReevitCheckoutConfig, type ReevitCheckoutProps, type ReevitTheme, StripeBridge, type StripeBridgeProps, createReevitClient, detectNetwork, formatAmount, formatPhone, loadFlutterwaveScript, loadHubtelScript, loadMonnifyScript, loadPaystackScript, loadStripeScript, useMPesaStatusPolling, useReevit, useReevitContext, validatePhone };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
* Core type definitions for the unified payment widget
|
|
6
|
-
*/
|
|
4
|
+
/** Minimal ReactNode-compatible type to avoid hard dependency on @types/react */
|
|
5
|
+
type ReevitReactNode = ReactNode;
|
|
7
6
|
type PaymentMethod = 'card' | 'mobile_money' | 'bank_transfer';
|
|
8
7
|
type MobileMoneyNetwork = 'mtn' | 'vodafone' | 'airteltigo';
|
|
8
|
+
/** Payment source type - indicates where the payment originated from */
|
|
9
|
+
type PaymentSource = 'payment_link' | 'api' | 'subscription';
|
|
9
10
|
interface ReevitCheckoutConfig {
|
|
10
11
|
/** Your Reevit public key (pk_live_xxx or pk_test_xxx) */
|
|
11
12
|
publicKey: string;
|
|
@@ -38,7 +39,7 @@ interface ReevitCheckoutCallbacks {
|
|
|
38
39
|
}
|
|
39
40
|
interface ReevitCheckoutProps extends ReevitCheckoutConfig, ReevitCheckoutCallbacks {
|
|
40
41
|
/** Custom trigger element */
|
|
41
|
-
children?:
|
|
42
|
+
children?: ReevitReactNode;
|
|
42
43
|
/** Whether to open automatically */
|
|
43
44
|
autoOpen?: boolean;
|
|
44
45
|
/** Controlled open state */
|
|
@@ -70,6 +71,12 @@ interface PaymentResult {
|
|
|
70
71
|
status: 'success' | 'pending';
|
|
71
72
|
/** Any additional data from the PSP */
|
|
72
73
|
metadata?: Record<string, unknown>;
|
|
74
|
+
/** Payment source type (payment_link, api, subscription) */
|
|
75
|
+
source?: PaymentSource;
|
|
76
|
+
/** ID of the source (payment link ID, subscription ID, etc.) */
|
|
77
|
+
sourceId?: string;
|
|
78
|
+
/** Human-readable description of the source (e.g., payment link name) */
|
|
79
|
+
sourceDescription?: string;
|
|
73
80
|
}
|
|
74
81
|
interface PaymentError {
|
|
75
82
|
/** Error code */
|
|
@@ -115,7 +122,7 @@ interface PaymentIntent {
|
|
|
115
122
|
/** Payment status */
|
|
116
123
|
status: 'pending' | 'processing' | 'succeeded' | 'failed' | 'cancelled';
|
|
117
124
|
/** Recommended PSP based on routing rules */
|
|
118
|
-
recommendedPsp: 'paystack' | 'hubtel' | 'flutterwave';
|
|
125
|
+
recommendedPsp: 'paystack' | 'hubtel' | 'flutterwave' | 'monnify' | 'mpesa' | 'stripe';
|
|
119
126
|
/** Available payment methods for this intent */
|
|
120
127
|
availableMethods: PaymentMethod[];
|
|
121
128
|
/** Reference provided or generated */
|
|
@@ -564,6 +571,12 @@ interface PaymentDetailResponse {
|
|
|
564
571
|
metadata?: Record<string, unknown>;
|
|
565
572
|
created_at: string;
|
|
566
573
|
updated_at: string;
|
|
574
|
+
/** Payment source type (payment_link, api, subscription) */
|
|
575
|
+
source?: 'payment_link' | 'api' | 'subscription';
|
|
576
|
+
/** ID of the source (payment link ID, subscription ID, etc.) */
|
|
577
|
+
source_id?: string;
|
|
578
|
+
/** Human-readable description of the source (e.g., payment link name) */
|
|
579
|
+
source_description?: string;
|
|
567
580
|
}
|
|
568
581
|
interface ReevitAPIClientConfig {
|
|
569
582
|
/** Your Reevit public key */
|
|
@@ -650,4 +663,4 @@ declare function formatPhone(phone: string): string;
|
|
|
650
663
|
*/
|
|
651
664
|
declare function detectNetwork(phone: string): string | null;
|
|
652
665
|
|
|
653
|
-
export { type CheckoutState, FlutterwaveBridge, HubtelBridge, MPesaBridge, type MPesaBridgeProps, MobileMoneyForm, type MobileMoneyFormData, type MobileMoneyNetwork, MonnifyBridge, type MonnifyBridgeProps, type PaymentDetailResponse, type PaymentError, type PaymentIntent, type PaymentIntentResponse, type PaymentMethod, PaymentMethodSelector, type PaymentResult, PaystackBridge, ReevitAPIClient, type ReevitAPIClientConfig, ReevitCheckout, type ReevitCheckoutCallbacks, type ReevitCheckoutConfig, type ReevitCheckoutProps, type ReevitTheme, StripeBridge, type StripeBridgeProps, createReevitClient, detectNetwork, formatAmount, formatPhone, loadFlutterwaveScript, loadHubtelScript, loadMonnifyScript, loadPaystackScript, loadStripeScript, useMPesaStatusPolling, useReevit, useReevitContext, validatePhone };
|
|
666
|
+
export { type CheckoutState, FlutterwaveBridge, HubtelBridge, MPesaBridge, type MPesaBridgeProps, MobileMoneyForm, type MobileMoneyFormData, type MobileMoneyNetwork, MonnifyBridge, type MonnifyBridgeProps, type PaymentDetailResponse, type PaymentError, type PaymentIntent, type PaymentIntentResponse, type PaymentMethod, PaymentMethodSelector, type PaymentResult, type PaymentSource, PaystackBridge, ReevitAPIClient, type ReevitAPIClientConfig, ReevitCheckout, type ReevitCheckoutCallbacks, type ReevitCheckoutConfig, type ReevitCheckoutProps, type ReevitTheme, StripeBridge, type StripeBridgeProps, createReevitClient, detectNetwork, formatAmount, formatPhone, loadFlutterwaveScript, loadHubtelScript, loadMonnifyScript, loadPaystackScript, loadStripeScript, useMPesaStatusPolling, useReevit, useReevitContext, validatePhone };
|