@reevit/react 0.4.1 → 0.4.2

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 CHANGED
@@ -93,10 +93,16 @@ interface PaymentError {
93
93
  interface ReevitTheme {
94
94
  /** Primary brand color */
95
95
  primaryColor?: string;
96
+ /** Primary text color on brand surfaces */
97
+ primaryForegroundColor?: string;
96
98
  /** Background color */
97
99
  backgroundColor?: string;
100
+ /** Surface color for cards/panels */
101
+ surfaceColor?: string;
98
102
  /** Text color */
99
103
  textColor?: string;
104
+ /** Muted text color */
105
+ mutedTextColor?: string;
100
106
  /** Border radius for inputs and buttons */
101
107
  borderRadius?: string;
102
108
  /** Font family to use */
@@ -104,6 +110,12 @@ interface ReevitTheme {
104
110
  /** Whether to use dark mode */
105
111
  darkMode?: boolean;
106
112
  }
113
+ interface CheckoutProviderOption {
114
+ provider: string;
115
+ name: string;
116
+ methods: PaymentMethod[];
117
+ countries?: string[];
118
+ }
107
119
  interface MobileMoneyFormData {
108
120
  phone: string;
109
121
  network: MobileMoneyNetwork;
@@ -148,6 +160,10 @@ interface PaymentIntent {
148
160
  netAmount?: number;
149
161
  /** Additional metadata */
150
162
  metadata?: Record<string, unknown>;
163
+ /** Available PSPs for this checkout session */
164
+ availableProviders?: CheckoutProviderOption[];
165
+ /** Brand theme from checkout settings */
166
+ branding?: ReevitTheme;
151
167
  }
152
168
 
153
169
  interface ReevitContextValue {
@@ -195,7 +211,10 @@ declare function useReevit(options: UseReevitOptions): {
195
211
  selectedMethod: PaymentMethod | null;
196
212
  error: PaymentError | null;
197
213
  result: PaymentResult | null;
198
- initialize: (method?: PaymentMethod) => Promise<void>;
214
+ initialize: (method?: PaymentMethod, options?: {
215
+ preferredProvider?: string;
216
+ allowedProviders?: string[];
217
+ }) => Promise<void>;
199
218
  selectMethod: (method: PaymentMethod) => void;
200
219
  processPayment: (paymentData: Record<string, unknown>) => Promise<void>;
201
220
  handlePspSuccess: (pspData: Record<string, unknown>) => Promise<void>;
@@ -557,6 +576,13 @@ interface PaymentIntentResponse {
557
576
  fee_currency: string;
558
577
  net_amount: number;
559
578
  reference?: string;
579
+ available_psps?: Array<{
580
+ provider: string;
581
+ name: string;
582
+ methods: string[];
583
+ countries?: string[];
584
+ }>;
585
+ branding?: Record<string, unknown>;
560
586
  }
561
587
  /**
562
588
  * Response from creating a Hubtel session token.
@@ -619,7 +645,10 @@ declare class ReevitAPIClient {
619
645
  /**
620
646
  * Creates a payment intent
621
647
  */
622
- createPaymentIntent(config: ReevitCheckoutConfig, method: PaymentMethod, country?: string): Promise<{
648
+ createPaymentIntent(config: ReevitCheckoutConfig, method: PaymentMethod, country?: string, options?: {
649
+ preferredProviders?: string[];
650
+ allowedProviders?: string[];
651
+ }): Promise<{
623
652
  data?: PaymentIntentResponse;
624
653
  error?: PaymentError;
625
654
  }>;
package/dist/index.d.ts CHANGED
@@ -93,10 +93,16 @@ interface PaymentError {
93
93
  interface ReevitTheme {
94
94
  /** Primary brand color */
95
95
  primaryColor?: string;
96
+ /** Primary text color on brand surfaces */
97
+ primaryForegroundColor?: string;
96
98
  /** Background color */
97
99
  backgroundColor?: string;
100
+ /** Surface color for cards/panels */
101
+ surfaceColor?: string;
98
102
  /** Text color */
99
103
  textColor?: string;
104
+ /** Muted text color */
105
+ mutedTextColor?: string;
100
106
  /** Border radius for inputs and buttons */
101
107
  borderRadius?: string;
102
108
  /** Font family to use */
@@ -104,6 +110,12 @@ interface ReevitTheme {
104
110
  /** Whether to use dark mode */
105
111
  darkMode?: boolean;
106
112
  }
113
+ interface CheckoutProviderOption {
114
+ provider: string;
115
+ name: string;
116
+ methods: PaymentMethod[];
117
+ countries?: string[];
118
+ }
107
119
  interface MobileMoneyFormData {
108
120
  phone: string;
109
121
  network: MobileMoneyNetwork;
@@ -148,6 +160,10 @@ interface PaymentIntent {
148
160
  netAmount?: number;
149
161
  /** Additional metadata */
150
162
  metadata?: Record<string, unknown>;
163
+ /** Available PSPs for this checkout session */
164
+ availableProviders?: CheckoutProviderOption[];
165
+ /** Brand theme from checkout settings */
166
+ branding?: ReevitTheme;
151
167
  }
152
168
 
153
169
  interface ReevitContextValue {
@@ -195,7 +211,10 @@ declare function useReevit(options: UseReevitOptions): {
195
211
  selectedMethod: PaymentMethod | null;
196
212
  error: PaymentError | null;
197
213
  result: PaymentResult | null;
198
- initialize: (method?: PaymentMethod) => Promise<void>;
214
+ initialize: (method?: PaymentMethod, options?: {
215
+ preferredProvider?: string;
216
+ allowedProviders?: string[];
217
+ }) => Promise<void>;
199
218
  selectMethod: (method: PaymentMethod) => void;
200
219
  processPayment: (paymentData: Record<string, unknown>) => Promise<void>;
201
220
  handlePspSuccess: (pspData: Record<string, unknown>) => Promise<void>;
@@ -557,6 +576,13 @@ interface PaymentIntentResponse {
557
576
  fee_currency: string;
558
577
  net_amount: number;
559
578
  reference?: string;
579
+ available_psps?: Array<{
580
+ provider: string;
581
+ name: string;
582
+ methods: string[];
583
+ countries?: string[];
584
+ }>;
585
+ branding?: Record<string, unknown>;
560
586
  }
561
587
  /**
562
588
  * Response from creating a Hubtel session token.
@@ -619,7 +645,10 @@ declare class ReevitAPIClient {
619
645
  /**
620
646
  * Creates a payment intent
621
647
  */
622
- createPaymentIntent(config: ReevitCheckoutConfig, method: PaymentMethod, country?: string): Promise<{
648
+ createPaymentIntent(config: ReevitCheckoutConfig, method: PaymentMethod, country?: string, options?: {
649
+ preferredProviders?: string[];
650
+ allowedProviders?: string[];
651
+ }): Promise<{
623
652
  data?: PaymentIntentResponse;
624
653
  error?: PaymentError;
625
654
  }>;