@maxkabechani/mtn-momo-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +187 -0
  3. package/lib/cjs/auth.d.ts +17 -0
  4. package/lib/cjs/auth.d.ts.map +1 -0
  5. package/lib/cjs/auth.js +86 -0
  6. package/lib/cjs/auth.js.map +1 -0
  7. package/lib/cjs/cli.d.ts +3 -0
  8. package/lib/cjs/cli.d.ts.map +1 -0
  9. package/lib/cjs/cli.js +66 -0
  10. package/lib/cjs/cli.js.map +1 -0
  11. package/lib/cjs/client.d.ts +7 -0
  12. package/lib/cjs/client.d.ts.map +1 -0
  13. package/lib/cjs/client.js +67 -0
  14. package/lib/cjs/client.js.map +1 -0
  15. package/lib/cjs/collections.d.ts +176 -0
  16. package/lib/cjs/collections.d.ts.map +1 -0
  17. package/lib/cjs/collections.js +219 -0
  18. package/lib/cjs/collections.js.map +1 -0
  19. package/lib/cjs/common.d.ts +299 -0
  20. package/lib/cjs/common.d.ts.map +1 -0
  21. package/lib/cjs/common.js +41 -0
  22. package/lib/cjs/common.js.map +1 -0
  23. package/lib/cjs/disbursements.d.ts +190 -0
  24. package/lib/cjs/disbursements.d.ts.map +1 -0
  25. package/lib/cjs/disbursements.js +268 -0
  26. package/lib/cjs/disbursements.js.map +1 -0
  27. package/lib/cjs/errors.d.ts +67 -0
  28. package/lib/cjs/errors.d.ts.map +1 -0
  29. package/lib/cjs/errors.js +207 -0
  30. package/lib/cjs/errors.js.map +1 -0
  31. package/lib/cjs/index.d.ts +24 -0
  32. package/lib/cjs/index.d.ts.map +1 -0
  33. package/lib/cjs/index.js +87 -0
  34. package/lib/cjs/index.js.map +1 -0
  35. package/lib/cjs/package.json +1 -0
  36. package/lib/cjs/remittance.d.ts +59 -0
  37. package/lib/cjs/remittance.d.ts.map +1 -0
  38. package/lib/cjs/remittance.js +145 -0
  39. package/lib/cjs/remittance.js.map +1 -0
  40. package/lib/cjs/users.d.ts +22 -0
  41. package/lib/cjs/users.d.ts.map +1 -0
  42. package/lib/cjs/users.js +42 -0
  43. package/lib/cjs/users.js.map +1 -0
  44. package/lib/cjs/validate.d.ts +14 -0
  45. package/lib/cjs/validate.d.ts.map +1 -0
  46. package/lib/cjs/validate.js +111 -0
  47. package/lib/cjs/validate.js.map +1 -0
  48. package/lib/esm/auth.d.ts +17 -0
  49. package/lib/esm/auth.d.ts.map +1 -0
  50. package/lib/esm/auth.js +78 -0
  51. package/lib/esm/auth.js.map +1 -0
  52. package/lib/esm/cli.d.ts +3 -0
  53. package/lib/esm/cli.d.ts.map +1 -0
  54. package/lib/esm/cli.js +31 -0
  55. package/lib/esm/cli.js.map +1 -0
  56. package/lib/esm/client.d.ts +7 -0
  57. package/lib/esm/client.d.ts.map +1 -0
  58. package/lib/esm/client.js +29 -0
  59. package/lib/esm/client.js.map +1 -0
  60. package/lib/esm/collections.d.ts +176 -0
  61. package/lib/esm/collections.d.ts.map +1 -0
  62. package/lib/esm/collections.js +216 -0
  63. package/lib/esm/collections.js.map +1 -0
  64. package/lib/esm/common.d.ts +299 -0
  65. package/lib/esm/common.d.ts.map +1 -0
  66. package/lib/esm/common.js +38 -0
  67. package/lib/esm/common.js.map +1 -0
  68. package/lib/esm/disbursements.d.ts +190 -0
  69. package/lib/esm/disbursements.d.ts.map +1 -0
  70. package/lib/esm/disbursements.js +265 -0
  71. package/lib/esm/disbursements.js.map +1 -0
  72. package/lib/esm/errors.d.ts +67 -0
  73. package/lib/esm/errors.d.ts.map +1 -0
  74. package/lib/esm/errors.js +182 -0
  75. package/lib/esm/errors.js.map +1 -0
  76. package/lib/esm/index.d.ts +24 -0
  77. package/lib/esm/index.d.ts.map +1 -0
  78. package/lib/esm/index.js +63 -0
  79. package/lib/esm/index.js.map +1 -0
  80. package/lib/esm/package.json +1 -0
  81. package/lib/esm/remittance.d.ts +59 -0
  82. package/lib/esm/remittance.d.ts.map +1 -0
  83. package/lib/esm/remittance.js +142 -0
  84. package/lib/esm/remittance.js.map +1 -0
  85. package/lib/esm/users.d.ts +22 -0
  86. package/lib/esm/users.d.ts.map +1 -0
  87. package/lib/esm/users.js +39 -0
  88. package/lib/esm/users.js.map +1 -0
  89. package/lib/esm/validate.d.ts +14 -0
  90. package/lib/esm/validate.d.ts.map +1 -0
  91. package/lib/esm/validate.js +100 -0
  92. package/lib/esm/validate.js.map +1 -0
  93. package/package.json +68 -0
@@ -0,0 +1,190 @@
1
+ import type { AxiosInstance } from "axios";
2
+ import type { Config } from "./common";
3
+ import { type Balance, type BasicUserInfo, type BcAuthorizeRequest, type BcAuthorizeResponse, type Deposit, type DepositRequest, FailureReason, PartyIdType, type Refund, type RefundRequest, TransactionStatus } from "./common";
4
+ export interface TransferRequest {
5
+ /**
6
+ * Unique Transfer Reference (UUID v4), will be automatically generated if not explicitly supplied
7
+ */
8
+ referenceId?: string;
9
+ /**
10
+ * Amount that will be debited from the payer account.
11
+ */
12
+ amount: string;
13
+ /**
14
+ * ISO4217 Currency
15
+ */
16
+ currency: string;
17
+ /**
18
+ * External id is used as a reference to the transaction.
19
+ * External id is used for reconciliation.
20
+ * The external id will be included in transaction history report.
21
+ * External id is not required to be unique.
22
+ */
23
+ externalId?: string;
24
+ /**
25
+ * Party identifies a account holder in the wallet platform.
26
+ * Party consists of two parameters, type and partyId.
27
+ * Each type have its own validation of the partyId
28
+ * MSISDN - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN
29
+ * EMAIL - Validated to be a valid e-mail format. Validated with IsEmail
30
+ * PARTY_CODE - UUID of the party. Validated with IsUuid
31
+ */
32
+ payee: {
33
+ partyIdType: PartyIdType;
34
+ partyId: string;
35
+ };
36
+ /**
37
+ * Message that will be written in the payer transaction history message field.
38
+ */
39
+ payerMessage?: string;
40
+ /**
41
+ * Message that will be written in the payee transaction history note field.
42
+ */
43
+ payeeNote?: string;
44
+ /**
45
+ * URL to the server where the callback should be sent.
46
+ */
47
+ callbackUrl?: string;
48
+ }
49
+ export interface Transfer {
50
+ /**
51
+ * Amount that will be debited from the payer account.
52
+ */
53
+ amount: string;
54
+ /**
55
+ * ISO4217 Currency
56
+ */
57
+ currency: string;
58
+ /**
59
+ * Financial transactionIdd from mobile money manager.
60
+ * Used to connect to the specific financial transaction made in the account
61
+ */
62
+ financialTransactionId: string;
63
+ /**
64
+ * External id is used as a reference to the transaction.
65
+ * External id is used for reconciliation.
66
+ * The external id will be included in transaction history report.
67
+ * External id is not required to be unique.
68
+ */
69
+ externalId: string;
70
+ /**
71
+ * Party identifies a account holder in the wallet platform.
72
+ * Party consists of two parameters, type and partyId.
73
+ * Each type have its own validation of the partyId
74
+ * MSISDN - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN
75
+ * EMAIL - Validated to be a valid e-mail format. Validated with IsEmail
76
+ * PARTY_CODE - UUID of the party. Validated with IsUuid
77
+ */
78
+ payee: {
79
+ partyIdType: "MSISDN";
80
+ partyId: string;
81
+ };
82
+ status: TransactionStatus;
83
+ reason?: FailureReason;
84
+ }
85
+ export default class Disbursements {
86
+ private client;
87
+ private config;
88
+ constructor(client: AxiosInstance, config: Config);
89
+ /**
90
+ * Transfer operation is used to transfer an amount from the owner’s
91
+ * account to a payee account.
92
+ * Status of the transaction can be validated by using the
93
+ *
94
+ * @param paymentRequest
95
+ */
96
+ transfer({ callbackUrl, referenceId, ...payoutRequest }: TransferRequest): Promise<string>;
97
+ /**
98
+ * This method is used to retrieve the transaction. You can invoke this method
99
+ * to at intervals until your transaction fails or succeeds.
100
+ *
101
+ * If the transaction has failed, it will throw an appropriate error. The error will be a subclass
102
+ * of `MtnMoMoError`. Check [`src/error.ts`](https://github.com/maxkabechani/mtn-momo-sdk/blob/master/src/errors.ts)
103
+ * for the various errors that can be thrown
104
+ *
105
+ * @param referenceId the value returned from `transfer`
106
+ */
107
+ getTransaction(referenceId: string): Promise<Transfer>;
108
+ /**
109
+ * Get the balance of the account.
110
+ */
111
+ getBalance(): Promise<Balance>;
112
+ /**
113
+ * This method is used to check if an account holder is registered and active in the system.
114
+ *
115
+ * @param id Specifies the type of the party ID. Allowed values [msisdn, email, party_code].
116
+ * accountHolderId should explicitly be in small letters.
117
+ *
118
+ * @param type The party number. Validated according to the party ID type (case Sensitive).
119
+ * msisdn - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN
120
+ * email - Validated to be a valid e-mail format. Validated with IsEmail
121
+ * party_code - UUID of the party. Validated with IsUuid
122
+ */
123
+ isPayerActive(id: string, type?: PartyIdType): Promise<boolean>;
124
+ /**
125
+ * Deposit money into a payee account (V1).
126
+ *
127
+ * @param depositRequest The deposit request details
128
+ * @returns A promise that resolves to the deposit reference ID
129
+ */
130
+ deposit(depositRequest: DepositRequest): Promise<string>;
131
+ /**
132
+ * Deposit money into a payee account (V2).
133
+ *
134
+ * @param depositRequest The deposit request details
135
+ * @returns A promise that resolves to the deposit reference ID
136
+ */
137
+ depositV2(depositRequest: DepositRequest): Promise<string>;
138
+ /**
139
+ * Get the details and status of a deposit transaction.
140
+ *
141
+ * @param referenceId The deposit reference ID from deposit
142
+ * @returns A promise that resolves to the deposit details
143
+ */
144
+ getDeposit(referenceId: string): Promise<Deposit>;
145
+ /**
146
+ * Refund money from a previous transfer or deposit (V1).
147
+ *
148
+ * @param refundRequest The refund request details
149
+ * @returns A promise that resolves to the refund reference ID
150
+ */
151
+ refund(refundRequest: RefundRequest): Promise<string>;
152
+ /**
153
+ * Refund money from a previous transfer or deposit (V2).
154
+ *
155
+ * @param refundRequest The refund request details
156
+ * @returns A promise that resolves to the refund reference ID
157
+ */
158
+ refundV2(refundRequest: RefundRequest): Promise<string>;
159
+ /**
160
+ * Get the details and status of a refund transaction.
161
+ *
162
+ * @param referenceId The refund reference ID from refund
163
+ * @returns A promise that resolves to the refund details
164
+ */
165
+ getRefund(referenceId: string): Promise<Refund>;
166
+ /**
167
+ * Get basic user information for an account holder.
168
+ *
169
+ * @param partyIdType The type of party ID (MSISDN, EMAIL, or PARTY_CODE)
170
+ * @param partyId The party identifier
171
+ * @returns A promise that resolves to the basic user information
172
+ */
173
+ getBasicUserInfo(partyIdType: PartyIdType, partyId: string): Promise<BasicUserInfo>;
174
+ /**
175
+ * Get the balance of the account in a specific currency.
176
+ *
177
+ * @param currency The ISO4217 currency code
178
+ * @returns A promise that resolves to the account balance in the specified currency
179
+ */
180
+ getBalanceInCurrency(currency: string): Promise<Balance>;
181
+ /**
182
+ * Request Biometric Consent (BC) authorization.
183
+ * This initiates the BC authorization flow for enhanced security.
184
+ *
185
+ * @param request The BC authorization request
186
+ * @returns A promise that resolves to the BC authorization response with auth_req_id
187
+ */
188
+ bcAuthorize(request: BcAuthorizeRequest): Promise<BcAuthorizeResponse>;
189
+ }
190
+ //# sourceMappingURL=disbursements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disbursements.d.ts","sourceRoot":"","sources":["../../src/disbursements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,aAAa,EACb,WAAW,EACX,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,KAAK,EAAE;QACL,WAAW,EAAE,WAAW,CAAC;QACzB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC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;IA2BjE;;;;;OAKG;IACI,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYxD;;;;;OAKG;IACI,MAAM,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAwB5D;;;;;OAKG;IACI,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAwB9D;;;;;OAKG;IACI,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYtD;;;;;;OAMG;IACI,gBAAgB,CACrB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC;IAQzB;;;;;OAKG;IACI,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM/D;;;;;;OAMG;IACI,WAAW,CAChB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC;CAoBhC"}
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const uuid_1 = require("uuid");
4
+ const errors_1 = require("./errors");
5
+ const validate_1 = require("./validate");
6
+ const auth_1 = require("./auth");
7
+ const common_1 = require("./common");
8
+ class Disbursements {
9
+ constructor(client, config) {
10
+ this.client = client;
11
+ this.config = config;
12
+ }
13
+ /**
14
+ * Transfer operation is used to transfer an amount from the owner’s
15
+ * account to a payee account.
16
+ * Status of the transaction can be validated by using the
17
+ *
18
+ * @param paymentRequest
19
+ */
20
+ transfer({ callbackUrl, referenceId = (0, uuid_1.v4)(), ...payoutRequest }) {
21
+ return (0, validate_1.validateTransfer)({ referenceId, ...payoutRequest }).then(() => {
22
+ return this.client
23
+ .post("/disbursement/v1_0/transfer", payoutRequest, {
24
+ headers: {
25
+ "X-Reference-Id": referenceId,
26
+ ...(callbackUrl ? { "X-Callback-Url": callbackUrl } : {}),
27
+ },
28
+ })
29
+ .then(() => referenceId);
30
+ });
31
+ }
32
+ /**
33
+ * This method is used to retrieve the transaction. You can invoke this method
34
+ * to at intervals until your transaction fails or succeeds.
35
+ *
36
+ * If the transaction has failed, it will throw an appropriate error. The error will be a subclass
37
+ * of `MtnMoMoError`. Check [`src/error.ts`](https://github.com/maxkabechani/mtn-momo-sdk/blob/master/src/errors.ts)
38
+ * for the various errors that can be thrown
39
+ *
40
+ * @param referenceId the value returned from `transfer`
41
+ */
42
+ getTransaction(referenceId) {
43
+ return this.client
44
+ .get(`/disbursement/v1_0/transfer/${referenceId}`)
45
+ .then((response) => response.data)
46
+ .then((transaction) => {
47
+ if (transaction.status === common_1.TransactionStatus.FAILED) {
48
+ return Promise.reject((0, errors_1.getTransactionError)(transaction));
49
+ }
50
+ return Promise.resolve(transaction);
51
+ });
52
+ }
53
+ /**
54
+ * Get the balance of the account.
55
+ */
56
+ getBalance() {
57
+ return this.client
58
+ .get("/disbursement/v1_0/account/balance")
59
+ .then((response) => response.data);
60
+ }
61
+ /**
62
+ * This method is used to check if an account holder is registered and active in the system.
63
+ *
64
+ * @param id Specifies the type of the party ID. Allowed values [msisdn, email, party_code].
65
+ * accountHolderId should explicitly be in small letters.
66
+ *
67
+ * @param type The party number. Validated according to the party ID type (case Sensitive).
68
+ * msisdn - Mobile Number validated according to ITU-T E.164. Validated with IsMSISDN
69
+ * email - Validated to be a valid e-mail format. Validated with IsEmail
70
+ * party_code - UUID of the party. Validated with IsUuid
71
+ */
72
+ isPayerActive(id, type = common_1.PartyIdType.MSISDN) {
73
+ return this.client
74
+ .get(`/disbursement/v1_0/accountholder/${type}/${id}/active`)
75
+ .then((response) => response.data)
76
+ .then((data) => (data.result !== undefined ? data.result : false));
77
+ }
78
+ /**
79
+ * Deposit money into a payee account (V1).
80
+ *
81
+ * @param depositRequest The deposit request details
82
+ * @returns A promise that resolves to the deposit reference ID
83
+ */
84
+ deposit(depositRequest) {
85
+ const referenceId = (0, uuid_1.v4)();
86
+ return (0, validate_1.validateDepositRequest)(depositRequest).then(() => {
87
+ return this.client
88
+ .post("/disbursement/v1_0/deposit", {
89
+ amount: depositRequest.amount,
90
+ currency: depositRequest.currency,
91
+ externalId: depositRequest.externalId,
92
+ payee: depositRequest.payee,
93
+ payerMessage: depositRequest.payerMessage,
94
+ payeeNote: depositRequest.payeeNote,
95
+ }, {
96
+ headers: {
97
+ "X-Reference-Id": referenceId,
98
+ ...(depositRequest.callbackUrl
99
+ ? { "X-Callback-Url": depositRequest.callbackUrl }
100
+ : {}),
101
+ },
102
+ })
103
+ .then(() => referenceId);
104
+ });
105
+ }
106
+ /**
107
+ * Deposit money into a payee account (V2).
108
+ *
109
+ * @param depositRequest The deposit request details
110
+ * @returns A promise that resolves to the deposit reference ID
111
+ */
112
+ depositV2(depositRequest) {
113
+ const referenceId = (0, uuid_1.v4)();
114
+ return (0, validate_1.validateDepositRequest)(depositRequest).then(() => {
115
+ return this.client
116
+ .post("/disbursement/v2_0/deposit", {
117
+ amount: depositRequest.amount,
118
+ currency: depositRequest.currency,
119
+ externalId: depositRequest.externalId,
120
+ payee: depositRequest.payee,
121
+ payerMessage: depositRequest.payerMessage,
122
+ payeeNote: depositRequest.payeeNote,
123
+ }, {
124
+ headers: {
125
+ "X-Reference-Id": referenceId,
126
+ ...(depositRequest.callbackUrl
127
+ ? { "X-Callback-Url": depositRequest.callbackUrl }
128
+ : {}),
129
+ },
130
+ })
131
+ .then(() => referenceId);
132
+ });
133
+ }
134
+ /**
135
+ * Get the details and status of a deposit transaction.
136
+ *
137
+ * @param referenceId The deposit reference ID from deposit
138
+ * @returns A promise that resolves to the deposit details
139
+ */
140
+ getDeposit(referenceId) {
141
+ return this.client
142
+ .get(`/disbursement/v1_0/deposit/${referenceId}`)
143
+ .then((response) => response.data)
144
+ .then((deposit) => {
145
+ if (deposit.status === common_1.TransactionStatus.FAILED) {
146
+ return Promise.reject((0, errors_1.getTransactionError)(deposit));
147
+ }
148
+ return Promise.resolve(deposit);
149
+ });
150
+ }
151
+ /**
152
+ * Refund money from a previous transfer or deposit (V1).
153
+ *
154
+ * @param refundRequest The refund request details
155
+ * @returns A promise that resolves to the refund reference ID
156
+ */
157
+ refund(refundRequest) {
158
+ const referenceId = (0, uuid_1.v4)();
159
+ return (0, validate_1.validateRefundRequest)(refundRequest).then(() => {
160
+ return this.client
161
+ .post("/disbursement/v1_0/refund", {
162
+ amount: refundRequest.amount,
163
+ currency: refundRequest.currency,
164
+ externalId: refundRequest.externalId,
165
+ payerMessage: refundRequest.payerMessage,
166
+ payeeNote: refundRequest.payeeNote,
167
+ referenceIdToRefund: refundRequest.referenceIdToRefund,
168
+ }, {
169
+ headers: {
170
+ "X-Reference-Id": referenceId,
171
+ },
172
+ })
173
+ .then(() => referenceId);
174
+ });
175
+ }
176
+ /**
177
+ * Refund money from a previous transfer or deposit (V2).
178
+ *
179
+ * @param refundRequest The refund request details
180
+ * @returns A promise that resolves to the refund reference ID
181
+ */
182
+ refundV2(refundRequest) {
183
+ const referenceId = (0, uuid_1.v4)();
184
+ return (0, validate_1.validateRefundRequest)(refundRequest).then(() => {
185
+ return this.client
186
+ .post("/disbursement/v2_0/refund", {
187
+ amount: refundRequest.amount,
188
+ currency: refundRequest.currency,
189
+ externalId: refundRequest.externalId,
190
+ payerMessage: refundRequest.payerMessage,
191
+ payeeNote: refundRequest.payeeNote,
192
+ referenceIdToRefund: refundRequest.referenceIdToRefund,
193
+ }, {
194
+ headers: {
195
+ "X-Reference-Id": referenceId,
196
+ },
197
+ })
198
+ .then(() => referenceId);
199
+ });
200
+ }
201
+ /**
202
+ * Get the details and status of a refund transaction.
203
+ *
204
+ * @param referenceId The refund reference ID from refund
205
+ * @returns A promise that resolves to the refund details
206
+ */
207
+ getRefund(referenceId) {
208
+ return this.client
209
+ .get(`/disbursement/v1_0/refund/${referenceId}`)
210
+ .then((response) => response.data)
211
+ .then((refund) => {
212
+ if (refund.status === common_1.TransactionStatus.FAILED) {
213
+ return Promise.reject((0, errors_1.getTransactionError)(refund));
214
+ }
215
+ return Promise.resolve(refund);
216
+ });
217
+ }
218
+ /**
219
+ * Get basic user information for an account holder.
220
+ *
221
+ * @param partyIdType The type of party ID (MSISDN, EMAIL, or PARTY_CODE)
222
+ * @param partyId The party identifier
223
+ * @returns A promise that resolves to the basic user information
224
+ */
225
+ getBasicUserInfo(partyIdType, partyId) {
226
+ return this.client
227
+ .get(`/disbursement/v1_0/accountholder/${partyIdType}/${partyId}/basicuserinfo`)
228
+ .then((response) => response.data);
229
+ }
230
+ /**
231
+ * Get the balance of the account in a specific currency.
232
+ *
233
+ * @param currency The ISO4217 currency code
234
+ * @returns A promise that resolves to the account balance in the specified currency
235
+ */
236
+ getBalanceInCurrency(currency) {
237
+ return this.client
238
+ .get(`/disbursement/v1_0/account/balance/${currency}`)
239
+ .then((response) => response.data);
240
+ }
241
+ /**
242
+ * Request Biometric Consent (BC) authorization.
243
+ * This initiates the BC authorization flow for enhanced security.
244
+ *
245
+ * @param request The BC authorization request
246
+ * @returns A promise that resolves to the BC authorization response with auth_req_id
247
+ */
248
+ bcAuthorize(request) {
249
+ const params = new URLSearchParams();
250
+ params.append("login_hint", request.login_hint);
251
+ params.append("scope", request.scope);
252
+ params.append("access_type", request.access_type);
253
+ if (request.consent_valid_in) {
254
+ params.append("consent_valid_in", String(request.consent_valid_in));
255
+ }
256
+ const basicAuthToken = (0, auth_1.createBasicAuthToken)(this.config);
257
+ return this.client
258
+ .post("/disbursement/v1_0/bc-authorize", params, {
259
+ headers: {
260
+ Authorization: `Basic ${basicAuthToken}`,
261
+ "Content-Type": "application/x-www-form-urlencoded",
262
+ },
263
+ })
264
+ .then((response) => response.data);
265
+ }
266
+ }
267
+ exports.default = Disbursements;
268
+ //# sourceMappingURL=disbursements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disbursements.js","sourceRoot":"","sources":["../../src/disbursements.ts"],"names":[],"mappings":";;AACA,+BAAkC;AAElC,qCAA+C;AAC/C,yCAA6F;AAC7F,iCAA8C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CAAC;QACtC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QAClD,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC7B,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACtE,CAAC;QAED,MAAM,cAAc,GAAW,IAAA,2BAAoB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEjE,OAAO,IAAI,CAAC,MAAM;aACf,IAAI,CAAsB,iCAAiC,EAAE,MAAM,EAAE;YACpE,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,cAAc,EAAE;gBACxC,cAAc,EAAE,mCAAmC;aACpD;SACF,CAAC;aACD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF;AArTD,gCAqTC"}
@@ -0,0 +1,67 @@
1
+ import type { AxiosError } from "axios";
2
+ import type { Payment } from "./collections";
3
+ import type { Deposit, Refund, Withdrawal } from "./common";
4
+ import { FailureReason } from "./common";
5
+ import type { Transfer } from "./disbursements";
6
+ export declare class MtnMoMoError extends Error {
7
+ transaction?: Payment | Transfer;
8
+ constructor(message?: string);
9
+ }
10
+ export declare class ApprovalRejectedError extends MtnMoMoError {
11
+ name: string;
12
+ }
13
+ export declare class ExpiredError extends MtnMoMoError {
14
+ name: string;
15
+ }
16
+ export declare class InternalProcessingError extends MtnMoMoError {
17
+ name: string;
18
+ }
19
+ export declare class InvalidCallbackUrlHostError extends MtnMoMoError {
20
+ name: string;
21
+ }
22
+ export declare class InvalidCurrencyError extends MtnMoMoError {
23
+ name: string;
24
+ }
25
+ export declare class NotAllowedTargetEnvironmentError extends MtnMoMoError {
26
+ name: string;
27
+ }
28
+ export declare class NotAllowedError extends MtnMoMoError {
29
+ name: string;
30
+ }
31
+ export declare class NotEnoughFundsError extends MtnMoMoError {
32
+ name: string;
33
+ }
34
+ export declare class PayeeNotFoundError extends MtnMoMoError {
35
+ name: string;
36
+ }
37
+ export declare class PayeeNotAllowedToReceiveError extends MtnMoMoError {
38
+ name: string;
39
+ }
40
+ export declare class PayerLimitReachedError extends MtnMoMoError {
41
+ name: string;
42
+ }
43
+ export declare class PayerNotFoundError extends MtnMoMoError {
44
+ name: string;
45
+ }
46
+ export declare class PaymentNotApprovedError extends MtnMoMoError {
47
+ name: string;
48
+ }
49
+ export declare class ResourceAlreadyExistError extends MtnMoMoError {
50
+ name: string;
51
+ }
52
+ export declare class ResourceNotFoundError extends MtnMoMoError {
53
+ name: string;
54
+ }
55
+ export declare class ServiceUnavailableError extends MtnMoMoError {
56
+ name: string;
57
+ }
58
+ export declare class TransactionCancelledError extends MtnMoMoError {
59
+ name: string;
60
+ }
61
+ export declare class UnspecifiedError extends MtnMoMoError {
62
+ name: string;
63
+ }
64
+ export declare function handleError(error: AxiosError): Error;
65
+ export declare function getError(code?: FailureReason, message?: string): ApprovalRejectedError | ExpiredError | InternalProcessingError | InvalidCallbackUrlHostError | InvalidCurrencyError | NotAllowedTargetEnvironmentError | NotAllowedError | NotEnoughFundsError | PayeeNotFoundError | PayeeNotAllowedToReceiveError | PayerLimitReachedError | PayerNotFoundError | PaymentNotApprovedError | ResourceAlreadyExistError | ResourceNotFoundError | ServiceUnavailableError | TransactionCancelledError | UnspecifiedError;
66
+ export declare function getTransactionError(transaction: Payment | Transfer | Withdrawal | Deposit | Refund): MtnMoMoError;
67
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAA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