@nomba/node-sdk 0.0.0-stage → 0.3.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.
- package/LICENSE +21 -0
- package/README.md +577 -2
- package/dist/index.d.ts +86 -0
- package/dist/index.js +53 -0
- package/dist/interfaces/http/IHttpClient.d.ts +17 -0
- package/dist/interfaces/http/IHttpClient.js +5 -0
- package/dist/interfaces/http/index.d.ts +1 -0
- package/dist/interfaces/http/index.js +1 -0
- package/dist/interfaces/v1/accounts/IAccountsService.d.ts +62 -0
- package/dist/interfaces/v1/accounts/IAccountsService.js +5 -0
- package/dist/interfaces/v1/accounts/index.d.ts +1 -0
- package/dist/interfaces/v1/accounts/index.js +1 -0
- package/dist/interfaces/v1/betting/IBettingService.d.ts +20 -0
- package/dist/interfaces/v1/betting/IBettingService.js +5 -0
- package/dist/interfaces/v1/betting/index.d.ts +1 -0
- package/dist/interfaces/v1/betting/index.js +1 -0
- package/dist/interfaces/v1/cable/ICableService.d.ts +21 -0
- package/dist/interfaces/v1/cable/ICableService.js +5 -0
- package/dist/interfaces/v1/cable/index.d.ts +1 -0
- package/dist/interfaces/v1/cable/index.js +1 -0
- package/dist/interfaces/v1/charge/IChargeService.d.ts +94 -0
- package/dist/interfaces/v1/charge/IChargeService.js +5 -0
- package/dist/interfaces/v1/charge/index.d.ts +1 -0
- package/dist/interfaces/v1/charge/index.js +1 -0
- package/dist/interfaces/v1/checkout/ICheckoutService.d.ts +79 -0
- package/dist/interfaces/v1/checkout/ICheckoutService.js +5 -0
- package/dist/interfaces/v1/checkout/index.d.ts +1 -0
- package/dist/interfaces/v1/checkout/index.js +1 -0
- package/dist/interfaces/v1/data/IDataService.d.ts +14 -0
- package/dist/interfaces/v1/data/IDataService.js +5 -0
- package/dist/interfaces/v1/data/index.d.ts +1 -0
- package/dist/interfaces/v1/data/index.js +1 -0
- package/dist/interfaces/v1/direct-debits/IDirectDebitsService.d.ts +54 -0
- package/dist/interfaces/v1/direct-debits/IDirectDebitsService.js +5 -0
- package/dist/interfaces/v1/direct-debits/index.d.ts +1 -0
- package/dist/interfaces/v1/direct-debits/index.js +1 -0
- package/dist/interfaces/v1/electricity/IElectricityService.d.ts +20 -0
- package/dist/interfaces/v1/electricity/IElectricityService.js +5 -0
- package/dist/interfaces/v1/electricity/index.d.ts +1 -0
- package/dist/interfaces/v1/electricity/index.js +1 -0
- package/dist/interfaces/v1/globals/collections/IGlobalCollectionsService.d.ts +29 -0
- package/dist/interfaces/v1/globals/collections/IGlobalCollectionsService.js +5 -0
- package/dist/interfaces/v1/globals/collections/index.d.ts +1 -0
- package/dist/interfaces/v1/globals/collections/index.js +1 -0
- package/dist/interfaces/v1/globals/payouts/IGlobalPayoutService.d.ts +91 -0
- package/dist/interfaces/v1/globals/payouts/IGlobalPayoutService.js +5 -0
- package/dist/interfaces/v1/globals/payouts/index.d.ts +1 -0
- package/dist/interfaces/v1/globals/payouts/index.js +1 -0
- package/dist/interfaces/v1/requery/IRequeryService.d.ts +31 -0
- package/dist/interfaces/v1/requery/IRequeryService.js +5 -0
- package/dist/interfaces/v1/requery/index.d.ts +1 -0
- package/dist/interfaces/v1/requery/index.js +1 -0
- package/dist/interfaces/v1/terminals/ITerminalsService.d.ts +51 -0
- package/dist/interfaces/v1/terminals/ITerminalsService.js +5 -0
- package/dist/interfaces/v1/terminals/index.d.ts +1 -0
- package/dist/interfaces/v1/terminals/index.js +1 -0
- package/dist/interfaces/v1/transactions/ITransactionsService.d.ts +93 -0
- package/dist/interfaces/v1/transactions/ITransactionsService.js +5 -0
- package/dist/interfaces/v1/transactions/index.d.ts +1 -0
- package/dist/interfaces/v1/transactions/index.js +1 -0
- package/dist/interfaces/v1/virtual-accounts/IVirtualAccountsService.d.ts +65 -0
- package/dist/interfaces/v1/virtual-accounts/IVirtualAccountsService.js +5 -0
- package/dist/interfaces/v1/virtual-accounts/index.d.ts +1 -0
- package/dist/interfaces/v1/virtual-accounts/index.js +1 -0
- package/dist/interfaces/v1/webhooks/IWebhooksService.d.ts +40 -0
- package/dist/interfaces/v1/webhooks/IWebhooksService.js +5 -0
- package/dist/interfaces/v1/webhooks/index.d.ts +1 -0
- package/dist/interfaces/v1/webhooks/index.js +1 -0
- package/dist/interfaces/v2/airtime/IAirtimeV2Service.d.ts +31 -0
- package/dist/interfaces/v2/airtime/IAirtimeV2Service.js +5 -0
- package/dist/interfaces/v2/airtime/index.d.ts +1 -0
- package/dist/interfaces/v2/airtime/index.js +1 -0
- package/dist/interfaces/v2/betting/IBettingV2Service.d.ts +31 -0
- package/dist/interfaces/v2/betting/IBettingV2Service.js +5 -0
- package/dist/interfaces/v2/betting/index.d.ts +1 -0
- package/dist/interfaces/v2/betting/index.js +1 -0
- package/dist/interfaces/v2/cable/ICableV2Service.d.ts +31 -0
- package/dist/interfaces/v2/cable/ICableV2Service.js +5 -0
- package/dist/interfaces/v2/cable/index.d.ts +1 -0
- package/dist/interfaces/v2/cable/index.js +1 -0
- package/dist/interfaces/v2/data/IDataV2Service.d.ts +31 -0
- package/dist/interfaces/v2/data/IDataV2Service.js +5 -0
- package/dist/interfaces/v2/data/index.d.ts +1 -0
- package/dist/interfaces/v2/data/index.js +1 -0
- package/dist/interfaces/v2/electricity/IElectricityV2Service.d.ts +32 -0
- package/dist/interfaces/v2/electricity/IElectricityV2Service.js +5 -0
- package/dist/interfaces/v2/electricity/index.d.ts +1 -0
- package/dist/interfaces/v2/electricity/index.js +1 -0
- package/dist/interfaces/v2/transfers/ITransfersService.d.ts +71 -0
- package/dist/interfaces/v2/transfers/ITransfersService.js +5 -0
- package/dist/interfaces/v2/transfers/index.d.ts +1 -0
- package/dist/interfaces/v2/transfers/index.js +1 -0
- package/dist/lib/errors.d.ts +62 -0
- package/dist/lib/errors.js +92 -0
- package/dist/lib/outcome.d.ts +37 -0
- package/dist/lib/outcome.js +126 -0
- package/dist/lib/paginate.d.ts +21 -0
- package/dist/lib/paginate.js +25 -0
- package/dist/lib/sdk-version.d.ts +5 -0
- package/dist/lib/sdk-version.generated.d.ts +1 -0
- package/dist/lib/sdk-version.generated.js +1 -0
- package/dist/lib/sdk-version.js +5 -0
- package/dist/lib/token-store.d.ts +49 -0
- package/dist/lib/token-store.js +26 -0
- package/dist/lib/util.d.ts +31 -0
- package/dist/lib/util.js +31 -0
- package/dist/lib/webhooks.d.ts +43 -0
- package/dist/lib/webhooks.js +64 -0
- package/dist/nomba.d.ts +96 -0
- package/dist/nomba.js +130 -0
- package/dist/services/http/http-client.service.d.ts +61 -0
- package/dist/services/http/http-client.service.js +351 -0
- package/dist/services/v1/accounts/accounts.service.d.ts +76 -0
- package/dist/services/v1/accounts/accounts.service.js +96 -0
- package/dist/services/v1/betting/betting.service.d.ts +25 -0
- package/dist/services/v1/betting/betting.service.js +30 -0
- package/dist/services/v1/cable/cable.service.d.ts +26 -0
- package/dist/services/v1/cable/cable.service.js +33 -0
- package/dist/services/v1/charge/charge.service.d.ts +113 -0
- package/dist/services/v1/charge/charge.service.js +161 -0
- package/dist/services/v1/checkout/checkout.service.d.ts +92 -0
- package/dist/services/v1/checkout/checkout.service.js +146 -0
- package/dist/services/v1/data/data.service.d.ts +20 -0
- package/dist/services/v1/data/data.service.js +22 -0
- package/dist/services/v1/direct-debits/direct-debits.service.d.ts +69 -0
- package/dist/services/v1/direct-debits/direct-debits.service.js +91 -0
- package/dist/services/v1/electricity/electricity.service.d.ts +26 -0
- package/dist/services/v1/electricity/electricity.service.js +31 -0
- package/dist/services/v1/globals/collections.service.d.ts +44 -0
- package/dist/services/v1/globals/collections.service.js +55 -0
- package/dist/services/v1/globals/payout.service.d.ts +105 -0
- package/dist/services/v1/globals/payout.service.js +154 -0
- package/dist/services/v1/requery/requery.service.d.ts +31 -0
- package/dist/services/v1/requery/requery.service.js +41 -0
- package/dist/services/v1/terminals/terminals.service.d.ts +38 -0
- package/dist/services/v1/terminals/terminals.service.js +58 -0
- package/dist/services/v1/transactions/transactions.service.d.ts +48 -0
- package/dist/services/v1/transactions/transactions.service.js +98 -0
- package/dist/services/v1/virtual-accounts/virtual-accounts.service.d.ts +40 -0
- package/dist/services/v1/virtual-accounts/virtual-accounts.service.js +55 -0
- package/dist/services/v1/webhooks/webhooks.service.d.ts +35 -0
- package/dist/services/v1/webhooks/webhooks.service.js +59 -0
- package/dist/services/v2/airtime/airtime.service.d.ts +42 -0
- package/dist/services/v2/airtime/airtime.service.js +55 -0
- package/dist/services/v2/betting/betting.service.d.ts +43 -0
- package/dist/services/v2/betting/betting.service.js +56 -0
- package/dist/services/v2/cable/cable.service.d.ts +43 -0
- package/dist/services/v2/cable/cable.service.js +56 -0
- package/dist/services/v2/data/data.service.d.ts +42 -0
- package/dist/services/v2/data/data.service.js +55 -0
- package/dist/services/v2/electricity/electricity.service.d.ts +44 -0
- package/dist/services/v2/electricity/electricity.service.js +57 -0
- package/dist/services/v2/transfers/transfers.service.d.ts +75 -0
- package/dist/services/v2/transfers/transfers.service.js +97 -0
- package/dist/types/common/common.types.d.ts +74 -0
- package/dist/types/common/common.types.js +5 -0
- package/dist/types/common/outcome.types.d.ts +53 -0
- package/dist/types/common/outcome.types.js +5 -0
- package/dist/types/v1/accounts/accounts.types.d.ts +37 -0
- package/dist/types/v1/accounts/accounts.types.js +8 -0
- package/dist/types/v1/betting/betting.types.d.ts +26 -0
- package/dist/types/v1/betting/betting.types.js +5 -0
- package/dist/types/v1/cable/cable.types.d.ts +24 -0
- package/dist/types/v1/cable/cable.types.js +5 -0
- package/dist/types/v1/charge/charge.types.d.ts +102 -0
- package/dist/types/v1/charge/charge.types.js +5 -0
- package/dist/types/v1/checkout/checkout.types.d.ts +139 -0
- package/dist/types/v1/checkout/checkout.types.js +5 -0
- package/dist/types/v1/data/data.types.d.ts +14 -0
- package/dist/types/v1/data/data.types.js +5 -0
- package/dist/types/v1/direct-debits/direct-debits.types.d.ts +104 -0
- package/dist/types/v1/direct-debits/direct-debits.types.js +5 -0
- package/dist/types/v1/electricity/electricity.types.d.ts +21 -0
- package/dist/types/v1/electricity/electricity.types.js +5 -0
- package/dist/types/v1/globals/collections.types.d.ts +49 -0
- package/dist/types/v1/globals/collections.types.js +5 -0
- package/dist/types/v1/globals/payout.types.d.ts +183 -0
- package/dist/types/v1/globals/payout.types.js +5 -0
- package/dist/types/v1/requery/requery.types.d.ts +49 -0
- package/dist/types/v1/requery/requery.types.js +5 -0
- package/dist/types/v1/terminals/terminals.types.d.ts +44 -0
- package/dist/types/v1/terminals/terminals.types.js +5 -0
- package/dist/types/v1/transactions/transactions.types.d.ts +87 -0
- package/dist/types/v1/transactions/transactions.types.js +5 -0
- package/dist/types/v1/virtual-accounts/virtual-accounts.types.d.ts +64 -0
- package/dist/types/v1/virtual-accounts/virtual-accounts.types.js +5 -0
- package/dist/types/v1/webhooks/webhooks.types.d.ts +54 -0
- package/dist/types/v1/webhooks/webhooks.types.js +5 -0
- package/dist/types/v2/airtime/airtime.types.d.ts +31 -0
- package/dist/types/v2/airtime/airtime.types.js +5 -0
- package/dist/types/v2/betting/betting.types.d.ts +33 -0
- package/dist/types/v2/betting/betting.types.js +5 -0
- package/dist/types/v2/cable/cable.types.d.ts +32 -0
- package/dist/types/v2/cable/cable.types.js +5 -0
- package/dist/types/v2/data/data.types.d.ts +32 -0
- package/dist/types/v2/data/data.types.js +5 -0
- package/dist/types/v2/electricity/electricity.types.d.ts +34 -0
- package/dist/types/v2/electricity/electricity.types.js +5 -0
- package/dist/types/v2/transfers/transfers.types.d.ts +99 -0
- package/dist/types/v2/transfers/transfers.types.js +5 -0
- package/package.json +42 -5
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
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 type { IHttpClient } from "./interfaces/http/IHttpClient.js";
|
|
14
|
+
export type * from "./interfaces/v1/accounts/IAccountsService.js";
|
|
15
|
+
export type * from "./interfaces/v1/betting/index.js";
|
|
16
|
+
export type * from "./interfaces/v1/cable/index.js";
|
|
17
|
+
export type * from "./interfaces/v1/charge/IChargeService.js";
|
|
18
|
+
export type * from "./interfaces/v1/checkout/ICheckoutService.js";
|
|
19
|
+
export type * from "./interfaces/v1/data/index.js";
|
|
20
|
+
export type * from "./interfaces/v1/direct-debits/IDirectDebitsService.js";
|
|
21
|
+
export type * from "./interfaces/v1/electricity/index.js";
|
|
22
|
+
export type * from "./interfaces/v1/globals/collections/IGlobalCollectionsService.js";
|
|
23
|
+
export type * from "./interfaces/v1/globals/payouts/IGlobalPayoutService.js";
|
|
24
|
+
export type * from "./interfaces/v1/requery/IRequeryService.js";
|
|
25
|
+
export type * from "./interfaces/v1/terminals/ITerminalsService.js";
|
|
26
|
+
export type * from "./interfaces/v1/transactions/ITransactionsService.js";
|
|
27
|
+
export type * from "./interfaces/v1/virtual-accounts/IVirtualAccountsService.js";
|
|
28
|
+
export type * from "./interfaces/v1/webhooks/IWebhooksService.js";
|
|
29
|
+
export type * from "./interfaces/v2/airtime/index.js";
|
|
30
|
+
export type * from "./interfaces/v2/betting/index.js";
|
|
31
|
+
export type * from "./interfaces/v2/cable/index.js";
|
|
32
|
+
export type * from "./interfaces/v2/data/index.js";
|
|
33
|
+
export type * from "./interfaces/v2/electricity/index.js";
|
|
34
|
+
export type * from "./interfaces/v2/transfers/ITransfersService.js";
|
|
35
|
+
export { isPending, NombaError, OutcomeUnknownError, TokenError, UnconfirmedOutcomeError, } from "./lib/errors.js";
|
|
36
|
+
export type { TokenData, TokenStore } from "./lib/token-store.js";
|
|
37
|
+
export { MemoryTokenStore } from "./lib/token-store.js";
|
|
38
|
+
export type { PageParams } from "./lib/util.js";
|
|
39
|
+
export type { WebhookEvent } from "./lib/webhooks.js";
|
|
40
|
+
export { verifyWebhook } from "./lib/webhooks.js";
|
|
41
|
+
export { Nomba } from "./nomba.js";
|
|
42
|
+
export { HttpClient } from "./services/http/http-client.service.js";
|
|
43
|
+
export { AccountsService, AccountsService as Accounts, } from "./services/v1/accounts/accounts.service.js";
|
|
44
|
+
export { BettingService } from "./services/v1/betting/betting.service.js";
|
|
45
|
+
export { CableService } from "./services/v1/cable/cable.service.js";
|
|
46
|
+
export { ChargeService, ChargeService as Charge, } from "./services/v1/charge/charge.service.js";
|
|
47
|
+
export { CheckoutService, CheckoutService as Checkout, } from "./services/v1/checkout/checkout.service.js";
|
|
48
|
+
export { DataService } from "./services/v1/data/data.service.js";
|
|
49
|
+
export { DirectDebitsService, DirectDebitsService as DirectDebits, } from "./services/v1/direct-debits/direct-debits.service.js";
|
|
50
|
+
export { ElectricityService } from "./services/v1/electricity/electricity.service.js";
|
|
51
|
+
export { GlobalCollectionsService, GlobalCollectionsService as GlobalCollections, } from "./services/v1/globals/collections.service.js";
|
|
52
|
+
export { GlobalPayoutService, GlobalPayoutService as GlobalPayout, } from "./services/v1/globals/payout.service.js";
|
|
53
|
+
export { RequeryService, RequeryService as Requery, } from "./services/v1/requery/requery.service.js";
|
|
54
|
+
export { TerminalsService, TerminalsService as Terminals, } from "./services/v1/terminals/terminals.service.js";
|
|
55
|
+
export { TransactionsService, TransactionsService as Transactions, } from "./services/v1/transactions/transactions.service.js";
|
|
56
|
+
export { VirtualAccountsService, VirtualAccountsService as VirtualAccounts, } from "./services/v1/virtual-accounts/virtual-accounts.service.js";
|
|
57
|
+
export { WebhooksService, WebhooksService as Webhooks, } from "./services/v1/webhooks/webhooks.service.js";
|
|
58
|
+
export { AirtimeV2Service } from "./services/v2/airtime/airtime.service.js";
|
|
59
|
+
export { BettingV2Service } from "./services/v2/betting/betting.service.js";
|
|
60
|
+
export { CableV2Service } from "./services/v2/cable/cable.service.js";
|
|
61
|
+
export { DataV2Service } from "./services/v2/data/data.service.js";
|
|
62
|
+
export { ElectricityV2Service } from "./services/v2/electricity/electricity.service.js";
|
|
63
|
+
export { TransfersService, TransfersService as Transfers, } from "./services/v2/transfers/transfers.service.js";
|
|
64
|
+
export type * from "./types/common/common.types.js";
|
|
65
|
+
export type * from "./types/common/outcome.types.js";
|
|
66
|
+
export type * from "./types/v1/accounts/accounts.types.js";
|
|
67
|
+
export type * from "./types/v1/betting/betting.types.js";
|
|
68
|
+
export type * from "./types/v1/cable/cable.types.js";
|
|
69
|
+
export type * from "./types/v1/charge/charge.types.js";
|
|
70
|
+
export type * from "./types/v1/checkout/checkout.types.js";
|
|
71
|
+
export type * from "./types/v1/data/data.types.js";
|
|
72
|
+
export type * from "./types/v1/direct-debits/direct-debits.types.js";
|
|
73
|
+
export type * from "./types/v1/electricity/electricity.types.js";
|
|
74
|
+
export type * from "./types/v1/globals/collections.types.js";
|
|
75
|
+
export type * from "./types/v1/globals/payout.types.js";
|
|
76
|
+
export type * from "./types/v1/requery/requery.types.js";
|
|
77
|
+
export type * from "./types/v1/terminals/terminals.types.js";
|
|
78
|
+
export type * from "./types/v1/transactions/transactions.types.js";
|
|
79
|
+
export type * from "./types/v1/virtual-accounts/virtual-accounts.types.js";
|
|
80
|
+
export type * from "./types/v1/webhooks/webhooks.types.js";
|
|
81
|
+
export type * from "./types/v2/airtime/airtime.types.js";
|
|
82
|
+
export type * from "./types/v2/betting/betting.types.js";
|
|
83
|
+
export type * from "./types/v2/cable/cable.types.js";
|
|
84
|
+
export type * from "./types/v2/data/data.types.js";
|
|
85
|
+
export type * from "./types/v2/electricity/electricity.types.js";
|
|
86
|
+
export type * from "./types/v2/transfers/transfers.types.js";
|
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 @@
|
|
|
1
|
+
export type { IHttpClient } from "./IHttpClient.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* `GET /v1/accounts/parent`.
|
|
10
|
+
* @returns The parent account's details.
|
|
11
|
+
* @throws {NombaError} The call failed.
|
|
12
|
+
*/
|
|
13
|
+
getParentAccount(): Promise<AccountDetails>;
|
|
14
|
+
/**
|
|
15
|
+
* `GET /v1/accounts/balance`.
|
|
16
|
+
* @returns The parent account's balance.
|
|
17
|
+
* @throws {NombaError} The call failed.
|
|
18
|
+
*/
|
|
19
|
+
getParentBalance(): Promise<AccountBalance>;
|
|
20
|
+
/**
|
|
21
|
+
* `GET /v1/accounts/sub-account-details`.
|
|
22
|
+
* @param lookup Which sub account to fetch, by account ID or account number.
|
|
23
|
+
* @returns The sub account's details.
|
|
24
|
+
* @throws {NombaError} The call failed, e.g. no sub account matches `lookup`.
|
|
25
|
+
*/
|
|
26
|
+
getSubAccount(lookup?: SubAccountLookup): Promise<AccountDetails>;
|
|
27
|
+
/**
|
|
28
|
+
* `GET /v1/accounts/{subAccountId}/balance`.
|
|
29
|
+
* @param subAccountId The sub account's ID.
|
|
30
|
+
* @returns The sub account's balance.
|
|
31
|
+
* @throws {NombaError} The call failed, e.g. `subAccountId` does not exist.
|
|
32
|
+
*/
|
|
33
|
+
getSubAccountBalance(subAccountId: string): Promise<AccountBalance>;
|
|
34
|
+
/**
|
|
35
|
+
* `GET /v1/accounts/terminals`.
|
|
36
|
+
* @param params Pagination (`cursor`, `size`) and other list filters.
|
|
37
|
+
* @returns One page of the parent account's terminals.
|
|
38
|
+
* @throws {NombaError} The call failed.
|
|
39
|
+
*/
|
|
40
|
+
listParentTerminals(params?: TerminalListParams): Promise<TerminalList>;
|
|
41
|
+
/**
|
|
42
|
+
* `GET /v1/accounts/{accountId}/terminals`.
|
|
43
|
+
* @param accountId The sub account's ID.
|
|
44
|
+
* @param params Pagination (`cursor`, `size`) and other list filters.
|
|
45
|
+
* @returns One page of the sub account's terminals.
|
|
46
|
+
* @throws {NombaError} The call failed, e.g. `accountId` does not exist.
|
|
47
|
+
*/
|
|
48
|
+
listSubAccountTerminals(accountId: string, params?: TerminalListParams): Promise<TerminalList>;
|
|
49
|
+
/**
|
|
50
|
+
* Every terminal of the parent account, across all pages. Starts at `params.cursor` if given.
|
|
51
|
+
* @param params Starting cursor and other list filters.
|
|
52
|
+
* @throws {NombaError} A page request failed.
|
|
53
|
+
*/
|
|
54
|
+
iterateParentTerminals(params?: TerminalListParams): AsyncGenerator<Terminal>;
|
|
55
|
+
/**
|
|
56
|
+
* Every terminal of a sub account, across all pages. Starts at `params.cursor` if given.
|
|
57
|
+
* @param accountId The sub account's ID.
|
|
58
|
+
* @param params Starting cursor and other list filters.
|
|
59
|
+
* @throws {NombaError} A page request failed, e.g. `accountId` does not exist.
|
|
60
|
+
*/
|
|
61
|
+
iterateSubAccountTerminals(accountId: string, params?: TerminalListParams): AsyncGenerator<Terminal>;
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from "./IAccountsService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* `GET /v1/bill/betting/providers`.
|
|
9
|
+
* @returns The supported betting providers.
|
|
10
|
+
* @throws {NombaError} The call failed.
|
|
11
|
+
*/
|
|
12
|
+
getBettingProviders(): Promise<BettingProvidersResult>;
|
|
13
|
+
/**
|
|
14
|
+
* `GET /v1/bill/betting/lookup`. Validates a customer ID and returns the account name.
|
|
15
|
+
* @param params The provider and customer ID to look up.
|
|
16
|
+
* @returns The customer's account name.
|
|
17
|
+
* @throws {NombaError} The call failed, e.g. the customer ID is invalid.
|
|
18
|
+
*/
|
|
19
|
+
lookupCustomer(params: BettingCustomerLookupParams): Promise<BettingCustomerLookupResult>;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IBettingService } from "./IBettingService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* `GET /v1/bill/cableTvProduct`.
|
|
9
|
+
* @param params The provider whose plans to fetch.
|
|
10
|
+
* @returns The provider's cable TV plans.
|
|
11
|
+
* @throws {NombaError} The call failed.
|
|
12
|
+
*/
|
|
13
|
+
getCablePlans(params: CablePlansParams): Promise<CablePlansResult>;
|
|
14
|
+
/**
|
|
15
|
+
* `GET /v1/bill/cable/lookup`. Validates a smartcard number and returns the account name.
|
|
16
|
+
* @param params The provider and smartcard number to look up.
|
|
17
|
+
* @returns The customer's account name.
|
|
18
|
+
* @throws {NombaError} The call failed, e.g. the smartcard number is invalid.
|
|
19
|
+
*/
|
|
20
|
+
lookupCustomer(params: CableCustomerLookupParams): Promise<CableCustomerLookupResult>;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ICableService } from "./ICableService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/interfaces/charge
|
|
3
|
+
* @description Charge service contract
|
|
4
|
+
*/
|
|
5
|
+
import type { CancelChargeTransactionParams, ChargeOrder, ChargeTransactionDetails, FlashAccount, SaveCardOtpRequest, SubmitCardDetailsParams, SubmitCardDetailsResult, SubmitCardOtpParams, SubmitCardOtpResult, SubmitSaveCardOtpParams } from "../../../types/v1/charge/charge.types.js";
|
|
6
|
+
import type { CheckoutResult, TokenizedCardData } from "../../../types/v1/checkout/checkout.types.js";
|
|
7
|
+
export interface IChargeService {
|
|
8
|
+
/**
|
|
9
|
+
* `GET /v1/checkout/order/{orderReference}`.
|
|
10
|
+
* @param orderReference The order's reference, from `nomba.checkout.createOrder`.
|
|
11
|
+
* @returns The order's details.
|
|
12
|
+
* @throws {NombaError} The call failed, e.g. `orderReference` does not exist.
|
|
13
|
+
*/
|
|
14
|
+
getOrder(orderReference: string): Promise<ChargeOrder>;
|
|
15
|
+
/**
|
|
16
|
+
* `POST /v1/checkout/checkout-card-detail`.
|
|
17
|
+
* @param params The order reference and card details to charge.
|
|
18
|
+
* @returns The result of submitting the card; an OTP is typically sent next.
|
|
19
|
+
* @throws {NombaError} The call failed, e.g. the card was declined.
|
|
20
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
21
|
+
*/
|
|
22
|
+
submitCardDetails(params: SubmitCardDetailsParams): Promise<SubmitCardDetailsResult>;
|
|
23
|
+
/**
|
|
24
|
+
* `POST /v1/checkout/checkout-card-otp`.
|
|
25
|
+
* @param params The order reference and OTP the customer received.
|
|
26
|
+
* @returns The result of submitting the OTP.
|
|
27
|
+
* @throws {NombaError} The call failed, e.g. the OTP was wrong or expired.
|
|
28
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
29
|
+
*/
|
|
30
|
+
submitCardOtp(params: SubmitCardOtpParams): Promise<SubmitCardOtpResult>;
|
|
31
|
+
/**
|
|
32
|
+
* `POST /v1/checkout/resend-otp`. Resends the payment OTP to the customer's phone.
|
|
33
|
+
* @param orderReference The order's reference.
|
|
34
|
+
* @throws {NombaError} The call failed, e.g. `orderReference` does not exist.
|
|
35
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
36
|
+
*/
|
|
37
|
+
resendOtp(orderReference: string): Promise<CheckoutResult>;
|
|
38
|
+
/**
|
|
39
|
+
* `POST /v1/checkout/confirm-transaction-receipt`. The status after the OTP is submitted or a transfer
|
|
40
|
+
* is made.
|
|
41
|
+
* @param orderReference The order's reference.
|
|
42
|
+
* @returns The transaction's current status.
|
|
43
|
+
* @throws {NombaError} The call failed, e.g. `orderReference` does not exist.
|
|
44
|
+
*/
|
|
45
|
+
fetchTransactionDetails(orderReference: string): Promise<ChargeTransactionDetails>;
|
|
46
|
+
/**
|
|
47
|
+
* `GET /v1/checkout/get-checkout-kta/{orderReference}`. A Flash account number the customer can pay by
|
|
48
|
+
* transfer.
|
|
49
|
+
* @param orderReference The order's reference.
|
|
50
|
+
* @returns The Flash account to transfer payment to.
|
|
51
|
+
* @throws {NombaError} The call failed, e.g. `orderReference` does not exist.
|
|
52
|
+
*/
|
|
53
|
+
fetchFlashAccount(orderReference: string): Promise<FlashAccount>;
|
|
54
|
+
/**
|
|
55
|
+
* `POST /v1/checkout/transaction/cancel`. Cancels an incomplete checkout transaction.
|
|
56
|
+
* @param params The order reference to cancel.
|
|
57
|
+
* @throws {NombaError} The call failed, e.g. the transaction already completed.
|
|
58
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
59
|
+
*/
|
|
60
|
+
cancelTransaction(params: CancelChargeTransactionParams): Promise<CheckoutResult>;
|
|
61
|
+
/**
|
|
62
|
+
* `POST /v1/checkout/user-card/saved-card/auth`. Sends an OTP; use when `getOrder` says the user has
|
|
63
|
+
* saved cards.
|
|
64
|
+
* @param orderReference The order's reference.
|
|
65
|
+
* @throws {NombaError} The call failed, e.g. `orderReference` does not exist.
|
|
66
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
67
|
+
*/
|
|
68
|
+
requestSavedCardsOtp(orderReference: string): Promise<CheckoutResult>;
|
|
69
|
+
/**
|
|
70
|
+
* `GET /v1/checkout/user-card/{orderReference}`. Needs the OTP from `requestSavedCardsOtp`.
|
|
71
|
+
* @param orderReference The order's reference.
|
|
72
|
+
* @param otp The OTP sent by `requestSavedCardsOtp`.
|
|
73
|
+
* @returns The customer's saved, tokenized cards.
|
|
74
|
+
* @throws {NombaError} The call failed, e.g. the OTP was wrong or expired.
|
|
75
|
+
*/
|
|
76
|
+
getSavedCards(orderReference: string, otp: string): Promise<{
|
|
77
|
+
tokenizedCardData?: TokenizedCardData[];
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* `POST /v1/checkout/user-card/auth`. Sends an OTP before saving a card; call after a successful
|
|
81
|
+
* payment.
|
|
82
|
+
* @param params The order reference and card to save.
|
|
83
|
+
* @throws {NombaError} The call failed, e.g. `orderReference` does not exist.
|
|
84
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
85
|
+
*/
|
|
86
|
+
requestSaveCardOtp(params: SaveCardOtpRequest): Promise<CheckoutResult>;
|
|
87
|
+
/**
|
|
88
|
+
* `POST /v1/checkout/user-card`. Submits the OTP, which saves the card for later use.
|
|
89
|
+
* @param params The order reference and OTP from `requestSaveCardOtp`.
|
|
90
|
+
* @throws {NombaError} The call failed, e.g. the OTP was wrong or expired.
|
|
91
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
92
|
+
*/
|
|
93
|
+
submitSaveCardOtp(params: SubmitSaveCardOtpParams): Promise<CheckoutResult>;
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from "./IChargeService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/interfaces/checkout
|
|
3
|
+
* @description Checkout service contract
|
|
4
|
+
*/
|
|
5
|
+
import type { CallOptions } 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
|
+
* @param params The order to create; `order.orderReference` is the idempotency key.
|
|
13
|
+
* @returns The created order, including `checkoutLink`.
|
|
14
|
+
* @throws {NombaError} The call failed.
|
|
15
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
16
|
+
*/
|
|
17
|
+
createOrder(params: CreateCheckoutOrderParams): Promise<CheckoutOrderCreated>;
|
|
18
|
+
/**
|
|
19
|
+
* `GET /v1/checkout/transaction`. Verified in sandbox; see the note on `createOrder`.
|
|
20
|
+
* @param params Which transaction to fetch, e.g. by `orderReference`.
|
|
21
|
+
* @returns The matching transaction.
|
|
22
|
+
* @throws {NombaError} The call failed, e.g. no transaction matches.
|
|
23
|
+
*/
|
|
24
|
+
fetchTransaction(params?: FetchCheckoutTransactionParams): Promise<CheckoutTransaction>;
|
|
25
|
+
/**
|
|
26
|
+
* `POST /v1/checkout/order/cancel`. Only for orders not yet paid; use `refund` after payment.
|
|
27
|
+
* @param orderReference The order's reference (used as idempotency key).
|
|
28
|
+
* @throws {NombaError} The call failed, e.g. the order was already paid.
|
|
29
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
30
|
+
*/
|
|
31
|
+
cancelOrder(orderReference: string): Promise<CheckoutResult>;
|
|
32
|
+
/**
|
|
33
|
+
* `POST /v1/checkout/refund`. Verified in sandbox; see the note on `createOrder`.
|
|
34
|
+
* @param params The transaction to refund; `transactionId` is the idempotency key.
|
|
35
|
+
* @param options Outcome handlers (`onSuccess`, `onPending`, `onFailed`).
|
|
36
|
+
* @returns The refund result, or the outcome `options` maps it to.
|
|
37
|
+
* @throws {NombaError} The call failed and is not retryable.
|
|
38
|
+
* @throws {OutcomeUnknownError} The request outcome could not be determined and no `onPending` was supplied.
|
|
39
|
+
* @throws {UnconfirmedOutcomeError} The response was pending or undocumented and no `onPending` was supplied.
|
|
40
|
+
*/
|
|
41
|
+
refund<R = CheckoutResult>(params: RefundCheckoutTransactionParams, options?: CallOptions<CheckoutResult, R>): Promise<CheckoutResult | R>;
|
|
42
|
+
/**
|
|
43
|
+
* `POST /v1/checkout/tokenized-card-payment`. Check `status` on the result: it says whether the charge
|
|
44
|
+
* went through.
|
|
45
|
+
* @param params The tokenized card and amount to charge; `order.orderReference` is the idempotency key.
|
|
46
|
+
* @returns The charge result.
|
|
47
|
+
* @throws {NombaError} The call failed, e.g. the token is invalid or expired.
|
|
48
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
49
|
+
*/
|
|
50
|
+
chargeTokenizedCard(params: ChargeTokenizedCardParams): Promise<TokenizedCardResult>;
|
|
51
|
+
/**
|
|
52
|
+
* `GET /v1/checkout/tokenized-card-data`.
|
|
53
|
+
* @param params Pagination (`page`) and other list filters.
|
|
54
|
+
* @returns One page of the customer's saved, tokenized cards.
|
|
55
|
+
* @throws {NombaError} The call failed.
|
|
56
|
+
*/
|
|
57
|
+
listTokenizedCards(params?: ListTokenizedCardsParams): Promise<TokenizedCardList>;
|
|
58
|
+
/**
|
|
59
|
+
* Every tokenized card matching the filters, across all pages. Starts at `params.page` if given.
|
|
60
|
+
* @param params Starting page and other list filters.
|
|
61
|
+
* @throws {NombaError} A page request failed.
|
|
62
|
+
*/
|
|
63
|
+
iterateTokenizedCards(params?: ListTokenizedCardsParams): AsyncGenerator<TokenizedCardData>;
|
|
64
|
+
/**
|
|
65
|
+
* `POST /v1/checkout/tokenized-card-data`.
|
|
66
|
+
* @param params The tokenized card's key and the fields to update; `tokenKey` is the idempotency key.
|
|
67
|
+
* @returns The updated tokenized card.
|
|
68
|
+
* @throws {NombaError} The call failed, e.g. the token is invalid.
|
|
69
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
70
|
+
*/
|
|
71
|
+
updateTokenizedCard(params: UpdateTokenizedCardParams): Promise<UpdatedTokenizedCard>;
|
|
72
|
+
/**
|
|
73
|
+
* `DELETE /v1/checkout/tokenized-card-data`.
|
|
74
|
+
* @param tokenKey The tokenized card's key (used as idempotency key).
|
|
75
|
+
* @throws {NombaError} The call failed, e.g. the token is invalid.
|
|
76
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed.
|
|
77
|
+
*/
|
|
78
|
+
deleteTokenizedCard(tokenKey: string): Promise<TokenizedCardResult>;
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from "./ICheckoutService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* `GET /v1/bill/data-plan/{telco}`.
|
|
9
|
+
* @param telco The telco network to list data plans for.
|
|
10
|
+
* @returns The available data plans for that telco.
|
|
11
|
+
* @throws {NombaError} `telco` is not a recognized network, or the request failed.
|
|
12
|
+
*/
|
|
13
|
+
getDataPlans(telco: string): Promise<DataPlansResult>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IDataService } from "./IDataService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/interfaces/direct-debits
|
|
3
|
+
* @description DirectDebits service contract
|
|
4
|
+
*/
|
|
5
|
+
import type { CreatedMandate, CreateMandateParams, DebitMandateParams, ListMandatesParams, MandateDebitResult, MandatePage, MandateStatus, UpdatedMandateStatus, UpdateMandateStatusParams } from "../../../types/v1/direct-debits/direct-debits.types.js";
|
|
6
|
+
export interface IDirectDebitsService {
|
|
7
|
+
/**
|
|
8
|
+
* `POST /v1/direct-debits`.
|
|
9
|
+
* ponytail: this endpoint's response envelope is `{ responseCode, responseMessage, data }`, unlike every
|
|
10
|
+
* other endpoint's `{ code, description, data }` — confirmed from the spec's own example, not guessed.
|
|
11
|
+
* @param params The mandate to create; `merchantReference` is the idempotency key.
|
|
12
|
+
* @returns The created mandate.
|
|
13
|
+
* @throws {NombaError} The mandate params were rejected.
|
|
14
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed;
|
|
15
|
+
* check the mandate status before retrying.
|
|
16
|
+
*/
|
|
17
|
+
createMandate(params: CreateMandateParams): Promise<CreatedMandate>;
|
|
18
|
+
/**
|
|
19
|
+
* `GET /v1/direct-debits/status?mandateId={mandateId}`.
|
|
20
|
+
* @param mandateId The mandate to look up.
|
|
21
|
+
* @returns The mandate's current status.
|
|
22
|
+
* @throws {NombaError} `mandateId` is not found, or the request failed.
|
|
23
|
+
*/
|
|
24
|
+
getMandateStatus(mandateId: string): Promise<MandateStatus>;
|
|
25
|
+
/**
|
|
26
|
+
* `POST /v1/direct-debits/debit-mandate`. No per-transaction reference field exists in params, so a
|
|
27
|
+
* random idempotency key is generated for error tracking. If the outcome is unknown, requery the mandate
|
|
28
|
+
* before retrying.
|
|
29
|
+
* @param params The mandate to debit and the amount.
|
|
30
|
+
* @returns The debit result.
|
|
31
|
+
* @throws {NombaError} The mandate is not active, or the debit was rejected.
|
|
32
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed;
|
|
33
|
+
* check the mandate status before retrying.
|
|
34
|
+
*/
|
|
35
|
+
debitMandate(params: DebitMandateParams): Promise<MandateDebitResult>;
|
|
36
|
+
/**
|
|
37
|
+
* `GET /v1/direct-debits/mandates`.
|
|
38
|
+
* @param params Pagination and filter params.
|
|
39
|
+
* @returns A page of mandates.
|
|
40
|
+
* @throws {NombaError} The request failed.
|
|
41
|
+
*/
|
|
42
|
+
listMandates(params: ListMandatesParams): Promise<MandatePage>;
|
|
43
|
+
/**
|
|
44
|
+
* `PUT /v1/direct-debits/update-status`. No per-change reference field exists in params, so a random
|
|
45
|
+
* idempotency key is generated for error tracking. If the outcome is unknown, check the mandate status
|
|
46
|
+
* before retrying.
|
|
47
|
+
* @param params The mandate and the new status.
|
|
48
|
+
* @returns The mandate's updated status.
|
|
49
|
+
* @throws {NombaError} The status transition is invalid, or the request failed.
|
|
50
|
+
* @throws {OutcomeUnknownError} The call failed in a way that does not say whether it was processed;
|
|
51
|
+
* check the mandate status before retrying.
|
|
52
|
+
*/
|
|
53
|
+
updateMandateStatus(params: UpdateMandateStatusParams): Promise<UpdatedMandateStatus>;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from "./IDirectDebitsService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|