@reevit/react 0.3.2 → 0.3.3
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 +19 -6
- package/dist/index.d.ts +19 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- 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 */
|
|
@@ -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 */
|
|
@@ -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.js
CHANGED
|
@@ -113,7 +113,7 @@ var ReevitAPIClient = class {
|
|
|
113
113
|
"Content-Type": "application/json",
|
|
114
114
|
"X-Reevit-Key": this.publicKey,
|
|
115
115
|
"X-Reevit-Client": "@reevit/react",
|
|
116
|
-
"X-Reevit-Client-Version": "0.2
|
|
116
|
+
"X-Reevit-Client-Version": "0.3.2"
|
|
117
117
|
};
|
|
118
118
|
if (method === "POST" || method === "PATCH" || method === "PUT") {
|
|
119
119
|
headers["Idempotency-Key"] = `${Date.now()}-${Math.random().toString(36).substring(2, 15)}`;
|