@nomba/node-sdk 0.0.0-stage → 0.1.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 (201) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +550 -2
  3. package/dist/index.d.ts +86 -0
  4. package/dist/index.js +53 -0
  5. package/dist/interfaces/http/IHttpClient.d.ts +17 -0
  6. package/dist/interfaces/http/IHttpClient.js +5 -0
  7. package/dist/interfaces/http/index.d.ts +1 -0
  8. package/dist/interfaces/http/index.js +1 -0
  9. package/dist/interfaces/v1/accounts/IAccountsService.d.ts +24 -0
  10. package/dist/interfaces/v1/accounts/IAccountsService.js +5 -0
  11. package/dist/interfaces/v1/accounts/index.d.ts +1 -0
  12. package/dist/interfaces/v1/accounts/index.js +1 -0
  13. package/dist/interfaces/v1/betting/IBettingService.d.ts +11 -0
  14. package/dist/interfaces/v1/betting/IBettingService.js +5 -0
  15. package/dist/interfaces/v1/betting/index.d.ts +1 -0
  16. package/dist/interfaces/v1/betting/index.js +1 -0
  17. package/dist/interfaces/v1/cable/ICableService.d.ts +11 -0
  18. package/dist/interfaces/v1/cable/ICableService.js +5 -0
  19. package/dist/interfaces/v1/cable/index.d.ts +1 -0
  20. package/dist/interfaces/v1/cable/index.js +1 -0
  21. package/dist/interfaces/v1/charge/IChargeService.d.ts +33 -0
  22. package/dist/interfaces/v1/charge/IChargeService.js +5 -0
  23. package/dist/interfaces/v1/charge/index.d.ts +1 -0
  24. package/dist/interfaces/v1/charge/index.js +1 -0
  25. package/dist/interfaces/v1/checkout/ICheckoutService.d.ts +30 -0
  26. package/dist/interfaces/v1/checkout/ICheckoutService.js +5 -0
  27. package/dist/interfaces/v1/checkout/index.d.ts +1 -0
  28. package/dist/interfaces/v1/checkout/index.js +1 -0
  29. package/dist/interfaces/v1/data/IDataService.d.ts +9 -0
  30. package/dist/interfaces/v1/data/IDataService.js +5 -0
  31. package/dist/interfaces/v1/data/index.d.ts +1 -0
  32. package/dist/interfaces/v1/data/index.js +1 -0
  33. package/dist/interfaces/v1/direct-debits/IDirectDebitsService.d.ts +31 -0
  34. package/dist/interfaces/v1/direct-debits/IDirectDebitsService.js +5 -0
  35. package/dist/interfaces/v1/direct-debits/index.d.ts +1 -0
  36. package/dist/interfaces/v1/direct-debits/index.js +1 -0
  37. package/dist/interfaces/v1/electricity/IElectricityService.d.ts +11 -0
  38. package/dist/interfaces/v1/electricity/IElectricityService.js +5 -0
  39. package/dist/interfaces/v1/electricity/index.d.ts +1 -0
  40. package/dist/interfaces/v1/electricity/index.js +1 -0
  41. package/dist/interfaces/v1/globals/collections/IGlobalCollectionsService.d.ts +14 -0
  42. package/dist/interfaces/v1/globals/collections/IGlobalCollectionsService.js +5 -0
  43. package/dist/interfaces/v1/globals/collections/index.d.ts +1 -0
  44. package/dist/interfaces/v1/globals/collections/index.js +1 -0
  45. package/dist/interfaces/v1/globals/payouts/IGlobalPayoutService.d.ts +30 -0
  46. package/dist/interfaces/v1/globals/payouts/IGlobalPayoutService.js +5 -0
  47. package/dist/interfaces/v1/globals/payouts/index.d.ts +1 -0
  48. package/dist/interfaces/v1/globals/payouts/index.js +1 -0
  49. package/dist/interfaces/v1/requery/IRequeryService.d.ts +17 -0
  50. package/dist/interfaces/v1/requery/IRequeryService.js +5 -0
  51. package/dist/interfaces/v1/requery/index.d.ts +1 -0
  52. package/dist/interfaces/v1/requery/index.js +1 -0
  53. package/dist/interfaces/v1/terminals/ITerminalsService.d.ts +18 -0
  54. package/dist/interfaces/v1/terminals/ITerminalsService.js +5 -0
  55. package/dist/interfaces/v1/terminals/index.d.ts +1 -0
  56. package/dist/interfaces/v1/terminals/index.js +1 -0
  57. package/dist/interfaces/v1/transactions/ITransactionsService.d.ts +34 -0
  58. package/dist/interfaces/v1/transactions/ITransactionsService.js +5 -0
  59. package/dist/interfaces/v1/transactions/index.d.ts +1 -0
  60. package/dist/interfaces/v1/transactions/index.js +1 -0
  61. package/dist/interfaces/v1/virtual-accounts/IVirtualAccountsService.d.ts +27 -0
  62. package/dist/interfaces/v1/virtual-accounts/IVirtualAccountsService.js +5 -0
  63. package/dist/interfaces/v1/virtual-accounts/index.d.ts +1 -0
  64. package/dist/interfaces/v1/virtual-accounts/index.js +1 -0
  65. package/dist/interfaces/v1/webhooks/IWebhooksService.d.ts +21 -0
  66. package/dist/interfaces/v1/webhooks/IWebhooksService.js +5 -0
  67. package/dist/interfaces/v1/webhooks/index.d.ts +1 -0
  68. package/dist/interfaces/v1/webhooks/index.js +1 -0
  69. package/dist/interfaces/v2/airtime/IAirtimeV2Service.d.ts +12 -0
  70. package/dist/interfaces/v2/airtime/IAirtimeV2Service.js +5 -0
  71. package/dist/interfaces/v2/airtime/index.d.ts +1 -0
  72. package/dist/interfaces/v2/airtime/index.js +1 -0
  73. package/dist/interfaces/v2/betting/IBettingV2Service.d.ts +12 -0
  74. package/dist/interfaces/v2/betting/IBettingV2Service.js +5 -0
  75. package/dist/interfaces/v2/betting/index.d.ts +1 -0
  76. package/dist/interfaces/v2/betting/index.js +1 -0
  77. package/dist/interfaces/v2/cable/ICableV2Service.d.ts +12 -0
  78. package/dist/interfaces/v2/cable/ICableV2Service.js +5 -0
  79. package/dist/interfaces/v2/cable/index.d.ts +1 -0
  80. package/dist/interfaces/v2/cable/index.js +1 -0
  81. package/dist/interfaces/v2/data/IDataV2Service.d.ts +12 -0
  82. package/dist/interfaces/v2/data/IDataV2Service.js +5 -0
  83. package/dist/interfaces/v2/data/index.d.ts +1 -0
  84. package/dist/interfaces/v2/data/index.js +1 -0
  85. package/dist/interfaces/v2/electricity/IElectricityV2Service.d.ts +12 -0
  86. package/dist/interfaces/v2/electricity/IElectricityV2Service.js +5 -0
  87. package/dist/interfaces/v2/electricity/index.d.ts +1 -0
  88. package/dist/interfaces/v2/electricity/index.js +1 -0
  89. package/dist/interfaces/v2/transfers/ITransfersService.d.ts +20 -0
  90. package/dist/interfaces/v2/transfers/ITransfersService.js +5 -0
  91. package/dist/interfaces/v2/transfers/index.d.ts +1 -0
  92. package/dist/interfaces/v2/transfers/index.js +1 -0
  93. package/dist/lib/errors.d.ts +62 -0
  94. package/dist/lib/errors.js +92 -0
  95. package/dist/lib/outcome.d.ts +18 -0
  96. package/dist/lib/outcome.js +107 -0
  97. package/dist/lib/paginate.d.ts +21 -0
  98. package/dist/lib/paginate.js +25 -0
  99. package/dist/lib/sdk-version.d.ts +5 -0
  100. package/dist/lib/sdk-version.generated.d.ts +1 -0
  101. package/dist/lib/sdk-version.generated.js +1 -0
  102. package/dist/lib/sdk-version.js +5 -0
  103. package/dist/lib/token-store.d.ts +49 -0
  104. package/dist/lib/token-store.js +26 -0
  105. package/dist/lib/util.d.ts +31 -0
  106. package/dist/lib/util.js +31 -0
  107. package/dist/lib/webhooks.d.ts +43 -0
  108. package/dist/lib/webhooks.js +64 -0
  109. package/dist/nomba.d.ts +63 -0
  110. package/dist/nomba.js +97 -0
  111. package/dist/services/http/http-client.service.d.ts +27 -0
  112. package/dist/services/http/http-client.service.js +317 -0
  113. package/dist/services/v1/accounts/accounts.service.d.ts +38 -0
  114. package/dist/services/v1/accounts/accounts.service.js +58 -0
  115. package/dist/services/v1/betting/betting.service.d.ts +16 -0
  116. package/dist/services/v1/betting/betting.service.js +21 -0
  117. package/dist/services/v1/cable/cable.service.d.ts +16 -0
  118. package/dist/services/v1/cable/cable.service.js +23 -0
  119. package/dist/services/v1/charge/charge.service.d.ts +52 -0
  120. package/dist/services/v1/charge/charge.service.js +99 -0
  121. package/dist/services/v1/checkout/checkout.service.d.ts +44 -0
  122. package/dist/services/v1/checkout/checkout.service.js +100 -0
  123. package/dist/services/v1/data/data.service.d.ts +14 -0
  124. package/dist/services/v1/data/data.service.js +16 -0
  125. package/dist/services/v1/direct-debits/direct-debits.service.d.ts +45 -0
  126. package/dist/services/v1/direct-debits/direct-debits.service.js +69 -0
  127. package/dist/services/v1/electricity/electricity.service.d.ts +16 -0
  128. package/dist/services/v1/electricity/electricity.service.js +21 -0
  129. package/dist/services/v1/globals/collections.service.d.ts +28 -0
  130. package/dist/services/v1/globals/collections.service.js +38 -0
  131. package/dist/services/v1/globals/payout.service.d.ts +45 -0
  132. package/dist/services/v1/globals/payout.service.js +95 -0
  133. package/dist/services/v1/requery/requery.service.d.ts +31 -0
  134. package/dist/services/v1/requery/requery.service.js +41 -0
  135. package/dist/services/v1/terminals/terminals.service.d.ts +38 -0
  136. package/dist/services/v1/terminals/terminals.service.js +69 -0
  137. package/dist/services/v1/transactions/transactions.service.d.ts +48 -0
  138. package/dist/services/v1/transactions/transactions.service.js +98 -0
  139. package/dist/services/v1/virtual-accounts/virtual-accounts.service.d.ts +41 -0
  140. package/dist/services/v1/virtual-accounts/virtual-accounts.service.js +56 -0
  141. package/dist/services/v1/webhooks/webhooks.service.d.ts +36 -0
  142. package/dist/services/v1/webhooks/webhooks.service.js +60 -0
  143. package/dist/services/v2/airtime/airtime.service.d.ts +18 -0
  144. package/dist/services/v2/airtime/airtime.service.js +35 -0
  145. package/dist/services/v2/betting/betting.service.d.ts +19 -0
  146. package/dist/services/v2/betting/betting.service.js +36 -0
  147. package/dist/services/v2/cable/cable.service.d.ts +19 -0
  148. package/dist/services/v2/cable/cable.service.js +36 -0
  149. package/dist/services/v2/data/data.service.d.ts +18 -0
  150. package/dist/services/v2/data/data.service.js +35 -0
  151. package/dist/services/v2/electricity/electricity.service.d.ts +19 -0
  152. package/dist/services/v2/electricity/electricity.service.js +36 -0
  153. package/dist/services/v2/transfers/transfers.service.d.ts +30 -0
  154. package/dist/services/v2/transfers/transfers.service.js +67 -0
  155. package/dist/types/common/common.types.d.ts +78 -0
  156. package/dist/types/common/common.types.js +5 -0
  157. package/dist/types/common/outcome.types.d.ts +53 -0
  158. package/dist/types/common/outcome.types.js +5 -0
  159. package/dist/types/v1/accounts/accounts.types.d.ts +37 -0
  160. package/dist/types/v1/accounts/accounts.types.js +8 -0
  161. package/dist/types/v1/betting/betting.types.d.ts +26 -0
  162. package/dist/types/v1/betting/betting.types.js +5 -0
  163. package/dist/types/v1/cable/cable.types.d.ts +24 -0
  164. package/dist/types/v1/cable/cable.types.js +5 -0
  165. package/dist/types/v1/charge/charge.types.d.ts +102 -0
  166. package/dist/types/v1/charge/charge.types.js +5 -0
  167. package/dist/types/v1/checkout/checkout.types.d.ts +139 -0
  168. package/dist/types/v1/checkout/checkout.types.js +5 -0
  169. package/dist/types/v1/data/data.types.d.ts +14 -0
  170. package/dist/types/v1/data/data.types.js +5 -0
  171. package/dist/types/v1/direct-debits/direct-debits.types.d.ts +104 -0
  172. package/dist/types/v1/direct-debits/direct-debits.types.js +5 -0
  173. package/dist/types/v1/electricity/electricity.types.d.ts +21 -0
  174. package/dist/types/v1/electricity/electricity.types.js +5 -0
  175. package/dist/types/v1/globals/collections.types.d.ts +49 -0
  176. package/dist/types/v1/globals/collections.types.js +5 -0
  177. package/dist/types/v1/globals/payout.types.d.ts +183 -0
  178. package/dist/types/v1/globals/payout.types.js +5 -0
  179. package/dist/types/v1/requery/requery.types.d.ts +49 -0
  180. package/dist/types/v1/requery/requery.types.js +5 -0
  181. package/dist/types/v1/terminals/terminals.types.d.ts +44 -0
  182. package/dist/types/v1/terminals/terminals.types.js +5 -0
  183. package/dist/types/v1/transactions/transactions.types.d.ts +87 -0
  184. package/dist/types/v1/transactions/transactions.types.js +5 -0
  185. package/dist/types/v1/virtual-accounts/virtual-accounts.types.d.ts +64 -0
  186. package/dist/types/v1/virtual-accounts/virtual-accounts.types.js +5 -0
  187. package/dist/types/v1/webhooks/webhooks.types.d.ts +54 -0
  188. package/dist/types/v1/webhooks/webhooks.types.js +5 -0
  189. package/dist/types/v2/airtime/airtime.types.d.ts +31 -0
  190. package/dist/types/v2/airtime/airtime.types.js +5 -0
  191. package/dist/types/v2/betting/betting.types.d.ts +33 -0
  192. package/dist/types/v2/betting/betting.types.js +5 -0
  193. package/dist/types/v2/cable/cable.types.d.ts +32 -0
  194. package/dist/types/v2/cable/cable.types.js +5 -0
  195. package/dist/types/v2/data/data.types.d.ts +32 -0
  196. package/dist/types/v2/data/data.types.js +5 -0
  197. package/dist/types/v2/electricity/electricity.types.d.ts +34 -0
  198. package/dist/types/v2/electricity/electricity.types.js +5 -0
  199. package/dist/types/v2/transfers/transfers.types.d.ts +99 -0
  200. package/dist/types/v2/transfers/transfers.types.js +5 -0
  201. package/package.json +42 -5
package/dist/index.js ADDED
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @module nomba
3
+ * @description Nomba SDK for Node.js
4
+ * @author Nomba Financial Services
5
+ * @version 1.0.0
6
+ * @license MIT
7
+ * @copyright 2026 Nomba
8
+ * @homepage https://nomba.com
9
+ * @support https://nomba.com/support
10
+ * @repository https://github.com/kudi-inc/nomba-sdk-node
11
+ * @docs https://developer.nomba.com
12
+ */
13
+ export { isPending, NombaError, OutcomeUnknownError, TokenError, UnconfirmedOutcomeError, } from "./lib/errors.js";
14
+ export { MemoryTokenStore } from "./lib/token-store.js";
15
+ export { verifyWebhook } from "./lib/webhooks.js";
16
+ export { Nomba } from "./nomba.js";
17
+ // HttpClient
18
+ export { HttpClient } from "./services/http/http-client.service.js";
19
+ // Accounts
20
+ // Deprecated pre-refactor names, kept so upgrading is not a breaking change.
21
+ export { AccountsService, AccountsService as Accounts, } from "./services/v1/accounts/accounts.service.js";
22
+ // v1 Validation Services (for v2 bill payments)
23
+ export { BettingService } from "./services/v1/betting/betting.service.js";
24
+ export { CableService } from "./services/v1/cable/cable.service.js";
25
+ // Charge
26
+ export { ChargeService, ChargeService as Charge, } from "./services/v1/charge/charge.service.js";
27
+ // Checkout
28
+ export { CheckoutService, CheckoutService as Checkout, } from "./services/v1/checkout/checkout.service.js";
29
+ export { DataService } from "./services/v1/data/data.service.js";
30
+ // DirectDebits
31
+ export { DirectDebitsService, DirectDebitsService as DirectDebits, } from "./services/v1/direct-debits/direct-debits.service.js";
32
+ export { ElectricityService } from "./services/v1/electricity/electricity.service.js";
33
+ // GlobalCollections
34
+ export { GlobalCollectionsService, GlobalCollectionsService as GlobalCollections, } from "./services/v1/globals/collections.service.js";
35
+ // GlobalPayout
36
+ export { GlobalPayoutService, GlobalPayoutService as GlobalPayout, } from "./services/v1/globals/payout.service.js";
37
+ // Requery
38
+ export { RequeryService, RequeryService as Requery, } from "./services/v1/requery/requery.service.js";
39
+ // Terminals
40
+ export { TerminalsService, TerminalsService as Terminals, } from "./services/v1/terminals/terminals.service.js";
41
+ // Transactions
42
+ export { TransactionsService, TransactionsService as Transactions, } from "./services/v1/transactions/transactions.service.js";
43
+ // VirtualAccounts
44
+ export { VirtualAccountsService, VirtualAccountsService as VirtualAccounts, } from "./services/v1/virtual-accounts/virtual-accounts.service.js";
45
+ // Webhooks
46
+ export { WebhooksService, WebhooksService as Webhooks, } from "./services/v1/webhooks/webhooks.service.js";
47
+ export { AirtimeV2Service } from "./services/v2/airtime/airtime.service.js";
48
+ export { BettingV2Service } from "./services/v2/betting/betting.service.js";
49
+ export { CableV2Service } from "./services/v2/cable/cable.service.js";
50
+ export { DataV2Service } from "./services/v2/data/data.service.js";
51
+ export { ElectricityV2Service } from "./services/v2/electricity/electricity.service.js";
52
+ // Transfers
53
+ export { TransfersService, TransfersService as Transfers, } from "./services/v2/transfers/transfers.service.js";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @module nomba/interfaces/http
3
+ * @description The transport every service depends on
4
+ */
5
+ import type { TokenData } from "../../lib/token-store.js";
6
+ import type { Environment, HttpMethod, HttpRequestOptions } from "../../types/common/common.types.js";
7
+ import type { OutcomeEvent } from "../../types/common/outcome.types.js";
8
+ export interface IHttpClient {
9
+ readonly environment: Environment;
10
+ /** Authenticated call; returns the response `data`. */
11
+ request<T>(method: HttpMethod, path: string, options?: HttpRequestOptions): Promise<T>;
12
+ issueToken(): Promise<TokenData>;
13
+ refreshToken(): Promise<TokenData>;
14
+ revokeToken(): Promise<void>;
15
+ /** Hands a money-moving call's outcome to NombaOptions.onOutcome. Never throws. */
16
+ reportOutcome(event: OutcomeEvent): void;
17
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/http
3
+ * @description The transport every service depends on
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type { IHttpClient } from "./IHttpClient.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @module nomba/interfaces/accounts
3
+ * @description Accounts service contract
4
+ */
5
+ import type { AccountBalance, AccountDetails, SubAccountLookup } from "../../../types/v1/accounts/accounts.types.js";
6
+ import type { Terminal, TerminalList, TerminalListParams } from "../../../types/v1/terminals/terminals.types.js";
7
+ export interface IAccountsService {
8
+ /** GET /v1/accounts/parent */
9
+ getParentAccount(): Promise<AccountDetails>;
10
+ /** GET /v1/accounts/balance */
11
+ getParentBalance(): Promise<AccountBalance>;
12
+ /** GET /v1/accounts/sub-account-details */
13
+ getSubAccount(lookup?: SubAccountLookup): Promise<AccountDetails>;
14
+ /** GET /v1/accounts/{subAccountId}/balance */
15
+ getSubAccountBalance(subAccountId: string): Promise<AccountBalance>;
16
+ /** GET /v1/accounts/terminals */
17
+ listParentTerminals(params?: TerminalListParams): Promise<TerminalList>;
18
+ /** GET /v1/accounts/{accountId}/terminals */
19
+ listSubAccountTerminals(accountId: string, params?: TerminalListParams): Promise<TerminalList>;
20
+ /** Every terminal of the parent account, across all pages. */
21
+ iterateParentTerminals(params?: TerminalListParams): AsyncGenerator<Terminal>;
22
+ /** Every terminal of a sub account, across all pages. */
23
+ iterateSubAccountTerminals(accountId: string, params?: TerminalListParams): AsyncGenerator<Terminal>;
24
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/accounts
3
+ * @description Accounts service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./IAccountsService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @module nomba/interfaces/v1/betting
3
+ * @description Betting v1 service contract for validation endpoints
4
+ */
5
+ import type { BettingCustomerLookupParams, BettingCustomerLookupResult, BettingProvidersResult } from "../../../types/v1/betting/betting.types.js";
6
+ export interface IBettingService {
7
+ /** GET /v1/bill/betting/providers - Fetch betting providers */
8
+ getBettingProviders(): Promise<BettingProvidersResult>;
9
+ /** GET /v1/bill/betting/lookup - Validate customer and get name */
10
+ lookupCustomer(params: BettingCustomerLookupParams): Promise<BettingCustomerLookupResult>;
11
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/v1/betting
3
+ * @description Betting v1 service contract for validation endpoints
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type { IBettingService } from "./IBettingService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @module nomba/interfaces/v1/cable
3
+ * @description Cable TV v1 service contract for validation endpoints
4
+ */
5
+ import type { CableCustomerLookupParams, CableCustomerLookupResult, CablePlansParams, CablePlansResult } from "../../../types/v1/cable/cable.types.js";
6
+ export interface ICableService {
7
+ /** GET /v1/bill/cableTvProduct - Fetch cable TV plans */
8
+ getCablePlans(params: CablePlansParams): Promise<CablePlansResult>;
9
+ /** GET /v1/bill/cable/lookup - Validate customer and get name */
10
+ lookupCustomer(params: CableCustomerLookupParams): Promise<CableCustomerLookupResult>;
11
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/v1/cable
3
+ * @description Cable TV v1 service contract for validation endpoints
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type { ICableService } from "./ICableService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @module nomba/interfaces/charge
3
+ * @description Charge service contract
4
+ */
5
+ import type { RequestOptions } from "../../../types/common/common.types.js";
6
+ import type { CancelChargeTransactionParams, ChargeOrder, ChargeTransactionDetails, FlashAccount, SaveCardOtpRequest, SubmitCardDetailsParams, SubmitCardDetailsResult, SubmitCardOtpParams, SubmitCardOtpResult, SubmitSaveCardOtpParams } from "../../../types/v1/charge/charge.types.js";
7
+ import type { CheckoutResult, TokenizedCardData } from "../../../types/v1/checkout/checkout.types.js";
8
+ export interface IChargeService {
9
+ /** GET /v1/checkout/order/{orderReference} */
10
+ getOrder(orderReference: string): Promise<ChargeOrder>;
11
+ /** POST /v1/checkout/checkout-card-detail */
12
+ submitCardDetails(params: SubmitCardDetailsParams, options?: RequestOptions): Promise<SubmitCardDetailsResult>;
13
+ /** POST /v1/checkout/checkout-card-otp */
14
+ submitCardOtp(params: SubmitCardOtpParams, options?: RequestOptions): Promise<SubmitCardOtpResult>;
15
+ /** POST /v1/checkout/resend-otp. Resends the payment OTP to the customer's phone. */
16
+ resendOtp(orderReference: string, options?: RequestOptions): Promise<CheckoutResult>;
17
+ /** POST /v1/checkout/confirm-transaction-receipt. The status after the OTP is submitted or a transfer is made. */
18
+ fetchTransactionDetails(orderReference: string): Promise<ChargeTransactionDetails>;
19
+ /** GET /v1/checkout/get-checkout-kta/{orderReference}. A Flash account number the customer can pay by transfer. */
20
+ fetchFlashAccount(orderReference: string): Promise<FlashAccount>;
21
+ /** POST /v1/checkout/transaction/cancel. Cancels an incomplete checkout transaction. */
22
+ cancelTransaction(params: CancelChargeTransactionParams, options?: RequestOptions): Promise<CheckoutResult>;
23
+ /** POST /v1/checkout/user-card/saved-card/auth. Sends an OTP; use when getOrder says the user has saved cards. */
24
+ requestSavedCardsOtp(orderReference: string, options?: RequestOptions): Promise<CheckoutResult>;
25
+ /** GET /v1/checkout/user-card/{orderReference}. Needs the OTP from requestSavedCardsOtp. */
26
+ getSavedCards(orderReference: string, otp: string): Promise<{
27
+ tokenizedCardData?: TokenizedCardData[];
28
+ }>;
29
+ /** POST /v1/checkout/user-card/auth. Sends an OTP before saving a card; call after a successful payment. */
30
+ requestSaveCardOtp(params: SaveCardOtpRequest, options?: RequestOptions): Promise<CheckoutResult>;
31
+ /** POST /v1/checkout/user-card. Submits the OTP, which saves the card for later use. */
32
+ submitSaveCardOtp(params: SubmitSaveCardOtpParams, options?: RequestOptions): Promise<CheckoutResult>;
33
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/charge
3
+ * @description Charge service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./IChargeService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @module nomba/interfaces/checkout
3
+ * @description Checkout service contract
4
+ */
5
+ import type { CallOptions, RequestOptions } from "../../../types/common/common.types.js";
6
+ import type { ChargeTokenizedCardParams, CheckoutOrderCreated, CheckoutResult, CheckoutTransaction, CreateCheckoutOrderParams, FetchCheckoutTransactionParams, ListTokenizedCardsParams, RefundCheckoutTransactionParams, TokenizedCardData, TokenizedCardList, TokenizedCardResult, UpdatedTokenizedCard, UpdateTokenizedCardParams } from "../../../types/v1/checkout/checkout.types.js";
7
+ export interface ICheckoutService {
8
+ /**
9
+ * POST /v1/checkout/order. Send the customer to `checkoutLink` to pay.
10
+ * Verified against a real sandbox call to use /v1/checkout/order, not /sandbox/checkout/order as the
11
+ * sandbox-testing guide claims (that path 404s); sandbox and production share this path.
12
+ */
13
+ createOrder(params: CreateCheckoutOrderParams, options?: RequestOptions): Promise<CheckoutOrderCreated>;
14
+ /** GET /v1/checkout/transaction. Verified in sandbox; see the note on createOrder. */
15
+ fetchTransaction(params?: FetchCheckoutTransactionParams): Promise<CheckoutTransaction>;
16
+ /** POST /v1/checkout/order/cancel. Only for orders not yet paid; use `refund` after payment. */
17
+ cancelOrder(orderReference: string, options?: RequestOptions): Promise<CheckoutResult>;
18
+ /** POST /v1/checkout/refund. Verified in sandbox; see the note on createOrder. */
19
+ refund<R = CheckoutResult>(params: RefundCheckoutTransactionParams, options?: CallOptions<CheckoutResult, R>): Promise<CheckoutResult | R>;
20
+ /** POST /v1/checkout/tokenized-card-payment. Check `status` on the result: it says whether the charge went through. */
21
+ chargeTokenizedCard(params: ChargeTokenizedCardParams, options?: RequestOptions): Promise<TokenizedCardResult>;
22
+ /** GET /v1/checkout/tokenized-card-data */
23
+ listTokenizedCards(params?: ListTokenizedCardsParams): Promise<TokenizedCardList>;
24
+ /** Every tokenized card matching the filters, across all pages. Starts at `params.page` if given. */
25
+ iterateTokenizedCards(params?: ListTokenizedCardsParams): AsyncGenerator<TokenizedCardData>;
26
+ /** POST /v1/checkout/tokenized-card-data */
27
+ updateTokenizedCard(params: UpdateTokenizedCardParams, options?: RequestOptions): Promise<UpdatedTokenizedCard>;
28
+ /** DELETE /v1/checkout/tokenized-card-data */
29
+ deleteTokenizedCard(tokenKey: string, options?: RequestOptions): Promise<TokenizedCardResult>;
30
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/checkout
3
+ * @description Checkout service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./ICheckoutService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @module nomba/interfaces/v1/data
3
+ * @description Data plans v1 service contract
4
+ */
5
+ import type { DataPlansResult } from "../../../types/v1/data/data.types.js";
6
+ export interface IDataService {
7
+ /** GET /v1/bill/data-plan/{telco} - Fetch data plans for a network */
8
+ getDataPlans(telco: string): Promise<DataPlansResult>;
9
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/v1/data
3
+ * @description Data plans v1 service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type { IDataService } from "./IDataService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @module nomba/interfaces/direct-debits
3
+ * @description DirectDebits service contract
4
+ */
5
+ import type { RequestOptions } from "../../../types/common/common.types.js";
6
+ import type { CreatedMandate, CreateMandateParams, DebitMandateParams, ListMandatesParams, MandateDebitResult, MandatePage, MandateStatus, UpdatedMandateStatus, UpdateMandateStatusParams } from "../../../types/v1/direct-debits/direct-debits.types.js";
7
+ export interface IDirectDebitsService {
8
+ /**
9
+ * POST /v1/direct-debits.
10
+ * ponytail: this endpoint's response envelope is `{ responseCode, responseMessage, data }`, unlike every
11
+ * other endpoint's `{ code, description, data }` — confirmed from the spec's own example, not guessed.
12
+ */
13
+ createMandate(params: CreateMandateParams, options?: RequestOptions): Promise<CreatedMandate>;
14
+ /** GET /v1/direct-debits/status?mandateId={mandateId} */
15
+ getMandateStatus(mandateId: string): Promise<MandateStatus>;
16
+ /**
17
+ * POST /v1/direct-debits/debit-mandate. Unlike createMandate, there is no per-transaction reference
18
+ * field to default the idempotency key to (mandateId is stable across every debit on that mandate, so
19
+ * defaulting to it would give every recurring debit the same key). Pass your own idempotencyKey if you
20
+ * need retries deduplicated; otherwise the client generates a fresh one per call.
21
+ */
22
+ debitMandate(params: DebitMandateParams, options?: RequestOptions): Promise<MandateDebitResult>;
23
+ /** GET /v1/direct-debits/mandates */
24
+ listMandates(params: ListMandatesParams): Promise<MandatePage>;
25
+ /**
26
+ * PUT /v1/direct-debits/update-status. Same reasoning as debitMandate: mandateId is stable across every
27
+ * status change on that mandate (SUSPEND, then ACTIVE, then SUSPEND again), so it is not a safe default
28
+ * idempotency key. Pass your own if you need a retry deduplicated.
29
+ */
30
+ updateMandateStatus(params: UpdateMandateStatusParams, options?: RequestOptions): Promise<UpdatedMandateStatus>;
31
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/direct-debits
3
+ * @description DirectDebits service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./IDirectDebitsService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @module nomba/interfaces/v1/electricity
3
+ * @description Electricity v1 service contract for validation endpoints
4
+ */
5
+ import type { ElectricityProvidersResult, MeterLookupParams, MeterLookupResult } from "../../../types/v1/electricity/electricity.types.js";
6
+ export interface IElectricityService {
7
+ /** GET /v1/bill/electricity/discos - Fetch electricity providers */
8
+ getElectricityProviders(): Promise<ElectricityProvidersResult>;
9
+ /** GET /v1/bill/electricity/lookup - Validate meter and get customer name */
10
+ lookupMeter(params: MeterLookupParams): Promise<MeterLookupResult>;
11
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/v1/electricity
3
+ * @description Electricity v1 service contract for validation endpoints
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type { IElectricityService } from "./IElectricityService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module nomba/interfaces/global-collections
3
+ * @description GlobalCollections service contract
4
+ */
5
+ import type { RequestOptions } from "../../../../types/common/common.types.js";
6
+ import type { CollectionTransaction, InflowProvider, InflowResult, InitiateInflowParams } from "../../../../types/v1/globals/collections.types.js";
7
+ export interface IGlobalCollectionsService {
8
+ /** GET /v1/global-collection/drc/inflow/providers */
9
+ inflowProviders(): Promise<InflowProvider[]>;
10
+ /** POST /v1/global-collection/inflow/initiate. Prompts the customer to approve the charge on their phone. */
11
+ initiateInflow(params: InitiateInflowParams, options?: RequestOptions): Promise<InflowResult>;
12
+ /** GET /v1/global-collection/transactions/{transactionId}, with the `transactionReference` from `initiateInflow`. */
13
+ getTransaction(transactionId: string): Promise<CollectionTransaction>;
14
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/global-collections
3
+ * @description GlobalCollections service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./IGlobalCollectionsService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @module nomba/interfaces/global-payout
3
+ * @description GlobalPayout service contract
4
+ */
5
+ import type { CallOptions, RequestOptions } from "../../../../types/common/common.types.js";
6
+ import type { AuthorizeExchangeParams, AuthorizeTransferParams, Conversion, ConvertMoneyParams, ExchangeRate, ExchangeRatesParams, InstitutionProvider, InstitutionProvidersParams, PaymentMethodInfo, PaymentMethodsParams, PayoutAccount, PayoutResult, PayoutTransaction } from "../../../../types/v1/globals/payout.types.js";
7
+ export interface IGlobalPayoutService {
8
+ /** GET /v1/global-payout/accounts. Every currency wallet with its balance. */
9
+ listAccounts(): Promise<PayoutAccount[]>;
10
+ /** GET /v1/global-payout/accounts/{accountId}. A 404 means the id is not one of your wallets. */
11
+ getAccount(accountId: string): Promise<PayoutAccount>;
12
+ /** GET /v1/sandbox/global-payout/accounts. Canned test data. */
13
+ listSandboxAccounts(): Promise<PayoutAccount[]>;
14
+ /** GET /v1/sandbox/global-payout/accounts/{accountId}. Canned test data; any id is echoed back. */
15
+ getSandboxAccount(accountId: string): Promise<PayoutAccount>;
16
+ /** GET /v1/global-payout/exchange-rates */
17
+ exchangeRates(params: ExchangeRatesParams): Promise<ExchangeRate[]>;
18
+ /** POST /v1/global-payout/money/convert. A calculation only; no money moves. */
19
+ convert(params: ConvertMoneyParams, options?: RequestOptions): Promise<Conversion>;
20
+ /** GET /v1/global-payout/bank/providers */
21
+ institutionProviders(params?: InstitutionProvidersParams): Promise<InstitutionProvider[]>;
22
+ /** GET /v1/global-payout/payment-methods */
23
+ paymentMethods(params?: PaymentMethodsParams): Promise<PaymentMethodInfo[]>;
24
+ /** POST /v1/global-payout/transfer/authorize. Sends money cross-border. */
25
+ authorizeTransfer<R = PayoutResult>(params: AuthorizeTransferParams, options?: CallOptions<PayoutResult, R>): Promise<PayoutResult | R>;
26
+ /** POST /v1/global-payout/exchange/authorize. Moves money between your own wallets in different currencies. */
27
+ authorizeExchange<R = PayoutResult>(params: AuthorizeExchangeParams, options?: CallOptions<PayoutResult, R>): Promise<PayoutResult | R>;
28
+ /** GET /v1/global-payout/transactions/{transactionId}, with a `wtTransactionId`. */
29
+ getTransaction(transactionId: string): Promise<PayoutTransaction>;
30
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/global-payout
3
+ * @description GlobalPayout service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./IGlobalPayoutService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @module nomba/interfaces/requery
3
+ * @description Requery service contract
4
+ */
5
+ import type { Transaction, TransactionLookup } from "../../../types/v1/requery/requery.types.js";
6
+ export interface IRequeryService {
7
+ /** GET /v1/transactions/accounts/single */
8
+ fetchParentTransaction(lookup: TransactionLookup): Promise<Transaction>;
9
+ /** GET /v1/transactions/accounts/{subAccountId}/single */
10
+ fetchSubAccountTransaction(subAccountId: string, lookup: TransactionLookup): Promise<Transaction>;
11
+ /**
12
+ * GET /v1/transactions/requery/{sessionId}. Use for transfers made through both parent and sub
13
+ * accounts. Nomba-to-Nomba wallet transfers return no sessionId; use fetchParentTransaction or
14
+ * fetchSubAccountTransaction for those instead.
15
+ */
16
+ requeryBySession(sessionId: string): Promise<Transaction>;
17
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/requery
3
+ * @description Requery service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./IRequeryService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @module nomba/interfaces/terminals
3
+ * @description Terminals service contract
4
+ */
5
+ import type { CallOptions, RequestOptions } from "../../../types/common/common.types.js";
6
+ import type { AssignTerminalParams, PushPaymentRequestParams, Terminal, TerminalPayment } from "../../../types/v1/terminals/terminals.types.js";
7
+ export interface ITerminalsService {
8
+ /** POST /v1/terminals/assign */
9
+ assignToParent(params: AssignTerminalParams, options?: RequestOptions): Promise<Terminal>;
10
+ /** POST /v1/terminals/assign/{subAccountId} */
11
+ assignToSubAccount(subAccountId: string, params: AssignTerminalParams, options?: RequestOptions): Promise<Terminal>;
12
+ /** POST /v1/terminals/unassign */
13
+ unassignFromParent(params: AssignTerminalParams, options?: RequestOptions): Promise<Terminal>;
14
+ /** POST /v1/terminals/unassign/{subAccountId} */
15
+ unassignFromSubAccount(subAccountId: string, params: AssignTerminalParams, options?: RequestOptions): Promise<Terminal>;
16
+ /** POST /v1/terminals/payment-request/{terminalId} */
17
+ pushPaymentRequest<R = TerminalPayment>(terminalId: string, params: PushPaymentRequestParams, options?: CallOptions<TerminalPayment, R>): Promise<TerminalPayment | R>;
18
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/terminals
3
+ * @description Terminals service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./ITerminalsService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @module nomba/interfaces/transactions
3
+ * @description Transactions service contract
4
+ */
5
+ import type { Page } from "../../../lib/util.js";
6
+ import type { Transaction } from "../../../types/v1/requery/requery.types.js";
7
+ import type { BankTransaction, BankTransactionList, FilterTransactionsParams, TransactionList, TransactionListParams, VirtualAccountTransaction, VirtualAccountTransactionParams } from "../../../types/v1/transactions/transactions.types.js";
8
+ export interface ITransactionsService {
9
+ /** GET /v1/transactions/bank. Credit/debit transactions on the parent account. */
10
+ listBankTransactions(params?: TransactionListParams): Promise<BankTransactionList>;
11
+ /** Every credit/debit transaction, across all pages. Starts at `params.cursor` if given. */
12
+ iterateBankTransactions(params?: TransactionListParams): AsyncGenerator<BankTransaction>;
13
+ /**
14
+ * GET /v1/transactions/virtual. Documented in the guide only. The response carries a `cursor`, but the
15
+ * guide names no paging parameter, so only the first page is returned.
16
+ */
17
+ listVirtualAccountTransactions({ accountNumber, ...dates }: VirtualAccountTransactionParams): Promise<Page<VirtualAccountTransaction>>;
18
+ /** GET /v1/transactions/accounts */
19
+ listParentTransactions(params?: TransactionListParams): Promise<TransactionList>;
20
+ /** Every transaction on the parent account, across all pages. Starts at `params.cursor` if given. */
21
+ iterateParentTransactions(params?: TransactionListParams): AsyncGenerator<Transaction>;
22
+ /** GET /v1/transactions/accounts/{subAccountId} */
23
+ listSubAccountTransactions(subAccountId: string, params?: TransactionListParams): Promise<TransactionList>;
24
+ /** Every transaction on a sub account, across all pages. Starts at `params.cursor` if given. */
25
+ iterateSubAccountTransactions(subAccountId: string, params?: TransactionListParams): AsyncGenerator<Transaction>;
26
+ /** POST /v1/transactions/accounts */
27
+ filterParentTransactions(filter?: FilterTransactionsParams, page?: TransactionListParams): Promise<TransactionList>;
28
+ /** Every parent transaction matching the filter, across all pages. Starts at `page.cursor` if given. */
29
+ iterateFilteredParentTransactions(filter?: FilterTransactionsParams, page?: TransactionListParams): AsyncGenerator<Transaction>;
30
+ /** POST /v1/transactions/accounts/{subAccountId} */
31
+ filterSubAccountTransactions(subAccountId: string, filter?: FilterTransactionsParams, page?: TransactionListParams): Promise<TransactionList>;
32
+ /** Every sub account transaction matching the filter, across all pages. Starts at `page.cursor` if given. */
33
+ iterateFilteredSubAccountTransactions(subAccountId: string, filter?: FilterTransactionsParams, page?: TransactionListParams): AsyncGenerator<Transaction>;
34
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/transactions
3
+ * @description Transactions service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./ITransactionsService.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @module nomba/interfaces/virtual-accounts
3
+ * @description VirtualAccounts service contract
4
+ */
5
+ import type { PageParams } from "../../../lib/util.js";
6
+ import type { RequestOptions } from "../../../types/common/common.types.js";
7
+ import type { CreatedVirtualAccount, CreateVirtualAccountParams, FilterVirtualAccountsParams, UpdateVirtualAccountParams, VirtualAccount, VirtualAccountList } from "../../../types/v1/virtual-accounts/virtual-accounts.types.js";
8
+ export interface IVirtualAccountsService {
9
+ /** POST /v1/accounts/virtual */
10
+ create(params: CreateVirtualAccountParams, options?: RequestOptions): Promise<CreatedVirtualAccount>;
11
+ /** POST /v1/accounts/virtual/{subAccountId}. Funds are collected in that sub account. */
12
+ createForSubAccount(subAccountId: string, params: CreateVirtualAccountParams, options?: RequestOptions): Promise<CreatedVirtualAccount>;
13
+ /** GET /v1/accounts/virtual/{identifier}. `identifier` is the accountRef or the virtual account number. */
14
+ get(identifier: string): Promise<VirtualAccount>;
15
+ /** PUT /v1/accounts/virtual/{identifier}. `identifier` is the accountRef or the 10 digit account number. */
16
+ update(identifier: string, params: UpdateVirtualAccountParams, options?: RequestOptions): Promise<{
17
+ updated: boolean;
18
+ }>;
19
+ /** DELETE /v1/accounts/virtual/{identifier}. Stops the account accepting payments. */
20
+ expire(identifier: string, options?: RequestOptions): Promise<{
21
+ expired: boolean;
22
+ }>;
23
+ /** POST /v1/accounts/virtual/list */
24
+ list(filter?: FilterVirtualAccountsParams, page?: PageParams): Promise<VirtualAccountList>;
25
+ /** Every matching virtual account, across all pages. Starts at `page.cursor` if given. */
26
+ iterate(filter?: FilterVirtualAccountsParams, page?: PageParams): AsyncGenerator<VirtualAccount>;
27
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module nomba/interfaces/virtual-accounts
3
+ * @description VirtualAccounts service contract
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export type * from "./IVirtualAccountsService.js";
@@ -0,0 +1 @@
1
+ export {};