@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,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/v1/cable
|
|
3
|
+
* @description Cable TV v1 validation types
|
|
4
|
+
*/
|
|
5
|
+
export type CablePlan = {
|
|
6
|
+
subScriptionType: string;
|
|
7
|
+
amount: number;
|
|
8
|
+
};
|
|
9
|
+
export type CablePlansParams = {
|
|
10
|
+
cableTvType: string;
|
|
11
|
+
};
|
|
12
|
+
export type CablePlansResult = {
|
|
13
|
+
code: string;
|
|
14
|
+
data: CablePlan[];
|
|
15
|
+
};
|
|
16
|
+
export type CableCustomerLookupParams = {
|
|
17
|
+
cableTvType: string;
|
|
18
|
+
customerId: string;
|
|
19
|
+
};
|
|
20
|
+
export type CableCustomerLookupResult = {
|
|
21
|
+
code: string;
|
|
22
|
+
/** Customer name associated with the cable account */
|
|
23
|
+
data: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/charge
|
|
3
|
+
* @description Charge types
|
|
4
|
+
*/
|
|
5
|
+
/** The shape shown in the docs' example for the stringified `cardDetails`. Use strings for values with leading zeros, which numbers would lose. */
|
|
6
|
+
export type CardDetails = {
|
|
7
|
+
cardCVV: number | string;
|
|
8
|
+
cardExpiryMonth: number | string;
|
|
9
|
+
cardExpiryYear: number | string;
|
|
10
|
+
cardNumber: string;
|
|
11
|
+
cardPin: number | string;
|
|
12
|
+
};
|
|
13
|
+
/** Browser information for the device making the calls, used for 3D Secure. */
|
|
14
|
+
export type DeviceInformation = {
|
|
15
|
+
httpBrowserLanguage?: string;
|
|
16
|
+
httpBrowserJavaEnabled?: boolean;
|
|
17
|
+
httpBrowserJavaScriptEnabled?: boolean;
|
|
18
|
+
httpBrowserColorDepth?: string;
|
|
19
|
+
httpBrowserScreenHeight?: string;
|
|
20
|
+
httpBrowserScreenWidth?: string;
|
|
21
|
+
httpBrowserTimeDifference?: string;
|
|
22
|
+
userAgentBrowserValue?: string;
|
|
23
|
+
deviceChannel?: string;
|
|
24
|
+
};
|
|
25
|
+
export type SubmitCardDetailsParams = {
|
|
26
|
+
/**
|
|
27
|
+
* The docs call this "Stringified card details". Pass a CardDetails object to have it
|
|
28
|
+
* JSON-stringified, or an already prepared string (e.g. when data encryption is in use).
|
|
29
|
+
* The docs do not describe the encryption scheme, so the SDK does not encrypt.
|
|
30
|
+
*/
|
|
31
|
+
cardDetails?: string | CardDetails;
|
|
32
|
+
/** The encryption key if data encryption is in use, else an empty string. */
|
|
33
|
+
key?: string;
|
|
34
|
+
orderReference?: string;
|
|
35
|
+
/** Save the card for later. Not complete until the user-card OTP endpoints are called. */
|
|
36
|
+
saveCard?: boolean;
|
|
37
|
+
deviceInformation?: DeviceInformation;
|
|
38
|
+
};
|
|
39
|
+
export type SubmitCardOtpParams = {
|
|
40
|
+
otp: string;
|
|
41
|
+
orderReference: string;
|
|
42
|
+
/** The transactionId returned when the card details were submitted. */
|
|
43
|
+
transactionId: string;
|
|
44
|
+
};
|
|
45
|
+
export type CancelChargeTransactionParams = {
|
|
46
|
+
transactionId: string;
|
|
47
|
+
forceCancel: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type SaveCardOtpRequest = {
|
|
50
|
+
orderReference: string;
|
|
51
|
+
phoneNumber: string;
|
|
52
|
+
};
|
|
53
|
+
export type SubmitSaveCardOtpParams = SaveCardOtpRequest & {
|
|
54
|
+
otp: string;
|
|
55
|
+
};
|
|
56
|
+
export type ChargeOrderDetails = {
|
|
57
|
+
orderId?: string;
|
|
58
|
+
orderReference?: string;
|
|
59
|
+
customerId?: string;
|
|
60
|
+
accountId?: string;
|
|
61
|
+
callbackUrl?: string;
|
|
62
|
+
customerEmail?: string;
|
|
63
|
+
amount?: number;
|
|
64
|
+
currency?: string;
|
|
65
|
+
businessName?: string;
|
|
66
|
+
businessEmail?: string;
|
|
67
|
+
businessLogo?: string;
|
|
68
|
+
};
|
|
69
|
+
export type ChargeOrder = {
|
|
70
|
+
order?: ChargeOrderDetails;
|
|
71
|
+
hasSavedCards?: boolean;
|
|
72
|
+
/** Returned when data encryption is enabled for submitting card details, else an empty string. */
|
|
73
|
+
base64EncodedRsaPublicKey?: string;
|
|
74
|
+
};
|
|
75
|
+
export type SubmitCardDetailsResult = {
|
|
76
|
+
status?: boolean;
|
|
77
|
+
message?: string;
|
|
78
|
+
/** "00" completed, "T0" an OTP was sent and must be submitted next, "SO" 3D Secure is required (see secureAuthenticationData). */
|
|
79
|
+
responseCode?: string;
|
|
80
|
+
/** Pass this to the calls that need a transactionId. */
|
|
81
|
+
transactionId?: string;
|
|
82
|
+
secureAuthenticationData?: {
|
|
83
|
+
jwt?: string;
|
|
84
|
+
md?: string;
|
|
85
|
+
acsUrl?: string;
|
|
86
|
+
termUrl?: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export type SubmitCardOtpResult = {
|
|
90
|
+
status: boolean;
|
|
91
|
+
message: string;
|
|
92
|
+
};
|
|
93
|
+
export type ChargeTransactionDetails = {
|
|
94
|
+
status: boolean;
|
|
95
|
+
message: string;
|
|
96
|
+
order?: ChargeOrderDetails;
|
|
97
|
+
};
|
|
98
|
+
export type FlashAccount = {
|
|
99
|
+
accountNumber: string;
|
|
100
|
+
accountName: string;
|
|
101
|
+
bankName: string;
|
|
102
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/checkout
|
|
3
|
+
* @description Checkout types
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Checkout transaction status values returned in transactionDetails.status.
|
|
7
|
+
* Use this field (not statusCode) to verify payment success.
|
|
8
|
+
* @see https://developer.nomba.com/docs/products/accept-payment/verify-transactions
|
|
9
|
+
*/
|
|
10
|
+
export type CheckoutTransactionStatus = "PAYMENT SUCCESSFUL" | "PENDING" | "FAILED PAYMENT";
|
|
11
|
+
export type CheckoutOrder = {
|
|
12
|
+
/** Your reference for the order. */
|
|
13
|
+
orderReference?: string;
|
|
14
|
+
customerId?: string;
|
|
15
|
+
/** Where the customer is redirected after payment. */
|
|
16
|
+
callbackUrl: string;
|
|
17
|
+
customerEmail: string;
|
|
18
|
+
amount: number;
|
|
19
|
+
/** The API spec lists NGN, CDF and USD; the checkout guide also lists EUR and GBP (activated on request). DRC accounts cannot use NGN. */
|
|
20
|
+
currency: "NGN" | "CDF" | "USD" | "EUR" | "GBP";
|
|
21
|
+
/** Account to deposit the funds into. Must be one of your outlet accounts. */
|
|
22
|
+
accountId?: string;
|
|
23
|
+
/** Payment methods to show. Defaults to all supported for your account and region. */
|
|
24
|
+
allowedPaymentMethods?: ("Card" | "Transfer" | "Nomba QR" | "USSD" | "Buy Now Pay Later" | "MOMO" | "Intl Card" | "Apple Pay" | "Intl Transfer")[];
|
|
25
|
+
/** Splits the inflow across accounts. */
|
|
26
|
+
splitRequest?: {
|
|
27
|
+
splitType?: "PERCENTAGE" | "AMOUNT";
|
|
28
|
+
splitList?: {
|
|
29
|
+
accountId?: string;
|
|
30
|
+
value?: number;
|
|
31
|
+
}[];
|
|
32
|
+
};
|
|
33
|
+
/** String keys and values, returned in webhook payloads. Set "region" to "CD" to route through DRC checkout. */
|
|
34
|
+
orderMetaData?: Record<string, string>;
|
|
35
|
+
};
|
|
36
|
+
export type CreateCheckoutOrderParams = {
|
|
37
|
+
order: CheckoutOrder;
|
|
38
|
+
/** Tokenize the card used, only if you will charge it again later. */
|
|
39
|
+
tokenizeCard?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type FetchCheckoutTransactionParams = {
|
|
42
|
+
/** "ORDER_REFERENCE" is the reference you passed; "ORDER_ID" is the uuid Nomba returned. */
|
|
43
|
+
idType?: "ORDER_ID" | "ORDER_REFERENCE";
|
|
44
|
+
id?: string;
|
|
45
|
+
};
|
|
46
|
+
export type RefundCheckoutTransactionParams = {
|
|
47
|
+
transactionId: string;
|
|
48
|
+
/** For a partial refund. */
|
|
49
|
+
amount?: number;
|
|
50
|
+
/** Refund by bank transfer: 10 digit account number and bank code. */
|
|
51
|
+
accountNumber?: string;
|
|
52
|
+
bankCode?: string;
|
|
53
|
+
};
|
|
54
|
+
export type ChargeTokenizedCardParams = {
|
|
55
|
+
/** The tokenKey returned in the webhook. */
|
|
56
|
+
tokenKey: string;
|
|
57
|
+
order?: CheckoutOrder;
|
|
58
|
+
};
|
|
59
|
+
export type ListTokenizedCardsParams = {
|
|
60
|
+
customerEmail?: string;
|
|
61
|
+
/** Based on when the token was created. */
|
|
62
|
+
startDate?: string;
|
|
63
|
+
endDate?: string;
|
|
64
|
+
/** Page number to start from. Omit or 0 for the first page. */
|
|
65
|
+
page?: number;
|
|
66
|
+
};
|
|
67
|
+
export type UpdateTokenizedCardParams = {
|
|
68
|
+
tokenKey: string;
|
|
69
|
+
currentEmailAddress: string;
|
|
70
|
+
newEmailAddress: string;
|
|
71
|
+
};
|
|
72
|
+
export type CheckoutOrderCreated = {
|
|
73
|
+
checkoutLink: string;
|
|
74
|
+
/** The Nomba-generated order id, not the reference you passed. Use it as `id` with idType "ORDER_ID". */
|
|
75
|
+
orderReference: string;
|
|
76
|
+
};
|
|
77
|
+
export type CheckoutTransaction = {
|
|
78
|
+
success?: boolean;
|
|
79
|
+
message?: string;
|
|
80
|
+
order?: {
|
|
81
|
+
orderId?: string;
|
|
82
|
+
orderReference?: string;
|
|
83
|
+
customerId?: string;
|
|
84
|
+
accountId?: string;
|
|
85
|
+
callbackUrl?: string;
|
|
86
|
+
customerEmail?: string;
|
|
87
|
+
amount?: number;
|
|
88
|
+
currency?: string;
|
|
89
|
+
};
|
|
90
|
+
transactionDetails?: {
|
|
91
|
+
transactionDate?: string;
|
|
92
|
+
paymentReference?: string;
|
|
93
|
+
paymentVendorReference?: string;
|
|
94
|
+
tokenizedCardPayment?: boolean;
|
|
95
|
+
/** Card processor response code. Use `status` field for payment verification. */
|
|
96
|
+
statusCode?: string;
|
|
97
|
+
/** Payment status. Use this field to verify payment success, not statusCode. */
|
|
98
|
+
status?: CheckoutTransactionStatus;
|
|
99
|
+
};
|
|
100
|
+
transferDetails?: {
|
|
101
|
+
sessionId?: string;
|
|
102
|
+
beneficiaryAccountName?: string;
|
|
103
|
+
beneficiaryAccountNumber?: string;
|
|
104
|
+
originatorAccountName?: string;
|
|
105
|
+
originatorAccountNumber?: string;
|
|
106
|
+
narration?: string;
|
|
107
|
+
destinationInstitutionCode?: string;
|
|
108
|
+
paymentReference?: string;
|
|
109
|
+
};
|
|
110
|
+
cardDetails?: {
|
|
111
|
+
cardPan?: string;
|
|
112
|
+
cardType?: string;
|
|
113
|
+
cardCurrency?: string;
|
|
114
|
+
cardBank?: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
export type CheckoutResult = {
|
|
118
|
+
success: boolean;
|
|
119
|
+
message: string;
|
|
120
|
+
};
|
|
121
|
+
export type TokenizedCardResult = {
|
|
122
|
+
status?: boolean;
|
|
123
|
+
message?: string;
|
|
124
|
+
};
|
|
125
|
+
export type TokenizedCardData = {
|
|
126
|
+
tokenKey?: string;
|
|
127
|
+
customerEmail?: string;
|
|
128
|
+
cardType?: string;
|
|
129
|
+
cardPan?: string;
|
|
130
|
+
tokenExpirationDate?: string;
|
|
131
|
+
};
|
|
132
|
+
export type TokenizedCardList = {
|
|
133
|
+
/** The next page number, "0" when there are no more pages. */
|
|
134
|
+
nextPage?: string;
|
|
135
|
+
tokenizedCardDataList?: TokenizedCardData[];
|
|
136
|
+
};
|
|
137
|
+
export type UpdatedTokenizedCard = TokenizedCardResult & {
|
|
138
|
+
tokenizedCardData?: TokenizedCardData[];
|
|
139
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/v1/data
|
|
3
|
+
* @description Data plans v1 types
|
|
4
|
+
*/
|
|
5
|
+
export type DataPlan = {
|
|
6
|
+
productId: string;
|
|
7
|
+
plan: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
};
|
|
10
|
+
export type DataPlansResult = {
|
|
11
|
+
code: string;
|
|
12
|
+
description: string;
|
|
13
|
+
data: DataPlan[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/direct-debits
|
|
3
|
+
* @description DirectDebits types
|
|
4
|
+
*/
|
|
5
|
+
export type CreateMandateParams = {
|
|
6
|
+
customerAccountNumber: string;
|
|
7
|
+
bankCode: string;
|
|
8
|
+
customerName: string;
|
|
9
|
+
customerAddress?: string;
|
|
10
|
+
customerAccountName: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
frequency: "VARIABLE" | "WEEKLY" | "EVERY_TWO_WEEKS" | "MONTHLY" | "EVERY_TWO_MONTHS" | "EVERY_THREE_MONTHS" | "EVERY_FOUR_MONTHS" | "EVERY_FIVE_MONTHS" | "EVERY_SIX_MONTHS" | "EVERY_SEVEN_MONTHS" | "EVERY_EIGHT_MONTHS" | "EVERY_NINE_MONTHS" | "EVERY_TEN_MONTHS" | "EVERY_ELEVEN_MONTHS" | "EVERY_TWELVE_MONTHS";
|
|
13
|
+
/**
|
|
14
|
+
* The spec's enum has no QUARTERLY but includes EVERY_TWO_WEEKS; the prose guide's table has QUARTERLY
|
|
15
|
+
* but no EVERY_TWO_WEEKS. Typed to the spec (the actual request schema); the two disagree and haven't
|
|
16
|
+
* been checked against a real call.
|
|
17
|
+
*/
|
|
18
|
+
narration?: string;
|
|
19
|
+
customerPhoneNumber?: string;
|
|
20
|
+
/** Numeric string (0-9). An idempotency-style tracking id; must be unique per transaction. */
|
|
21
|
+
merchantReference: string;
|
|
22
|
+
startDate: string;
|
|
23
|
+
endDate: string;
|
|
24
|
+
customerEmail: string;
|
|
25
|
+
startImmediately?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type DebitMandateParams = {
|
|
28
|
+
mandateId: string;
|
|
29
|
+
/** Decimal string, e.g. "110.00" */
|
|
30
|
+
amount: string;
|
|
31
|
+
};
|
|
32
|
+
export type ListMandatesParams = {
|
|
33
|
+
page: number;
|
|
34
|
+
pageSize: number;
|
|
35
|
+
/** date, e.g. "2025-08-01" */
|
|
36
|
+
from?: string;
|
|
37
|
+
to?: string;
|
|
38
|
+
status?: string;
|
|
39
|
+
};
|
|
40
|
+
export type UpdateMandateStatusParams = {
|
|
41
|
+
mandateId: string;
|
|
42
|
+
status: "SUSPEND" | "ACTIVE" | "DELETE";
|
|
43
|
+
};
|
|
44
|
+
export type CreatedMandate = {
|
|
45
|
+
mandateId: string;
|
|
46
|
+
merchantReference: string;
|
|
47
|
+
/** The account to send the token authentication payment to. */
|
|
48
|
+
phoneNumber: string;
|
|
49
|
+
/** Human-readable instructions for completing mandate authentication. */
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
export type MandateStatus = {
|
|
53
|
+
customerAccountName: string;
|
|
54
|
+
mandateId: string;
|
|
55
|
+
customerAccountNumber: string;
|
|
56
|
+
mandateStatus: string;
|
|
57
|
+
rejectionComment?: string;
|
|
58
|
+
mandateAdviceStatus?: string;
|
|
59
|
+
};
|
|
60
|
+
export type MandateDebitResult = {
|
|
61
|
+
mandateId?: string;
|
|
62
|
+
status?: string;
|
|
63
|
+
amount?: string;
|
|
64
|
+
message?: string;
|
|
65
|
+
};
|
|
66
|
+
export type DirectDebitMandate = {
|
|
67
|
+
status?: string;
|
|
68
|
+
customerAccountNumber?: string;
|
|
69
|
+
customerAccountName?: string;
|
|
70
|
+
bankCode?: string;
|
|
71
|
+
amount?: number;
|
|
72
|
+
customerName?: string;
|
|
73
|
+
customerAddress?: string;
|
|
74
|
+
customerEmail?: string;
|
|
75
|
+
customerPhoneNumber?: string;
|
|
76
|
+
merchantReference?: string;
|
|
77
|
+
frequency?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The spec types these as ISO date-time strings, but the guide's own example responses (GET single
|
|
80
|
+
* mandate, list mandates) show them as `[year, month, day, hour, minute]` arrays instead — likely a
|
|
81
|
+
* raw serialization of the backend's date type. Typed to allow either; confirm against a live call.
|
|
82
|
+
*/
|
|
83
|
+
startDate?: string | number[];
|
|
84
|
+
endDate?: string | number[];
|
|
85
|
+
mandateAdviceStatus?: string;
|
|
86
|
+
mandateId?: string;
|
|
87
|
+
};
|
|
88
|
+
export type MandatePage = {
|
|
89
|
+
/**
|
|
90
|
+
* The OpenAPI spec types this as a single object, not an array. The prose guide's own example response
|
|
91
|
+
* shows it as an array of mandates, which also matches the surrounding pagination fields. Typed as an
|
|
92
|
+
* array, trusting the guide's real example over the spec here; confirm against a live call.
|
|
93
|
+
*/
|
|
94
|
+
items?: DirectDebitMandate[];
|
|
95
|
+
page?: number;
|
|
96
|
+
pageSize?: number;
|
|
97
|
+
totalItems?: number;
|
|
98
|
+
totalPages?: number;
|
|
99
|
+
hasMore?: boolean;
|
|
100
|
+
};
|
|
101
|
+
export type UpdatedMandateStatus = {
|
|
102
|
+
mandateId?: string;
|
|
103
|
+
mandateStatus?: string;
|
|
104
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/v1/electricity
|
|
3
|
+
* @description Electricity v1 validation types
|
|
4
|
+
*/
|
|
5
|
+
export type ElectricityProvider = {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export type ElectricityProvidersResult = {
|
|
10
|
+
code: string;
|
|
11
|
+
data: ElectricityProvider[];
|
|
12
|
+
};
|
|
13
|
+
export type MeterLookupParams = {
|
|
14
|
+
disco: string;
|
|
15
|
+
customerId: string;
|
|
16
|
+
};
|
|
17
|
+
export type MeterLookupResult = {
|
|
18
|
+
code: string;
|
|
19
|
+
/** Customer name associated with the meter */
|
|
20
|
+
data: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module nomba/types/global-collections
|
|
3
|
+
* @description GlobalCollections types
|
|
4
|
+
*/
|
|
5
|
+
export type InitiateInflowParams = {
|
|
6
|
+
/** The customer's mobile money number. */
|
|
7
|
+
phoneNumber: string;
|
|
8
|
+
/** Nomba POSTs here when the status changes. Must be publicly reachable. */
|
|
9
|
+
callbackUrl: string;
|
|
10
|
+
amount: number;
|
|
11
|
+
/** ISO 4217, e.g. CDF. */
|
|
12
|
+
currency: string;
|
|
13
|
+
/** A `code` from `inflowProviders`. */
|
|
14
|
+
topupVendor: string;
|
|
15
|
+
/**
|
|
16
|
+
* Sent in the body; the API dedupes on it. The SDK generates a UUID when you omit it. After an
|
|
17
|
+
* OutcomeUnknownError, retry with the error's `idempotencyKey`. After a definite rejection, use a new key.
|
|
18
|
+
*/
|
|
19
|
+
idempotencyKey?: string;
|
|
20
|
+
};
|
|
21
|
+
export type InflowProvider = {
|
|
22
|
+
/** Pass as `topupVendor`, e.g. MPESA, AIRTEL, ORANGE. */
|
|
23
|
+
code: string;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
export type InflowResult = {
|
|
27
|
+
/** Pass to `getTransaction`. */
|
|
28
|
+
transactionReference: string;
|
|
29
|
+
/** e.g. PENDING. */
|
|
30
|
+
status: string;
|
|
31
|
+
message?: string;
|
|
32
|
+
idempotencyKey?: string;
|
|
33
|
+
};
|
|
34
|
+
export type CollectionTransaction = {
|
|
35
|
+
transactionId: string;
|
|
36
|
+
coreUserId?: string;
|
|
37
|
+
/** The customer's mobile money number. */
|
|
38
|
+
account?: string;
|
|
39
|
+
/** PENDING_APPROVAL: no outcome within the polling window; it can still settle later. */
|
|
40
|
+
status: "PENDING" | "APPROVED" | "SUCCESS" | "FAILED" | "PENDING_APPROVAL";
|
|
41
|
+
amount: number;
|
|
42
|
+
currency: string;
|
|
43
|
+
/** Echoes `topupVendor`. */
|
|
44
|
+
vendor?: string;
|
|
45
|
+
/** ACCEPTED, APPROVED or DECLINED. */
|
|
46
|
+
gatewayMessage?: string;
|
|
47
|
+
/** Plain-words meaning of gatewayMessage; null for anything else. */
|
|
48
|
+
gatewayCode?: string | null;
|
|
49
|
+
};
|