react-nomba-checkout-sdk 1.0.1 → 2.0.0

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.
Files changed (36) hide show
  1. package/README.md +99 -19
  2. package/dist/apis/handleNombaApiCall.d.ts +3 -0
  3. package/dist/apis/handleVendorApiCall.d.ts +3 -0
  4. package/dist/apis/useGenerateToken.d.ts +8 -0
  5. package/dist/apis/useNombaCheckout.d.ts +30 -0
  6. package/dist/assets/CloseIcon.d.ts +1 -1
  7. package/dist/components/NombaCheckoutModal.d.ts +14 -9
  8. package/dist/eventBus.d.ts +8 -0
  9. package/dist/helpers/InitializeNombaCheckout.d.ts +1 -0
  10. package/dist/index.d.ts +12 -11
  11. package/dist/index.esm.js +273 -151
  12. package/dist/index.esm.js.map +1 -1
  13. package/dist/index.js +275 -152
  14. package/dist/index.js.map +1 -1
  15. package/package.json +1 -1
  16. package/src/apis/handleNombaApiCall.ts +26 -0
  17. package/src/apis/handleVendorApiCall.ts +26 -0
  18. package/src/apis/useCardCheckout.ts +2 -2
  19. package/src/apis/useCardCheckoutOtp.ts +2 -2
  20. package/src/apis/useFetchUssdBanks.ts +2 -2
  21. package/src/apis/useGenerateQrCode.ts +2 -2
  22. package/src/apis/useGenerateToken.ts +30 -0
  23. package/src/apis/useGetOrder.ts +2 -2
  24. package/src/apis/useGetUssdCode.ts +2 -2
  25. package/src/apis/useNombaCheckout.ts +64 -0
  26. package/src/apis/useResendOtp.ts +2 -2
  27. package/src/apis/useVerifyOrderStatus.ts +2 -2
  28. package/src/assets/CloseIcon.tsx +11 -11
  29. package/src/components/NombaCheckoutModal.tsx +110 -63
  30. package/src/eventBus.ts +25 -0
  31. package/src/helpers/InitializeNombaCheckout.tsx +26 -0
  32. package/src/index.tsx +14 -13
  33. package/dist/apis/handleApiCall.d.ts +0 -3
  34. package/dist/components/NombaCheckoutButton.d.ts +0 -17
  35. package/src/apis/handleApiCall.ts +0 -20
  36. package/src/components/NombaCheckoutButton.tsx +0 -67
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-nomba-checkout-sdk",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,26 @@
1
+ import axios from 'axios';
2
+
3
+ export const handleNombaApiCall = async (
4
+ url: string,
5
+ method: string,
6
+ body?: {} | null,
7
+ customHeaders?: { [key: string]: string },
8
+ environment?: string
9
+ ) => {
10
+ const baseUrl =
11
+ environment === 'sandbox'
12
+ ? 'https://sandbox.nomba.com/v1'
13
+ : 'https://api.nomba.com/v1';
14
+
15
+ const options = {
16
+ method: method,
17
+ headers: {
18
+ 'content-type': 'application/json',
19
+ ...customHeaders,
20
+ },
21
+ data: body && body,
22
+ url: `${baseUrl}${url}`,
23
+ };
24
+ const response = await axios(options);
25
+ return response;
26
+ };
@@ -0,0 +1,26 @@
1
+ import axios from 'axios';
2
+
3
+ export const handleVendorApiCall = async (
4
+ url: string,
5
+ method: string,
6
+ body?: {} | null,
7
+ customHeaders?: { [key: string]: string },
8
+ environment?: string
9
+ ) => {
10
+ const baseUrl =
11
+ environment === 'sandbox'
12
+ ? 'https://sandbox.nomba.com/v1'
13
+ : 'https://api.nomba.com/v1';
14
+
15
+ const options = {
16
+ method: method,
17
+ headers: {
18
+ 'content-type': 'application/json',
19
+ ...customHeaders,
20
+ },
21
+ data: body && body,
22
+ url: `${baseUrl}${url}`,
23
+ };
24
+ const response = await axios(options);
25
+ return response;
26
+ };
@@ -1,4 +1,4 @@
1
- import { handleApiCall } from "./handleApiCall";
1
+ import { handleVendorApiCall } from "./handleVendorApiCall";
2
2
 
3
3
  interface CardCheckoutPayload {
4
4
  orderReference: string;
@@ -9,7 +9,7 @@ interface CardCheckoutPayload {
9
9
 
10
10
  export const useCardCheckout = async (payload: CardCheckoutPayload) => {
11
11
  try {
12
- const response = await handleApiCall(
12
+ const response = await handleVendorApiCall(
13
13
  "/checkout/checkout-card-detail",
14
14
  "POST",
15
15
  {
@@ -1,4 +1,4 @@
1
- import { handleApiCall } from "./handleApiCall";
1
+ import { handleVendorApiCall } from "./handleVendorApiCall";
2
2
 
3
3
  interface OtpRequest {
4
4
  otp: string;
@@ -9,7 +9,7 @@ interface OtpRequest {
9
9
 
10
10
  export const useCardCheckoutOtp = async (payload: OtpRequest) => {
11
11
  try {
12
- const response = await handleApiCall(
12
+ const response = await handleVendorApiCall(
13
13
  "/checkout/checkout-card-otp",
14
14
  "POST",
15
15
  payload
@@ -1,8 +1,8 @@
1
- import { handleApiCall } from "./handleApiCall";
1
+ import { handleVendorApiCall } from "./handleVendorApiCall";
2
2
 
3
3
  export const useFetchUssdBanks = async () => {
4
4
  try {
5
- const response = await handleApiCall(`/checkout/ussd/banks`, "GET");
5
+ const response = await handleVendorApiCall(`/checkout/ussd/banks`, "GET");
6
6
  return response.data;
7
7
  } catch (error: any) {
8
8
  return error;
@@ -1,8 +1,8 @@
1
- import { handleApiCall } from "./handleApiCall";
1
+ import { handleVendorApiCall } from "./handleVendorApiCall";
2
2
 
3
3
  export const useGenerateQrCode = async (orderReference: string) => {
4
4
  try {
5
- const response = await handleApiCall(
5
+ const response = await handleVendorApiCall(
6
6
  `/checkout/qr/${orderReference}`,
7
7
  "GET"
8
8
  );
@@ -0,0 +1,30 @@
1
+ import { handleNombaApiCall } from './handleNombaApiCall';
2
+
3
+ interface GenerateTokenPayload {
4
+ clientId: string;
5
+ clientSecret: string;
6
+ accountId: string;
7
+ environment?: string;
8
+ }
9
+
10
+ export const useGenerateToken = async (payload: GenerateTokenPayload) => {
11
+ try {
12
+ const response = await handleNombaApiCall(
13
+ '/auth/token/issue',
14
+ 'POST',
15
+ {
16
+ grant_type: 'client_credentials',
17
+ client_id: payload.clientId,
18
+ client_secret: payload.clientSecret,
19
+ },
20
+ {
21
+ accountId: payload.accountId,
22
+ },
23
+ payload.environment
24
+ );
25
+
26
+ return response;
27
+ } catch (error: any) {
28
+ return error;
29
+ }
30
+ };
@@ -1,8 +1,8 @@
1
- import { handleApiCall } from "./handleApiCall";
1
+ import { handleVendorApiCall } from "./handleVendorApiCall";
2
2
 
3
3
  export const useGetOrder = async (orderReference: string) => {
4
4
  try {
5
- const response = await handleApiCall(
5
+ const response = await handleVendorApiCall(
6
6
  `/checkout/order/${orderReference}`,
7
7
  "GET"
8
8
  );
@@ -1,4 +1,4 @@
1
- import { handleApiCall } from "./handleApiCall";
1
+ import { handleVendorApiCall } from "./handleVendorApiCall";
2
2
 
3
3
  interface UssdCodeRequest {
4
4
  ussdBankId: string;
@@ -16,7 +16,7 @@ export const useGetUssdCode = async (payload: {
16
16
  orderId: string;
17
17
  }) => {
18
18
  try {
19
- const response = await handleApiCall(
19
+ const response = await handleVendorApiCall(
20
20
  `/checkout/ussd/code`,
21
21
  "POST",
22
22
  payload
@@ -0,0 +1,64 @@
1
+ import eventBus from '../eventBus';
2
+ import { handleNombaApiCall } from './handleNombaApiCall';
3
+
4
+ interface CheckoutPayload {
5
+ order: {
6
+ orderReference: string;
7
+ customerId: string;
8
+ callbackUrl: string;
9
+ customerEmail: string;
10
+ amount: string;
11
+ currency: string;
12
+ accountId: string;
13
+ splitRequest?: {
14
+ splitType: string;
15
+ splitList: [
16
+ {
17
+ accountId: string;
18
+ value: number;
19
+ },
20
+ ];
21
+ };
22
+ };
23
+ tokenizeCard: boolean;
24
+ clientId: string;
25
+ accountId: string;
26
+ environment?: string;
27
+ onCreateOrder: (orderReference: string) => void;
28
+ onFailure: (e: any) => void;
29
+ onClose: () => {};
30
+ onPaymentSuccess: (order: any) => {};
31
+ }
32
+
33
+ export const useNombaCheckout = async (payload: CheckoutPayload) => {
34
+ try {
35
+ const response = await handleNombaApiCall(
36
+ '/checkout/order',
37
+ 'POST',
38
+ {
39
+ order: {
40
+ ...payload.order,
41
+ accountId: payload.accountId,
42
+ },
43
+ tokenizeCard: payload.tokenizeCard,
44
+ },
45
+ {
46
+ accountId: payload.accountId,
47
+ public_key: payload.clientId,
48
+ 'X-Nomba-Integration': 'react-sdk',
49
+ },
50
+ payload.environment
51
+ );
52
+
53
+ eventBus.emit('openModal', {
54
+ orderId: response?.data?.data?.orderReference,
55
+ onClose: payload.onClose,
56
+ onPaymentSuccess: payload.onPaymentSuccess,
57
+ environment: payload.environment,
58
+ });
59
+ return payload.onCreateOrder(response.data);
60
+ } catch (error: any) {
61
+ payload.onFailure?.(error);
62
+ return error;
63
+ }
64
+ };
@@ -1,8 +1,8 @@
1
- import { handleApiCall } from "./handleApiCall";
1
+ import { handleVendorApiCall } from "./handleVendorApiCall";
2
2
 
3
3
  export const useResendOtp = async (orderReference: string) => {
4
4
  try {
5
- const response = await handleApiCall("/checkout/resend-otp", "POST", {
5
+ const response = await handleVendorApiCall("/checkout/resend-otp", "POST", {
6
6
  orderReference,
7
7
  });
8
8
  return response.data;
@@ -1,8 +1,8 @@
1
- import { handleApiCall } from "./handleApiCall";
1
+ import { handleVendorApiCall } from "./handleVendorApiCall";
2
2
 
3
3
  export const useVerifyOrderStatus = async (orderReference: string) => {
4
4
  try {
5
- const response = await handleApiCall(
5
+ const response = await handleVendorApiCall(
6
6
  "/checkout/confirm-transaction-receipt",
7
7
  "POST",
8
8
  { orderReference }
@@ -1,19 +1,19 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
 
3
3
  export const CloseIcon = () => (
4
4
  <svg
5
- width="32"
6
- height="32"
7
- viewBox="0 0 32 32"
8
- fill="none"
9
- xmlns="http://www.w3.org/2000/svg"
5
+ width='32'
6
+ height='32'
7
+ viewBox='0 0 32 32'
8
+ fill='none'
9
+ xmlns='http://www.w3.org/2000/svg'
10
10
  >
11
- <rect width="32" height="32" rx="16" fill="#F2F2F2" fill-opacity="0.64" />
11
+ <rect width='32' height='32' rx='16' fill='#F2F2F2' fillOpacity='0.64' />
12
12
  <path
13
- fill-rule="evenodd"
14
- clip-rule="evenodd"
15
- d="M11.7646 11.7646C11.8948 11.6344 12.1059 11.6344 12.236 11.7646L16.0003 15.5289L19.7646 11.7646C19.8948 11.6344 20.1059 11.6344 20.236 11.7646C20.3662 11.8948 20.3662 12.1059 20.236 12.236L16.4717 16.0003L20.236 19.7646C20.3662 19.8948 20.3662 20.1059 20.236 20.236C20.1059 20.3662 19.8948 20.3662 19.7646 20.236L16.0003 16.4717L12.236 20.236C12.1059 20.3662 11.8948 20.3662 11.7646 20.236C11.6344 20.1059 11.6344 19.8948 11.7646 19.7646L15.5289 16.0003L11.7646 12.236C11.6344 12.1059 11.6344 11.8948 11.7646 11.7646Z"
16
- fill="#0D0D0D"
13
+ fillRule='evenodd'
14
+ clipRule='evenodd'
15
+ d='M11.7646 11.7646C11.8948 11.6344 12.1059 11.6344 12.236 11.7646L16.0003 15.5289L19.7646 11.7646C19.8948 11.6344 20.1059 11.6344 20.236 11.7646C20.3662 11.8948 20.3662 12.1059 20.236 12.236L16.4717 16.0003L20.236 19.7646C20.3662 19.8948 20.3662 20.1059 20.236 20.236C20.1059 20.3662 19.8948 20.3662 19.7646 20.236L16.0003 16.4717L12.236 20.236C12.1059 20.3662 11.8948 20.3662 11.7646 20.236C11.6344 20.1059 11.6344 19.8948 11.7646 19.7646L15.5289 16.0003L11.7646 12.236C11.6344 12.1059 11.6344 11.8948 11.7646 11.7646Z'
16
+ fill='#0D0D0D'
17
17
  />
18
18
  </svg>
19
19
  );
@@ -1,39 +1,86 @@
1
- import React, { Component } from "react";
2
- import "../styles.css";
3
- import Loader from "../assets/Loader";
4
- import { CloseIcon } from "../assets/CloseIcon";
5
-
6
- interface NombaCheckoutModalProps {
7
- orderId: string;
8
- onClose: () => void;
9
- }
1
+ import React, { Component } from 'react';
2
+ import '../styles.css';
3
+ import Loader from '../assets/Loader';
4
+ import { CloseIcon } from '../assets/CloseIcon';
5
+ import eventBus from '../eventBus';
10
6
 
11
7
  interface NombaCheckoutModalState {
8
+ orderId: string;
12
9
  isLoading: boolean;
10
+ isOpen: boolean;
11
+ onClose: () => void;
12
+ onPaymentSuccess: (e: any) => void;
13
+ environment: string;
13
14
  }
14
15
 
15
- class NombaCheckoutModal extends Component<
16
- NombaCheckoutModalProps,
17
- NombaCheckoutModalState
18
- > {
19
- constructor(props: NombaCheckoutModalProps) {
16
+ class NombaCheckoutModal extends Component<{}, NombaCheckoutModalState> {
17
+ constructor(props: {}) {
20
18
  super(props);
21
19
  this.state = {
20
+ orderId: '',
22
21
  isLoading: true,
22
+ isOpen: false,
23
+ onClose: () => {},
24
+ onPaymentSuccess: () => {},
25
+ environment: 'live',
23
26
  };
24
27
  }
25
28
 
29
+ handleOpen = (orderId: string) => {
30
+ this.setState({ isOpen: true, orderId });
31
+ };
32
+
26
33
  handleClose = () => {
27
- this.props.onClose?.();
34
+ this.state.onClose?.();
35
+ this.setState({ isOpen: false });
28
36
  };
29
37
 
30
38
  handleIframeLoad = () => {
31
39
  this.setState({ isLoading: false });
32
40
  };
33
41
 
42
+ handleMessage = (event: MessageEvent) => {
43
+ if (event.data?.type === 'onSuccess') {
44
+ this.state?.onPaymentSuccess(event.data?.orderDetails);
45
+ }
46
+ };
47
+
48
+ componentDidMount() {
49
+ window.addEventListener('message', this.handleMessage);
50
+
51
+ eventBus.on(
52
+ 'openModal',
53
+ ({
54
+ orderId,
55
+ onClose,
56
+ environment,
57
+ onPaymentSuccess,
58
+ }: NombaCheckoutModalState) => {
59
+ this.setState({
60
+ isOpen: true,
61
+ orderId,
62
+ onClose,
63
+ environment,
64
+ onPaymentSuccess,
65
+ });
66
+ }
67
+ );
68
+
69
+ eventBus.on('closeModal', () => {
70
+ this.setState({ isOpen: false });
71
+ });
72
+ }
73
+
74
+ componentWillUnmount() {
75
+ window.removeEventListener('message', this.handleMessage);
76
+ eventBus.off('openModal', this.handleOpen);
77
+ eventBus.off('closeModal', this.handleClose);
78
+ }
79
+
34
80
  render() {
35
- const { orderId } = this.props;
36
- const { isLoading } = this.state;
81
+ const { isLoading, isOpen, orderId } = this.state;
82
+
83
+ if (!isOpen) return null;
37
84
 
38
85
  return (
39
86
  <div style={modalStyles.overlay} onClick={this.handleClose}>
@@ -41,23 +88,23 @@ class NombaCheckoutModal extends Component<
41
88
  <div style={modalStyles.content}>
42
89
  {isLoading && (
43
90
  <div style={modalStyles.loader}>
44
- <div className="spinner"></div>
91
+ <div className='spinner'></div>
45
92
  <Loader />
46
93
  </div>
47
94
  )}
48
-
49
95
  <button style={modalStyles.closeButton} onClick={this.handleClose}>
50
96
  <CloseIcon />
51
97
  </button>
52
98
 
53
99
  <iframe
54
- src={`https://checkout.nomba.com/pay/${orderId}`}
55
- allow="clipboard-write clipboard-read"
56
- width="100%"
57
- height="80vh"
100
+ src={`https://checkout.nomba.com/${this.state.environment === 'sandbox' ? 'sandbox' : 'pay'}/${orderId}`}
101
+ allow='clipboard-write clipboard-read'
102
+ width='100%'
103
+ height='80vh'
58
104
  style={modalStyles.iframe}
59
- title="Nomba checkout"
105
+ title='Nomba checkout'
60
106
  onLoad={this.handleIframeLoad}
107
+ id='checkout-sdk-iframe'
61
108
  />
62
109
  </div>
63
110
  </div>
@@ -68,64 +115,64 @@ class NombaCheckoutModal extends Component<
68
115
 
69
116
  const modalStyles: { [key: string]: React.CSSProperties } = {
70
117
  overlay: {
71
- position: "fixed",
118
+ position: 'fixed',
72
119
  top: 0,
73
120
  left: 0,
74
121
  right: 0,
75
122
  bottom: 0,
76
- backgroundColor: "rgba(0, 0, 0, 0.5)",
77
- display: "flex",
78
- justifyContent: "center",
79
- alignItems: "center",
123
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
124
+ display: 'flex',
125
+ justifyContent: 'center',
126
+ alignItems: 'center',
80
127
  zIndex: 9999,
81
128
  },
82
129
  modal: {
83
- backgroundColor: "white",
84
- width: "100%",
85
- maxWidth: "60vw",
86
- borderRadius: "8px",
87
- boxShadow: "0 4px 8px rgba(0, 0, 0, 0.1)",
88
- position: "relative",
89
- height: "600px",
90
- maxHeight: "95vh",
130
+ backgroundColor: 'white',
131
+ width: '100%',
132
+ maxWidth: '60vw',
133
+ borderRadius: '8px',
134
+ boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)',
135
+ position: 'relative',
136
+ height: '600px',
137
+ maxHeight: '95vh',
91
138
  },
92
139
  header: {
93
- position: "relative",
94
- display: "flex",
95
- justifyContent: "space-between",
96
- alignItems: "center",
140
+ position: 'relative',
141
+ display: 'flex',
142
+ justifyContent: 'space-between',
143
+ alignItems: 'center',
97
144
  },
98
145
  closeButton: {
99
- position: "absolute",
100
- top: "16px",
101
- right: "16px",
102
- border: "none",
103
- background: "transparent",
146
+ position: 'absolute',
147
+ top: '16px',
148
+ right: '16px',
149
+ border: 'none',
150
+ background: 'transparent',
104
151
  },
105
152
  content: {
106
- position: "relative",
153
+ position: 'relative',
107
154
  },
108
155
  iframe: {
109
- border: "none",
110
- borderRadius: "8px",
111
- width: "100%",
112
- maxHeight: "95vh",
113
- height: "600px",
114
- display: "block",
156
+ border: 'none',
157
+ borderRadius: '8px',
158
+ width: '100%',
159
+ maxHeight: '95vh',
160
+ height: '600px',
161
+ display: 'block',
115
162
  },
116
163
  loader: {
117
- position: "absolute",
164
+ position: 'absolute',
118
165
  top: 0,
119
166
  left: 0,
120
- width: "100%",
121
- height: "100%",
122
- backgroundColor: "rgba(255, 255, 255, 0.8)",
123
- display: "flex",
124
- flexDirection: "column",
125
- alignItems: "center",
126
- justifyContent: "center",
127
- fontSize: "18px",
128
- fontWeight: "bold",
167
+ width: '100%',
168
+ height: '100%',
169
+ backgroundColor: 'rgba(255, 255, 255, 0.8)',
170
+ display: 'flex',
171
+ flexDirection: 'column',
172
+ alignItems: 'center',
173
+ justifyContent: 'center',
174
+ fontSize: '18px',
175
+ fontWeight: 'bold',
129
176
  },
130
177
  };
131
178
 
@@ -0,0 +1,25 @@
1
+ class EventBus {
2
+ private events: { [key: string]: Array<(data: any) => void> } = {};
3
+
4
+ on(event: string, listener: (data: any) => void): void {
5
+ if (!this.events[event]) {
6
+ this.events[event] = [];
7
+ }
8
+ this.events[event].push(listener);
9
+ }
10
+
11
+ emit(event: string, data: any): void {
12
+ if (this.events[event]) {
13
+ this.events[event].forEach(listener => listener(data));
14
+ }
15
+ }
16
+
17
+ off(event: string, listener: (data: any) => void): void {
18
+ if (this.events[event]) {
19
+ this.events[event] = this.events[event].filter(l => l !== listener);
20
+ }
21
+ }
22
+ }
23
+
24
+ const eventBus = new EventBus();
25
+ export default eventBus;
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import ReactDOM from "react-dom/client";
3
+ import { NombaCheckoutModal } from "../components/NombaCheckoutModal";
4
+
5
+ let root: ReactDOM.Root | null = null;
6
+
7
+ export const InitializeNombaCheckout = () => {
8
+ const modalDivId = "nomba-checkout-modal";
9
+
10
+ let modalContainer = document.getElementById(modalDivId);
11
+ if (!modalContainer) {
12
+ modalContainer = document.createElement("div");
13
+ modalContainer.id = modalDivId;
14
+ document.body.appendChild(modalContainer);
15
+ }
16
+
17
+ if (!root) {
18
+ root = ReactDOM.createRoot(modalContainer);
19
+ }
20
+
21
+ root!.render(
22
+ <div>
23
+ <NombaCheckoutModal />
24
+ </div>
25
+ );
26
+ };
package/src/index.tsx CHANGED
@@ -1,18 +1,16 @@
1
- import { NombaCheckoutButton } from "./components/NombaCheckoutButton";
2
- import { NombaCheckoutModal } from "./components/NombaCheckoutModal";
3
-
4
- import { useGetOrder } from "./apis/useGetOrder";
5
- import { useCardCheckout } from "./apis/useCardCheckout";
6
- import { useCardCheckoutOtp } from "./apis/useCardCheckoutOtp";
7
- import { useGenerateQrCode } from "./apis/useGenerateQrCode";
8
- import { useVerifyOrderStatus } from "./apis/useVerifyOrderStatus";
9
- import { useResendOtp } from "./apis/useResendOtp";
10
- import { useFetchUssdBanks } from "./apis/useFetchUssdBanks";
11
- import { useGetUssdCode } from "./apis/useGetUssdCode";
1
+ import { useGetOrder } from './apis/useGetOrder';
2
+ import { useCardCheckout } from './apis/useCardCheckout';
3
+ import { useCardCheckoutOtp } from './apis/useCardCheckoutOtp';
4
+ import { useGenerateQrCode } from './apis/useGenerateQrCode';
5
+ import { useVerifyOrderStatus } from './apis/useVerifyOrderStatus';
6
+ import { useResendOtp } from './apis/useResendOtp';
7
+ import { useFetchUssdBanks } from './apis/useFetchUssdBanks';
8
+ import { useGetUssdCode } from './apis/useGetUssdCode';
9
+ import { useGenerateToken } from './apis/useGenerateToken';
10
+ import { useNombaCheckout } from './apis/useNombaCheckout';
11
+ import { InitializeNombaCheckout } from './helpers/InitializeNombaCheckout';
12
12
 
13
13
  export {
14
- NombaCheckoutButton,
15
- NombaCheckoutModal,
16
14
  useGetOrder,
17
15
  useCardCheckout,
18
16
  useCardCheckoutOtp,
@@ -21,4 +19,7 @@ export {
21
19
  useVerifyOrderStatus,
22
20
  useFetchUssdBanks,
23
21
  useGetUssdCode,
22
+ useGenerateToken,
23
+ useNombaCheckout,
24
+ InitializeNombaCheckout,
24
25
  };
@@ -1,3 +0,0 @@
1
- export declare const handleApiCall: (url: string, method: string, body?: {} | null, customHeaders?: {
2
- [key: string]: string;
3
- }) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -1,17 +0,0 @@
1
- import React, { Component } from "react";
2
- interface NombaCheckoutButtonProps {
3
- orderId: string;
4
- buttonText?: string;
5
- buttonStyle?: React.CSSProperties;
6
- children?: React.ReactNode;
7
- onClose: () => void;
8
- }
9
- interface NombaCheckoutButtonState {
10
- showModal: boolean;
11
- }
12
- declare class NombaCheckoutButton extends Component<NombaCheckoutButtonProps, NombaCheckoutButtonState> {
13
- constructor(props: NombaCheckoutButtonProps);
14
- handleClose: () => void;
15
- render(): React.JSX.Element;
16
- }
17
- export { NombaCheckoutButton };