@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
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/global-payout
|
|
3
|
+
* @description GlobalPayout types
|
|
4
|
+
*/
|
|
5
|
+
export type ExchangeRatesParams = {
|
|
6
|
+
/** ISO 4217. */
|
|
7
|
+
from: string;
|
|
8
|
+
/** ISO 4217. */
|
|
9
|
+
to: string;
|
|
10
|
+
region?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ConvertMoneyParams = {
|
|
13
|
+
amount: number;
|
|
14
|
+
/** ISO 4217 source currency. */
|
|
15
|
+
currency: string;
|
|
16
|
+
destinationCurrency: string;
|
|
17
|
+
/** EXCHANGE for currency conversions. */
|
|
18
|
+
transactionType: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Sent in the body; the API dedupes on it (same key and body replays the original, with `idempotentReplay`).
|
|
22
|
+
* The SDK generates a UUID when you omit it. After an OutcomeUnknownError, retry with the error's
|
|
23
|
+
* `idempotencyKey`; change anything about the payment and you must use a new key. At most 128 characters.
|
|
24
|
+
*/
|
|
25
|
+
export type BodyIdempotencyKey = {
|
|
26
|
+
idempotencyKey?: string;
|
|
27
|
+
};
|
|
28
|
+
export type AuthorizeExchangeParams = BodyIdempotencyKey & {
|
|
29
|
+
amount: number;
|
|
30
|
+
sourceCurrency: string;
|
|
31
|
+
destinationCurrency: string;
|
|
32
|
+
senderName: string;
|
|
33
|
+
receiverName: string;
|
|
34
|
+
/** ISO 3166-1 alpha-2. */
|
|
35
|
+
sourceCountryIsoCode: string;
|
|
36
|
+
destinationCountryIsoCode: string;
|
|
37
|
+
narration?: string;
|
|
38
|
+
/** An `exchangeRateId` from `exchangeRates`. */
|
|
39
|
+
lockedExchangeRateId?: string;
|
|
40
|
+
};
|
|
41
|
+
export type PaymentMethod = "BANK" | "MobileMoney" | "INTERAC" | "FASTER_PAYMENTS" | "SEPA" | "ACH" | "WIRE";
|
|
42
|
+
/** Which fields are required depends on the payment method and corridor; see `paymentMethods`. */
|
|
43
|
+
export type AuthorizeTransferParams = BodyIdempotencyKey & {
|
|
44
|
+
amount: number;
|
|
45
|
+
sourceCurrency: string;
|
|
46
|
+
destinationCurrency: string;
|
|
47
|
+
receiverName: string;
|
|
48
|
+
/** ISO 3166-1 alpha-2. */
|
|
49
|
+
sourceCountryIsoCode: string;
|
|
50
|
+
destinationCountryIsoCode: string;
|
|
51
|
+
paymentMethod: PaymentMethod;
|
|
52
|
+
accountType: "INDIVIDUAL" | "CORPORATE";
|
|
53
|
+
/** Account number, IBAN, or phone number for MobileMoney. */
|
|
54
|
+
accountNumber?: string;
|
|
55
|
+
/** Bank code, sort code, SWIFT/BIC or institution number, depending on the method. */
|
|
56
|
+
institutionCode?: string;
|
|
57
|
+
institutionName?: string;
|
|
58
|
+
/** Required for ACH and WIRE. */
|
|
59
|
+
bankAccountType?: "CHECKING" | "SAVINGS";
|
|
60
|
+
/** Required for ACH, WIRE and SEPA: a code from `purposeOfPayments` in `paymentMethods`. */
|
|
61
|
+
purposeOfPayment?: string;
|
|
62
|
+
narration?: string;
|
|
63
|
+
lockedExchangeRateId?: string;
|
|
64
|
+
bankAddress?: string;
|
|
65
|
+
bankCity?: string;
|
|
66
|
+
bankState?: string;
|
|
67
|
+
bankZipCode?: string;
|
|
68
|
+
beneficiary?: {
|
|
69
|
+
beneficiaryEmail?: string;
|
|
70
|
+
securityQuestion?: string;
|
|
71
|
+
securityQuestionAnswer?: string;
|
|
72
|
+
/** Canada only. */
|
|
73
|
+
transitNumber?: string;
|
|
74
|
+
beneficiaryAddress?: string;
|
|
75
|
+
beneficiaryCity?: string;
|
|
76
|
+
beneficiaryState?: string;
|
|
77
|
+
beneficiaryPostCode?: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export type PayoutStatus = "PROCESSING" | "COMPLETED" | "FAILED" | "PENDING";
|
|
81
|
+
export type InstitutionProvidersParams = {
|
|
82
|
+
/** true for mobile money providers, false for banks and other institutions. */
|
|
83
|
+
isMobileMoney?: boolean;
|
|
84
|
+
/** ISO 3166-1 alpha-2 destination country. */
|
|
85
|
+
countryIsoCode?: string;
|
|
86
|
+
};
|
|
87
|
+
export type PaymentMethodsParams = {
|
|
88
|
+
/** Include it to get the corridor's exact requiredFields and optionalFields. */
|
|
89
|
+
destinationCountryIsoCode?: string;
|
|
90
|
+
destinationCurrency?: string;
|
|
91
|
+
code?: string;
|
|
92
|
+
name?: string;
|
|
93
|
+
};
|
|
94
|
+
export type PayoutAccount = {
|
|
95
|
+
/** The wallet id; pass to `getAccount`. Not a currency code. */
|
|
96
|
+
accountId: string;
|
|
97
|
+
name: string;
|
|
98
|
+
currency: string;
|
|
99
|
+
/** Null when the balance could not be read (status UNAVAILABLE). */
|
|
100
|
+
balance: number | null;
|
|
101
|
+
/** The balance less liens. Null when the balance could not be read. */
|
|
102
|
+
availableBalance: number | null;
|
|
103
|
+
/** UNAVAILABLE: the account exists but its balance could not be read this time; retry. */
|
|
104
|
+
status: "ACTIVE" | "UNAVAILABLE";
|
|
105
|
+
operationRegion?: string;
|
|
106
|
+
};
|
|
107
|
+
export type ExchangeRate = {
|
|
108
|
+
/** Pass as `lockedExchangeRateId` to use this rate. */
|
|
109
|
+
exchangeRateId: string;
|
|
110
|
+
currencyPairName: string;
|
|
111
|
+
/** Formatted, e.g. "$1.13". */
|
|
112
|
+
bidRate: string;
|
|
113
|
+
askRate: string;
|
|
114
|
+
midRate: string;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
tradeRegion?: string;
|
|
117
|
+
tradeContext?: string;
|
|
118
|
+
updatedAt?: string;
|
|
119
|
+
};
|
|
120
|
+
export type Conversion = {
|
|
121
|
+
fromAmount: number;
|
|
122
|
+
fromCurrency: string;
|
|
123
|
+
fromFormatted?: string;
|
|
124
|
+
toAmount: number;
|
|
125
|
+
toCurrency: string;
|
|
126
|
+
toFormatted?: string;
|
|
127
|
+
spreadAmount?: number;
|
|
128
|
+
spreadCurrency?: string;
|
|
129
|
+
exchangeRateId: string;
|
|
130
|
+
currencyPairName?: string;
|
|
131
|
+
feeAmount?: number;
|
|
132
|
+
feeCurrency?: string;
|
|
133
|
+
feeExpression?: string;
|
|
134
|
+
};
|
|
135
|
+
export type PayoutResult = {
|
|
136
|
+
/** Pass to `getTransaction`. */
|
|
137
|
+
wtTransactionId: string;
|
|
138
|
+
coreTransactionId?: string;
|
|
139
|
+
/** A replay returns the current status, which may still be PROCESSING; use the webhook for the outcome. */
|
|
140
|
+
status: PayoutStatus;
|
|
141
|
+
coreStatus?: string;
|
|
142
|
+
/** TRANSFER or EXCHANGE. */
|
|
143
|
+
type?: string;
|
|
144
|
+
prettyStatus?: string;
|
|
145
|
+
idempotencyKey?: string;
|
|
146
|
+
/** True when nothing new was created because the key was already used. */
|
|
147
|
+
idempotentReplay?: boolean;
|
|
148
|
+
/** Amounts in here are strings, e.g. "250.0". */
|
|
149
|
+
meta?: Record<string, string>;
|
|
150
|
+
};
|
|
151
|
+
export type PayoutTransaction = {
|
|
152
|
+
transactionId: string;
|
|
153
|
+
status: PayoutStatus;
|
|
154
|
+
coreStatus?: string;
|
|
155
|
+
type?: string;
|
|
156
|
+
createdAt?: string;
|
|
157
|
+
idempotencyKey?: string;
|
|
158
|
+
};
|
|
159
|
+
export type InstitutionProvider = {
|
|
160
|
+
/** Pass as `institutionCode`. */
|
|
161
|
+
code: string;
|
|
162
|
+
/** Pass as `institutionName`. */
|
|
163
|
+
displayName: string;
|
|
164
|
+
};
|
|
165
|
+
export type PaymentMethodInfo = {
|
|
166
|
+
code: string;
|
|
167
|
+
displayName: string;
|
|
168
|
+
purposeOfPaymentRequired?: boolean;
|
|
169
|
+
/** Empty on the catalogue response (no destinationCountryIsoCode). */
|
|
170
|
+
purposeOfPayments?: {
|
|
171
|
+
code: string;
|
|
172
|
+
displayName: string;
|
|
173
|
+
}[];
|
|
174
|
+
/** Dotted names are nested fields, e.g. beneficiary.transitNumber. */
|
|
175
|
+
requiredFields?: string[];
|
|
176
|
+
optionalFields?: string[];
|
|
177
|
+
accountTypes?: string[];
|
|
178
|
+
bankAccountTypes?: string[];
|
|
179
|
+
supportedCorridors?: {
|
|
180
|
+
countryIsoCode: string;
|
|
181
|
+
currency: string;
|
|
182
|
+
}[];
|
|
183
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/requery
|
|
3
|
+
* @description Requery types
|
|
4
|
+
*/
|
|
5
|
+
import type { TransferType } from "../../v2/transfers/transfers.types.js";
|
|
6
|
+
type LookupFields = {
|
|
7
|
+
transactionRef?: string;
|
|
8
|
+
merchantTxRef?: string;
|
|
9
|
+
/** Online checkout order reference. */
|
|
10
|
+
orderReference?: string;
|
|
11
|
+
/** Online checkout order id. */
|
|
12
|
+
orderId?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Each field is independently optional per the docs, but the endpoint needs at least one to identify a transaction. */
|
|
15
|
+
export type TransactionLookup = ({
|
|
16
|
+
transactionRef: string;
|
|
17
|
+
} & LookupFields) | ({
|
|
18
|
+
merchantTxRef: string;
|
|
19
|
+
} & LookupFields) | ({
|
|
20
|
+
orderReference: string;
|
|
21
|
+
} & LookupFields) | ({
|
|
22
|
+
orderId: string;
|
|
23
|
+
} & LookupFields);
|
|
24
|
+
export type Transaction = {
|
|
25
|
+
id: string;
|
|
26
|
+
/** No "NEW" here, unlike TransferStatus — the requery endpoints' spec doesn't list it. */
|
|
27
|
+
status: "SUCCESS" | "PENDING_BILLING" | "REFUND" | "CANCELLED" | "PAYMENT_FAILED" | "REVERSED_BY_VENDOR";
|
|
28
|
+
amount: number;
|
|
29
|
+
fixedCharge?: number;
|
|
30
|
+
source: "api" | "pos" | "web" | "android_app" | "ios_app";
|
|
31
|
+
type: TransferType;
|
|
32
|
+
gatewayMessage: string;
|
|
33
|
+
customerBillerId?: string;
|
|
34
|
+
timeCreated: string;
|
|
35
|
+
posTid?: string;
|
|
36
|
+
terminalId?: string;
|
|
37
|
+
providerTerminalId?: string;
|
|
38
|
+
/** Retrieval Reference Number. */
|
|
39
|
+
rrn?: string;
|
|
40
|
+
posSerialNumber?: string;
|
|
41
|
+
posTerminalLabel?: string;
|
|
42
|
+
/** System Trace Audit Number. */
|
|
43
|
+
stan?: string;
|
|
44
|
+
paymentVendorReference?: string;
|
|
45
|
+
userId?: string;
|
|
46
|
+
posRrn?: string;
|
|
47
|
+
merchantTxRef?: string;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/terminals
|
|
3
|
+
* @description Terminals types
|
|
4
|
+
*/
|
|
5
|
+
import type { PageParams } from "../../../lib/util.js";
|
|
6
|
+
export type TerminalListParams = PageParams & {
|
|
7
|
+
terminalId?: string;
|
|
8
|
+
serialNumber?: string;
|
|
9
|
+
terminalLabel?: string;
|
|
10
|
+
merchantName?: string;
|
|
11
|
+
};
|
|
12
|
+
export type AssignTerminalParams = {
|
|
13
|
+
serialNumber: string;
|
|
14
|
+
terminalLabel?: string;
|
|
15
|
+
};
|
|
16
|
+
export type PushPaymentRequestParams = {
|
|
17
|
+
/** Unique identifier for the order associated with the payment. */
|
|
18
|
+
merchantTxRef: string;
|
|
19
|
+
/** In the smallest currency unit (e.g. kobo). */
|
|
20
|
+
amount: number;
|
|
21
|
+
currency: "NGN" | "USD" | "CDF";
|
|
22
|
+
};
|
|
23
|
+
export type Terminal = {
|
|
24
|
+
terminalId: string;
|
|
25
|
+
serialNumber: string;
|
|
26
|
+
accountId: string;
|
|
27
|
+
parentAccountId: string;
|
|
28
|
+
merchantName: string;
|
|
29
|
+
terminalLabel: string;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
};
|
|
33
|
+
export type TerminalList = {
|
|
34
|
+
results: Terminal[];
|
|
35
|
+
/** Pass as `cursor` to get the next page. Empty when there are no more pages. */
|
|
36
|
+
cursor: string;
|
|
37
|
+
};
|
|
38
|
+
export type TerminalPayment = {
|
|
39
|
+
paymentId: string;
|
|
40
|
+
status: "pending" | "completed" | "failed";
|
|
41
|
+
amount: number;
|
|
42
|
+
currency: string;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/transactions
|
|
3
|
+
* @description Transactions types
|
|
4
|
+
*/
|
|
5
|
+
import type { Page, PageParams } from "../../../lib/util.js";
|
|
6
|
+
import type { TransferType } from "../../v2/transfers/transfers.types.js";
|
|
7
|
+
import type { Transaction } from "../requery/requery.types.js";
|
|
8
|
+
export type BankTransaction = {
|
|
9
|
+
amount: number;
|
|
10
|
+
currency: "NGN";
|
|
11
|
+
meta: {
|
|
12
|
+
billerId?: string;
|
|
13
|
+
terminalActionId?: string;
|
|
14
|
+
productId?: string;
|
|
15
|
+
fee?: number;
|
|
16
|
+
type?: string;
|
|
17
|
+
transactionId?: string;
|
|
18
|
+
/** Retrieval Reference Number. */
|
|
19
|
+
rrn?: string;
|
|
20
|
+
parentAccountId?: string;
|
|
21
|
+
terminalLabel?: string;
|
|
22
|
+
accountId?: string;
|
|
23
|
+
merchantTxRef?: string;
|
|
24
|
+
transactionAmount?: number;
|
|
25
|
+
mCollectionsId?: string;
|
|
26
|
+
};
|
|
27
|
+
status: "SUCCESS" | "PENDING_BILLING" | "REFUND" | "CANCELLED" | "PAYMENT_FAILED" | "REVERSED_BY_VENDOR";
|
|
28
|
+
timeUpdated: string;
|
|
29
|
+
walletBalance: number;
|
|
30
|
+
transactionType: "CREDIT" | "DEBIT";
|
|
31
|
+
};
|
|
32
|
+
/** From the guide's example only (no API reference page); amounts come back as strings, e.g. "100.0". */
|
|
33
|
+
export type VirtualAccountTransaction = {
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
id: string;
|
|
36
|
+
status: string;
|
|
37
|
+
amount: string;
|
|
38
|
+
fixedCharge?: string;
|
|
39
|
+
source?: string;
|
|
40
|
+
type?: string;
|
|
41
|
+
timeCreated: string;
|
|
42
|
+
timeUpdated?: string;
|
|
43
|
+
walletCurrency?: string;
|
|
44
|
+
walletBalance?: string;
|
|
45
|
+
paymentVendorReference?: string;
|
|
46
|
+
senderName?: string;
|
|
47
|
+
recipientAccountNumber?: string;
|
|
48
|
+
recipientAccountName?: string;
|
|
49
|
+
recipientAccountType?: string;
|
|
50
|
+
sessionId?: string;
|
|
51
|
+
accountNumber?: string;
|
|
52
|
+
bankCode?: string;
|
|
53
|
+
bankName?: string;
|
|
54
|
+
/** e.g. CREDIT. */
|
|
55
|
+
entryType?: string;
|
|
56
|
+
narration?: string;
|
|
57
|
+
currency?: string;
|
|
58
|
+
};
|
|
59
|
+
export type DateRangeParams = {
|
|
60
|
+
/** UTC, e.g. "2023-01-01T00:00:00" */
|
|
61
|
+
dateFrom?: string;
|
|
62
|
+
/** UTC, e.g. "2024-09-30T23:59:59" */
|
|
63
|
+
dateTo?: string;
|
|
64
|
+
};
|
|
65
|
+
export type TransactionListParams = PageParams & DateRangeParams;
|
|
66
|
+
/** Pass `cursor` back to get the next page. Empty when there are no more pages. */
|
|
67
|
+
export type TransactionList = Page<Transaction>;
|
|
68
|
+
export type BankTransactionList = Page<BankTransaction>;
|
|
69
|
+
export type FilterTransactionsParams = {
|
|
70
|
+
transactionRef?: string;
|
|
71
|
+
/** Broader than Transaction's own status: includes filter-only states like NEW and PENDING_PAYMENT. */
|
|
72
|
+
status?: "NEW" | "PENDING_PAYMENT" | "PAYMENT_SUCCESSFUL" | "PAYMENT_FAILED" | "PENDING_BILLING" | "SUCCESS" | "REFUND";
|
|
73
|
+
source?: "api" | "pos" | "web" | "android_app" | "ios_app";
|
|
74
|
+
type?: TransferType;
|
|
75
|
+
terminalId?: string;
|
|
76
|
+
/** Retrieval Reference Number. */
|
|
77
|
+
rrn?: string;
|
|
78
|
+
merchantTxRef?: string;
|
|
79
|
+
/** Online checkout order reference. */
|
|
80
|
+
orderReference?: string;
|
|
81
|
+
/** Online checkout order id. */
|
|
82
|
+
orderId?: string;
|
|
83
|
+
};
|
|
84
|
+
export type VirtualAccountTransactionParams = DateRangeParams & {
|
|
85
|
+
/** The virtual account number. */
|
|
86
|
+
accountNumber: string;
|
|
87
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/virtual-accounts
|
|
3
|
+
* @description VirtualAccounts types
|
|
4
|
+
*/
|
|
5
|
+
export type CreateVirtualAccountParams = {
|
|
6
|
+
/** Your unique reference for the account. 16 to 64 characters. */
|
|
7
|
+
accountRef: string;
|
|
8
|
+
/** 8 to 64 characters. */
|
|
9
|
+
accountName: string;
|
|
10
|
+
/** The guide lists it as required; the API spec does not list it. */
|
|
11
|
+
currency?: "NGN";
|
|
12
|
+
/** Defaults to the parent account's BVN. */
|
|
13
|
+
bvn?: string;
|
|
14
|
+
/** Exactly 11 digits. Can be sent alone or with `bvn`. */
|
|
15
|
+
nin?: string;
|
|
16
|
+
/** e.g. "2026-01-30 12:15:00". Omit for a permanent (static) account. */
|
|
17
|
+
expiryDate?: string;
|
|
18
|
+
/** The account then accepts only this exact amount. */
|
|
19
|
+
expectedAmount?: number;
|
|
20
|
+
};
|
|
21
|
+
export type UpdateVirtualAccountParams = {
|
|
22
|
+
/** 8 to 64 characters. Advised in the webhook after the update. */
|
|
23
|
+
newAccountRef?: string;
|
|
24
|
+
accountName?: string;
|
|
25
|
+
/** Decimal string, e.g. "100.0". The account then accepts only this exact amount. */
|
|
26
|
+
expectedAmount?: string;
|
|
27
|
+
};
|
|
28
|
+
export type FilterVirtualAccountsParams = {
|
|
29
|
+
accountName?: string;
|
|
30
|
+
accountRef?: string;
|
|
31
|
+
bvn?: string;
|
|
32
|
+
bankAccountNumber?: string;
|
|
33
|
+
/** ISO 8601, e.g. "2023-08-30T14:56:59.000Z" */
|
|
34
|
+
dateCreatedFrom?: string;
|
|
35
|
+
dateCreatedTo?: string;
|
|
36
|
+
expired?: boolean;
|
|
37
|
+
/** Whether the virtual account is in use. */
|
|
38
|
+
resourceAcquired?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type VirtualAccount = {
|
|
41
|
+
createdAt: string;
|
|
42
|
+
accountHolderId: string;
|
|
43
|
+
accountRef: string;
|
|
44
|
+
bvn: string;
|
|
45
|
+
accountName: string;
|
|
46
|
+
bankName: string;
|
|
47
|
+
bankAccountName: string;
|
|
48
|
+
bankAccountNumber: string;
|
|
49
|
+
currency: "NGN";
|
|
50
|
+
/** The spec lists it as required, but the docs' own lookup example omits it. */
|
|
51
|
+
callbackUrl?: string;
|
|
52
|
+
expired: boolean;
|
|
53
|
+
};
|
|
54
|
+
/** The create response. Its spec's `required` list names fields it does not define, so only what the docs' example shows is required. */
|
|
55
|
+
export type CreatedVirtualAccount = Omit<VirtualAccount, "expired"> & {
|
|
56
|
+
identifierType?: "BVN" | "NIN" | "BVN_AND_NIN";
|
|
57
|
+
expiryDate?: string;
|
|
58
|
+
expired?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export type VirtualAccountList = {
|
|
61
|
+
results: VirtualAccount[];
|
|
62
|
+
/** Pass as `cursor` to get the next page. Empty when there are no more pages. */
|
|
63
|
+
cursor: string;
|
|
64
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/webhooks
|
|
3
|
+
* @description Webhooks types
|
|
4
|
+
*/
|
|
5
|
+
export type EventLogsParams = {
|
|
6
|
+
coreUserId?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
/** e.g. payment_success. */
|
|
9
|
+
eventType?: string;
|
|
10
|
+
/** e.g. 2025-03-03. */
|
|
11
|
+
startDateTime?: string;
|
|
12
|
+
endDateTime?: string;
|
|
13
|
+
};
|
|
14
|
+
export type EventsParams = {
|
|
15
|
+
coreUserId?: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
};
|
|
18
|
+
/** INCONCLUSIVE and PUSHED events may already have reached your server: make your handler idempotent. */
|
|
19
|
+
export type ReplayStatus = "INITIATED" | "FAILED" | "INCONCLUSIVE" | "PUSHED";
|
|
20
|
+
export type ReplayEventType = "PAYMENT_SUCCESS" | "PAYMENT_FAILED" | "PAYOUT_SUCCESS" | "PAYOUT_FAILED" | "ORDER_SUCCESS" | "PAYMENT_REVERSAL" | "PAYOUT_REFUND";
|
|
21
|
+
export type ReplayParams = {
|
|
22
|
+
/** RFC 3339, e.g. 2026-01-27T00:00:00Z. */
|
|
23
|
+
startDate: string;
|
|
24
|
+
endDate: string;
|
|
25
|
+
filter?: {
|
|
26
|
+
statuses?: ReplayStatus[];
|
|
27
|
+
eventTypes?: ReplayEventType[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type EventLog = {
|
|
31
|
+
webhookUrl?: string;
|
|
32
|
+
eventId?: number;
|
|
33
|
+
eventType?: string;
|
|
34
|
+
/** Pass to `repush` / `bulkRepush`. */
|
|
35
|
+
hookRequestId?: string;
|
|
36
|
+
/** Your server's response body. */
|
|
37
|
+
responsePayload?: string;
|
|
38
|
+
responseHttpStatus?: number;
|
|
39
|
+
};
|
|
40
|
+
export type WebhookSubscription = {
|
|
41
|
+
webHookId?: number;
|
|
42
|
+
eventURL?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
eventType?: string;
|
|
45
|
+
enabled?: boolean;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* `pageToken` is returned, but the guide does not say how to send it back for the next page, so the SDK
|
|
49
|
+
* does not paginate.
|
|
50
|
+
*/
|
|
51
|
+
export type WebhookList<T> = {
|
|
52
|
+
list: T[];
|
|
53
|
+
pageToken?: string;
|
|
54
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/v2/airtime
|
|
3
|
+
* @description Airtime v2 types
|
|
4
|
+
*/
|
|
5
|
+
import type { Network } from "../../common/common.types.js";
|
|
6
|
+
export type AirtimePurchaseParams = {
|
|
7
|
+
amount: number;
|
|
8
|
+
/** 11 to 13 characters. */
|
|
9
|
+
phoneNumber: string;
|
|
10
|
+
network: Network;
|
|
11
|
+
/** Idempotency key: unique per purchase. */
|
|
12
|
+
merchantTxRef: string;
|
|
13
|
+
senderName?: string;
|
|
14
|
+
};
|
|
15
|
+
export type AirtimePurchaseV2Result = {
|
|
16
|
+
/** Pass to requery to confirm the final status. */
|
|
17
|
+
id: string;
|
|
18
|
+
/** SUCCESS or PENDING_BILLING are documented; treat anything else as pending. */
|
|
19
|
+
status: string;
|
|
20
|
+
type: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
timeCreated: string;
|
|
23
|
+
source?: string;
|
|
24
|
+
sourceUserId?: string | null;
|
|
25
|
+
/** Phone number credited with the airtime. */
|
|
26
|
+
customerBillerId?: string;
|
|
27
|
+
/** The spec types it as a string; a sandbox call (2026-09-29) returned null. */
|
|
28
|
+
productId?: string | null;
|
|
29
|
+
meta?: Record<string, unknown>;
|
|
30
|
+
userId?: string | null;
|
|
31
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/v2/betting
|
|
3
|
+
* @description Betting v2 types
|
|
4
|
+
*/
|
|
5
|
+
export type BettingPaymentParams = {
|
|
6
|
+
/** From `bettingProviders`. */
|
|
7
|
+
bettingProvider: string;
|
|
8
|
+
/** Idempotency key: unique per payment. */
|
|
9
|
+
merchantTxRef: string;
|
|
10
|
+
phoneNumber: string;
|
|
11
|
+
payerName: string;
|
|
12
|
+
amount: number;
|
|
13
|
+
/** Same as verified with `lookupBetting`. */
|
|
14
|
+
customerId: string;
|
|
15
|
+
};
|
|
16
|
+
export type BettingPaymentV2Result = {
|
|
17
|
+
/** Pass to requery to confirm the final status. */
|
|
18
|
+
id: string;
|
|
19
|
+
/** SUCCESS or PENDING_BILLING are documented; treat anything else as pending. */
|
|
20
|
+
status: string;
|
|
21
|
+
/** e.g. betting. */
|
|
22
|
+
type: string;
|
|
23
|
+
amount: number;
|
|
24
|
+
timeCreated: string;
|
|
25
|
+
source?: string;
|
|
26
|
+
sourceUserId?: string | null;
|
|
27
|
+
/** Betting account credited with the payment. */
|
|
28
|
+
customerBillerId?: string;
|
|
29
|
+
/** The betting provider, e.g. "betnaija". */
|
|
30
|
+
productId?: string;
|
|
31
|
+
meta?: Record<string, unknown>;
|
|
32
|
+
userId?: string | null;
|
|
33
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/v2/cable
|
|
3
|
+
* @description Cable TV v2 types
|
|
4
|
+
*/
|
|
5
|
+
/** The guide lists dstv, gotv, startimes and ShowMax. */
|
|
6
|
+
export type CableTvType = "dstv" | "gotv" | "startimes" | "ShowMax" | (string & {});
|
|
7
|
+
export type CableTvSubscriptionParams = {
|
|
8
|
+
cableTvType: CableTvType;
|
|
9
|
+
/** Idempotency key: unique per payment. */
|
|
10
|
+
merchantTxRef: string;
|
|
11
|
+
payerName: string;
|
|
12
|
+
amount: number;
|
|
13
|
+
customerId: string;
|
|
14
|
+
};
|
|
15
|
+
export type CablePaymentV2Result = {
|
|
16
|
+
/** Pass to requery to confirm the final status. */
|
|
17
|
+
id: string;
|
|
18
|
+
/** SUCCESS or PENDING_BILLING are documented; treat anything else as pending. */
|
|
19
|
+
status: string;
|
|
20
|
+
/** e.g. dstv. */
|
|
21
|
+
type: string;
|
|
22
|
+
amount: number;
|
|
23
|
+
timeCreated: string;
|
|
24
|
+
source?: string;
|
|
25
|
+
sourceUserId?: string | null;
|
|
26
|
+
/** Smartcard number credited with the payment. */
|
|
27
|
+
customerBillerId?: string;
|
|
28
|
+
/** The cable TV provider, e.g. "gotv". */
|
|
29
|
+
productId?: string;
|
|
30
|
+
meta?: Record<string, unknown>;
|
|
31
|
+
userId?: string | null;
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/v2/data
|
|
3
|
+
* @description Data v2 types
|
|
4
|
+
*/
|
|
5
|
+
import type { Network } from "../../common/common.types.js";
|
|
6
|
+
export type DataPurchaseParams = {
|
|
7
|
+
/** From `dataPlans`. Buying by amount is deprecated and not supported here. */
|
|
8
|
+
productId: string;
|
|
9
|
+
/** 11 to 13 characters. */
|
|
10
|
+
phoneNumber: string;
|
|
11
|
+
network: Network;
|
|
12
|
+
/** Idempotency key: unique per purchase. */
|
|
13
|
+
merchantTxRef: string;
|
|
14
|
+
senderName?: string;
|
|
15
|
+
};
|
|
16
|
+
export type DataPurchaseV2Result = {
|
|
17
|
+
/** Pass to requery to confirm the final status. */
|
|
18
|
+
id: string;
|
|
19
|
+
/** SUCCESS or PENDING_BILLING are documented; treat anything else as pending. */
|
|
20
|
+
status: string;
|
|
21
|
+
type: string;
|
|
22
|
+
amount: number;
|
|
23
|
+
timeCreated: string;
|
|
24
|
+
source?: string;
|
|
25
|
+
sourceUserId?: string | null;
|
|
26
|
+
/** Phone number credited with the bundle. */
|
|
27
|
+
customerBillerId?: string;
|
|
28
|
+
/** The bundle's productId, e.g. "mtn1". */
|
|
29
|
+
productId?: string;
|
|
30
|
+
meta?: Record<string, unknown>;
|
|
31
|
+
userId?: string | null;
|
|
32
|
+
};
|