@reevit/react 0.5.0 → 0.5.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/README.md CHANGED
@@ -5,7 +5,7 @@ Unified Payment Widget for React Applications. Accept card and mobile money paym
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @reevit/react
8
+ npm install @reevit/react@0.5.0
9
9
  ```
10
10
 
11
11
  ## Quick Start
@@ -272,8 +272,6 @@ function MpesaPayment() {
272
272
 
273
273
  ## Supported PSPs
274
274
 
275
- | Provider | Countries | Payment Methods |
276
- |----------|-----------|-----------------|
277
275
  | Paystack | NG, GH, ZA, KE | Card, Mobile Money, Bank Transfer |
278
276
  | Flutterwave | NG, GH, KE, ZA + | Card, Mobile Money, Bank Transfer |
279
277
  | Hubtel | GH | Mobile Money |
package/dist/index.d.mts CHANGED
@@ -4,7 +4,7 @@ import { ReactNode } from 'react';
4
4
  /** Minimal ReactNode-compatible type to avoid hard dependency on @types/react */
5
5
  type ReevitReactNode = ReactNode;
6
6
  type PaymentMethod = 'card' | 'mobile_money' | 'bank_transfer' | 'apple_pay' | 'google_pay';
7
- type MobileMoneyNetwork = 'mtn' | 'vodafone' | 'airteltigo';
7
+ type MobileMoneyNetwork = 'mtn' | 'telecel' | 'airteltigo';
8
8
  /** Payment source type - indicates where the payment originated from */
9
9
  type PaymentSource = 'payment_link' | 'api' | 'subscription';
10
10
  interface ReevitCheckoutConfig {
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { ReactNode } from 'react';
4
4
  /** Minimal ReactNode-compatible type to avoid hard dependency on @types/react */
5
5
  type ReevitReactNode = ReactNode;
6
6
  type PaymentMethod = 'card' | 'mobile_money' | 'bank_transfer' | 'apple_pay' | 'google_pay';
7
- type MobileMoneyNetwork = 'mtn' | 'vodafone' | 'airteltigo';
7
+ type MobileMoneyNetwork = 'mtn' | 'telecel' | 'airteltigo';
8
8
  /** Payment source type - indicates where the payment originated from */
9
9
  type PaymentSource = 'payment_link' | 'api' | 'subscription';
10
10
  interface ReevitCheckoutConfig {
package/dist/index.js CHANGED
@@ -60,7 +60,7 @@ function validatePhone(phone, network) {
60
60
  const cleaned = phone.replace(/[\s-]/g, "");
61
61
  const patterns = {
62
62
  mtn: /^(0|233|\+233)?(24|54|55|59)\d{7}$/,
63
- vodafone: /^(0|233|\+233)?(20|50)\d{7}$/,
63
+ telecel: /^(0|233|\+233)?(20|50)\d{7}$/,
64
64
  airteltigo: /^(0|233|\+233)?(26|27|56|57)\d{7}$/
65
65
  };
66
66
  if (network && patterns[network]) {
@@ -82,7 +82,7 @@ function detectNetwork(phone) {
82
82
  const cleaned = phone.replace(/[\s-]/g, "");
83
83
  const prefixes = {
84
84
  mtn: ["024", "054", "055", "059", "23324", "23354", "23355", "23359"],
85
- vodafone: ["020", "050", "23320", "23350"],
85
+ telecel: ["020", "050", "23320", "23350"],
86
86
  airteltigo: ["026", "027", "056", "057", "23326", "23327", "23356", "23357"]
87
87
  };
88
88
  for (const [network, networkPrefixes] of Object.entries(prefixes)) {
@@ -706,7 +706,7 @@ var methodConfig = {
706
706
  mobile_money: {
707
707
  label: "Mobile Money",
708
708
  icon: "\u{1F4F1}",
709
- description: "MTN, Vodafone Cash, AirtelTigo Money"
709
+ description: "MTN, Telecel, AirtelTigo Money"
710
710
  },
711
711
  bank_transfer: {
712
712
  label: "Bank Transfer",
@@ -743,7 +743,7 @@ function PaymentMethodSelector({
743
743
  const c = (country).toUpperCase();
744
744
  if (method === "mobile_money") {
745
745
  const mobileMoneyDescriptions = {
746
- GH: "MTN, Vodafone Cash, AirtelTigo Money",
746
+ GH: "MTN, Telecel, AirtelTigo Money",
747
747
  KE: "M-Pesa, Airtel Money",
748
748
  NG: "MTN MoMo, Airtel Money",
749
749
  ZA: "Mobile Money"
@@ -819,7 +819,7 @@ function PaymentMethodSelector({
819
819
  }
820
820
  var networks = [
821
821
  { id: "mtn", name: "MTN", color: "#FFCC00" },
822
- { id: "vodafone", name: "Vodafone", color: "#E60000" },
822
+ { id: "telecel", name: "Telecel", color: "#E60000" },
823
823
  { id: "airteltigo", name: "AirtelTigo", color: "#E4002B" }
824
824
  ];
825
825
  function MobileMoneyForm({
@@ -1134,6 +1134,7 @@ function PaystackBridge({
1134
1134
  if (!window.PaystackPop) {
1135
1135
  throw new Error("Paystack script loaded but PaystackPop not available");
1136
1136
  }
1137
+ const safeMetadata = accessCode ? void 0 : metadata;
1137
1138
  const setupConfig = {
1138
1139
  key: publicKey,
1139
1140
  email,
@@ -1142,7 +1143,7 @@ function PaystackBridge({
1142
1143
  currency,
1143
1144
  ref: reference,
1144
1145
  access_code: accessCode,
1145
- metadata,
1146
+ metadata: safeMetadata,
1146
1147
  channels,
1147
1148
  callback: (response) => {
1148
1149
  console.log("[PaystackBridge] Callback received", response);