@reevit/react 0.4.1 → 0.4.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 CHANGED
@@ -93,16 +93,38 @@ 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 */
103
109
  fontFamily?: string;
104
110
  /** Whether to use dark mode */
105
111
  darkMode?: boolean;
112
+ /** Custom logo URL to display in checkout header */
113
+ logoUrl?: string;
114
+ /** PSP selector background color */
115
+ pspSelectorBgColor?: string;
116
+ /** PSP selector text color */
117
+ pspSelectorTextColor?: string;
118
+ /** PSP selector border color */
119
+ pspSelectorBorderColor?: string;
120
+ /** Use border-only style for PSP selector (no filled background) */
121
+ pspSelectorUseBorder?: boolean;
122
+ }
123
+ interface CheckoutProviderOption {
124
+ provider: string;
125
+ name: string;
126
+ methods: PaymentMethod[];
127
+ countries?: string[];
106
128
  }
107
129
  interface MobileMoneyFormData {
108
130
  phone: string;
@@ -148,6 +170,10 @@ interface PaymentIntent {
148
170
  netAmount?: number;
149
171
  /** Additional metadata */
150
172
  metadata?: Record<string, unknown>;
173
+ /** Available PSPs for this checkout session */
174
+ availableProviders?: CheckoutProviderOption[];
175
+ /** Brand theme from checkout settings */
176
+ branding?: ReevitTheme;
151
177
  }
152
178
 
153
179
  interface ReevitContextValue {
@@ -164,16 +190,19 @@ interface PaymentMethodSelectorProps {
164
190
  onSelect: (method: PaymentMethod) => void;
165
191
  disabled?: boolean;
166
192
  provider?: string;
193
+ layout?: 'grid' | 'list';
194
+ showLabel?: boolean;
167
195
  }
168
- declare function PaymentMethodSelector({ methods, selectedMethod, onSelect, disabled, provider, }: PaymentMethodSelectorProps): react_jsx_runtime.JSX.Element;
196
+ declare function PaymentMethodSelector({ methods, selectedMethod, onSelect, disabled, provider, layout, showLabel, }: PaymentMethodSelectorProps): react_jsx_runtime.JSX.Element;
169
197
 
170
198
  interface MobileMoneyFormProps {
171
199
  onSubmit: (data: MobileMoneyFormData) => void;
172
- onCancel: () => void;
200
+ onCancel?: () => void;
173
201
  isLoading?: boolean;
174
202
  initialPhone?: string;
203
+ hideCancel?: boolean;
175
204
  }
176
- declare function MobileMoneyForm({ onSubmit, onCancel, isLoading, initialPhone, }: MobileMoneyFormProps): react_jsx_runtime.JSX.Element;
205
+ declare function MobileMoneyForm({ onSubmit, onCancel, isLoading, initialPhone, hideCancel, }: MobileMoneyFormProps): react_jsx_runtime.JSX.Element;
177
206
 
178
207
  /**
179
208
  * useReevit hook
@@ -195,7 +224,10 @@ declare function useReevit(options: UseReevitOptions): {
195
224
  selectedMethod: PaymentMethod | null;
196
225
  error: PaymentError | null;
197
226
  result: PaymentResult | null;
198
- initialize: (method?: PaymentMethod) => Promise<void>;
227
+ initialize: (method?: PaymentMethod, options?: {
228
+ preferredProvider?: string;
229
+ allowedProviders?: string[];
230
+ }) => Promise<void>;
199
231
  selectMethod: (method: PaymentMethod) => void;
200
232
  processPayment: (paymentData: Record<string, unknown>) => Promise<void>;
201
233
  handlePspSuccess: (pspData: Record<string, unknown>) => Promise<void>;
@@ -272,12 +304,13 @@ interface HubtelBridgeProps {
272
304
  hubtelSessionToken?: string;
273
305
  /** Basic auth credential (legacy - credentials exposed to client, deprecated) */
274
306
  basicAuth?: string;
307
+ preferredMethod?: PaymentMethod;
275
308
  onSuccess: (result: PaymentResult) => void;
276
309
  onError: (error: PaymentError) => void;
277
310
  onClose: () => void;
278
311
  autoStart?: boolean;
279
312
  }
280
- declare function HubtelBridge({ paymentId, publicKey, merchantAccount, amount, reference, phone, description, callbackUrl, hubtelSessionToken, basicAuth, onSuccess, onError, onClose, autoStart, }: HubtelBridgeProps): react_jsx_runtime.JSX.Element;
313
+ declare function HubtelBridge({ paymentId, publicKey, merchantAccount, amount, reference, phone, description, callbackUrl, hubtelSessionToken, basicAuth, preferredMethod, onSuccess, onError, onClose, autoStart, }: HubtelBridgeProps): react_jsx_runtime.JSX.Element;
281
314
  /**
282
315
  * Opens Hubtel checkout modal directly
283
316
  * Uses the @hubteljs/checkout npm package
@@ -290,6 +323,7 @@ declare function openHubtelPopup(config: {
290
323
  callbackUrl?: string;
291
324
  customerPhoneNumber?: string;
292
325
  basicAuth?: string;
326
+ preferredMethod?: PaymentMethod;
293
327
  onSuccess?: (data: Record<string, unknown>) => void;
294
328
  onError?: (data: Record<string, unknown>) => void;
295
329
  onClose?: () => void;
@@ -557,6 +591,13 @@ interface PaymentIntentResponse {
557
591
  fee_currency: string;
558
592
  net_amount: number;
559
593
  reference?: string;
594
+ available_psps?: Array<{
595
+ provider: string;
596
+ name: string;
597
+ methods: string[];
598
+ countries?: string[];
599
+ }>;
600
+ branding?: Record<string, unknown>;
560
601
  }
561
602
  /**
562
603
  * Response from creating a Hubtel session token.
@@ -619,7 +660,10 @@ declare class ReevitAPIClient {
619
660
  /**
620
661
  * Creates a payment intent
621
662
  */
622
- createPaymentIntent(config: ReevitCheckoutConfig, method: PaymentMethod, country?: string): Promise<{
663
+ createPaymentIntent(config: ReevitCheckoutConfig, method: PaymentMethod, country?: string, options?: {
664
+ preferredProviders?: string[];
665
+ allowedProviders?: string[];
666
+ }): Promise<{
623
667
  data?: PaymentIntentResponse;
624
668
  error?: PaymentError;
625
669
  }>;
package/dist/index.d.ts CHANGED
@@ -93,16 +93,38 @@ 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 */
103
109
  fontFamily?: string;
104
110
  /** Whether to use dark mode */
105
111
  darkMode?: boolean;
112
+ /** Custom logo URL to display in checkout header */
113
+ logoUrl?: string;
114
+ /** PSP selector background color */
115
+ pspSelectorBgColor?: string;
116
+ /** PSP selector text color */
117
+ pspSelectorTextColor?: string;
118
+ /** PSP selector border color */
119
+ pspSelectorBorderColor?: string;
120
+ /** Use border-only style for PSP selector (no filled background) */
121
+ pspSelectorUseBorder?: boolean;
122
+ }
123
+ interface CheckoutProviderOption {
124
+ provider: string;
125
+ name: string;
126
+ methods: PaymentMethod[];
127
+ countries?: string[];
106
128
  }
107
129
  interface MobileMoneyFormData {
108
130
  phone: string;
@@ -148,6 +170,10 @@ interface PaymentIntent {
148
170
  netAmount?: number;
149
171
  /** Additional metadata */
150
172
  metadata?: Record<string, unknown>;
173
+ /** Available PSPs for this checkout session */
174
+ availableProviders?: CheckoutProviderOption[];
175
+ /** Brand theme from checkout settings */
176
+ branding?: ReevitTheme;
151
177
  }
152
178
 
153
179
  interface ReevitContextValue {
@@ -164,16 +190,19 @@ interface PaymentMethodSelectorProps {
164
190
  onSelect: (method: PaymentMethod) => void;
165
191
  disabled?: boolean;
166
192
  provider?: string;
193
+ layout?: 'grid' | 'list';
194
+ showLabel?: boolean;
167
195
  }
168
- declare function PaymentMethodSelector({ methods, selectedMethod, onSelect, disabled, provider, }: PaymentMethodSelectorProps): react_jsx_runtime.JSX.Element;
196
+ declare function PaymentMethodSelector({ methods, selectedMethod, onSelect, disabled, provider, layout, showLabel, }: PaymentMethodSelectorProps): react_jsx_runtime.JSX.Element;
169
197
 
170
198
  interface MobileMoneyFormProps {
171
199
  onSubmit: (data: MobileMoneyFormData) => void;
172
- onCancel: () => void;
200
+ onCancel?: () => void;
173
201
  isLoading?: boolean;
174
202
  initialPhone?: string;
203
+ hideCancel?: boolean;
175
204
  }
176
- declare function MobileMoneyForm({ onSubmit, onCancel, isLoading, initialPhone, }: MobileMoneyFormProps): react_jsx_runtime.JSX.Element;
205
+ declare function MobileMoneyForm({ onSubmit, onCancel, isLoading, initialPhone, hideCancel, }: MobileMoneyFormProps): react_jsx_runtime.JSX.Element;
177
206
 
178
207
  /**
179
208
  * useReevit hook
@@ -195,7 +224,10 @@ declare function useReevit(options: UseReevitOptions): {
195
224
  selectedMethod: PaymentMethod | null;
196
225
  error: PaymentError | null;
197
226
  result: PaymentResult | null;
198
- initialize: (method?: PaymentMethod) => Promise<void>;
227
+ initialize: (method?: PaymentMethod, options?: {
228
+ preferredProvider?: string;
229
+ allowedProviders?: string[];
230
+ }) => Promise<void>;
199
231
  selectMethod: (method: PaymentMethod) => void;
200
232
  processPayment: (paymentData: Record<string, unknown>) => Promise<void>;
201
233
  handlePspSuccess: (pspData: Record<string, unknown>) => Promise<void>;
@@ -272,12 +304,13 @@ interface HubtelBridgeProps {
272
304
  hubtelSessionToken?: string;
273
305
  /** Basic auth credential (legacy - credentials exposed to client, deprecated) */
274
306
  basicAuth?: string;
307
+ preferredMethod?: PaymentMethod;
275
308
  onSuccess: (result: PaymentResult) => void;
276
309
  onError: (error: PaymentError) => void;
277
310
  onClose: () => void;
278
311
  autoStart?: boolean;
279
312
  }
280
- declare function HubtelBridge({ paymentId, publicKey, merchantAccount, amount, reference, phone, description, callbackUrl, hubtelSessionToken, basicAuth, onSuccess, onError, onClose, autoStart, }: HubtelBridgeProps): react_jsx_runtime.JSX.Element;
313
+ declare function HubtelBridge({ paymentId, publicKey, merchantAccount, amount, reference, phone, description, callbackUrl, hubtelSessionToken, basicAuth, preferredMethod, onSuccess, onError, onClose, autoStart, }: HubtelBridgeProps): react_jsx_runtime.JSX.Element;
281
314
  /**
282
315
  * Opens Hubtel checkout modal directly
283
316
  * Uses the @hubteljs/checkout npm package
@@ -290,6 +323,7 @@ declare function openHubtelPopup(config: {
290
323
  callbackUrl?: string;
291
324
  customerPhoneNumber?: string;
292
325
  basicAuth?: string;
326
+ preferredMethod?: PaymentMethod;
293
327
  onSuccess?: (data: Record<string, unknown>) => void;
294
328
  onError?: (data: Record<string, unknown>) => void;
295
329
  onClose?: () => void;
@@ -557,6 +591,13 @@ interface PaymentIntentResponse {
557
591
  fee_currency: string;
558
592
  net_amount: number;
559
593
  reference?: string;
594
+ available_psps?: Array<{
595
+ provider: string;
596
+ name: string;
597
+ methods: string[];
598
+ countries?: string[];
599
+ }>;
600
+ branding?: Record<string, unknown>;
560
601
  }
561
602
  /**
562
603
  * Response from creating a Hubtel session token.
@@ -619,7 +660,10 @@ declare class ReevitAPIClient {
619
660
  /**
620
661
  * Creates a payment intent
621
662
  */
622
- createPaymentIntent(config: ReevitCheckoutConfig, method: PaymentMethod, country?: string): Promise<{
663
+ createPaymentIntent(config: ReevitCheckoutConfig, method: PaymentMethod, country?: string, options?: {
664
+ preferredProviders?: string[];
665
+ allowedProviders?: string[];
666
+ }): Promise<{
623
667
  data?: PaymentIntentResponse;
624
668
  error?: PaymentError;
625
669
  }>;