@herberthtk/yo-payments-api 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.
- package/CHANGELOG.md +6 -0
- package/LICENSE +21 -0
- package/README.md +236 -0
- package/certs/Yo_Uganda_Public_Certificate.crt +28 -0
- package/certs/Yo_Uganda_Public_Sandbox_Certificate.crt +35 -0
- package/dist/index.cjs +857 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +391 -0
- package/dist/index.d.ts +391 -0
- package/dist/index.js +828 -0
- package/dist/index.js.map +1 -0
- package/package.json +80 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
type NonBlocking = "TRUE" | "FALSE";
|
|
2
|
+
type DepositTransactionType = "PULL" | "PUSH";
|
|
3
|
+
type YoMode = "production" | "sandbox";
|
|
4
|
+
interface PaymentNotificationBody {
|
|
5
|
+
date_time: string;
|
|
6
|
+
amount: string;
|
|
7
|
+
narrative: string;
|
|
8
|
+
network_ref: string;
|
|
9
|
+
external_ref: string;
|
|
10
|
+
msisdn: string;
|
|
11
|
+
signature: string;
|
|
12
|
+
}
|
|
13
|
+
interface PaymentFailureNotificationBody {
|
|
14
|
+
failed_transaction_reference: string;
|
|
15
|
+
transaction_init_date: string;
|
|
16
|
+
verification: string;
|
|
17
|
+
}
|
|
18
|
+
interface PaymentNotificationResult {
|
|
19
|
+
is_verified: boolean;
|
|
20
|
+
date_time: string;
|
|
21
|
+
amount: string;
|
|
22
|
+
narrative: string;
|
|
23
|
+
network_ref: string;
|
|
24
|
+
external_ref: string;
|
|
25
|
+
msisdn: string;
|
|
26
|
+
}
|
|
27
|
+
interface PaymentFailureNotificationResult {
|
|
28
|
+
is_verified: boolean;
|
|
29
|
+
failed_transaction_reference: string;
|
|
30
|
+
transaction_init_date: string;
|
|
31
|
+
}
|
|
32
|
+
interface DepositFundsResponse {
|
|
33
|
+
Status: string;
|
|
34
|
+
StatusCode: string;
|
|
35
|
+
StatusMessage: string;
|
|
36
|
+
TransactionStatus: string;
|
|
37
|
+
ErrorMessageCode?: string;
|
|
38
|
+
ErrorMessage?: string;
|
|
39
|
+
TransactionReference?: string;
|
|
40
|
+
MNOTransactionReferenceId?: string;
|
|
41
|
+
IssuedReceiptNumber?: string;
|
|
42
|
+
}
|
|
43
|
+
interface TransactionCheckStatusResponse extends DepositFundsResponse {
|
|
44
|
+
Amount?: string;
|
|
45
|
+
AmountFormatted?: string;
|
|
46
|
+
CurrencyCode?: string;
|
|
47
|
+
TransactionInitiationDate?: string;
|
|
48
|
+
TransactionCompletionDate?: string;
|
|
49
|
+
}
|
|
50
|
+
type InternalTransferResponse = DepositFundsResponse;
|
|
51
|
+
interface BalanceEntry {
|
|
52
|
+
code: string;
|
|
53
|
+
balance: string;
|
|
54
|
+
}
|
|
55
|
+
interface AcctBalanceResponse {
|
|
56
|
+
Status: string;
|
|
57
|
+
StatusCode: string;
|
|
58
|
+
balance: BalanceEntry[];
|
|
59
|
+
StatusMessage?: string;
|
|
60
|
+
ErrorMessageCode?: string;
|
|
61
|
+
ErrorMessage?: string;
|
|
62
|
+
}
|
|
63
|
+
interface TransactionDetail {
|
|
64
|
+
TransactionSystemId: string;
|
|
65
|
+
TransactionReference: string;
|
|
66
|
+
TransactionStatus: string;
|
|
67
|
+
InitiationDate: string;
|
|
68
|
+
CompletionDate: string;
|
|
69
|
+
NarrativeBase64: string;
|
|
70
|
+
Currency: string;
|
|
71
|
+
Amount: string;
|
|
72
|
+
Balance: string;
|
|
73
|
+
GeneralType: string;
|
|
74
|
+
DetailedType: string;
|
|
75
|
+
BeneficiaryMsisdn?: string;
|
|
76
|
+
BeneficiaryBase64: string;
|
|
77
|
+
SenderMsisdn?: string;
|
|
78
|
+
SenderBase64: string;
|
|
79
|
+
Base64TransactionExternalReference?: string;
|
|
80
|
+
TransactionEntryDesignation: string;
|
|
81
|
+
}
|
|
82
|
+
interface MinistatementResponse {
|
|
83
|
+
Status: string;
|
|
84
|
+
StatusCode: string;
|
|
85
|
+
TotalTransactions: string;
|
|
86
|
+
ReturnedTransactions: string;
|
|
87
|
+
Transactions: TransactionDetail[];
|
|
88
|
+
ErrorMessageCode?: string;
|
|
89
|
+
ErrorMessage?: string;
|
|
90
|
+
}
|
|
91
|
+
type SendAirtimeResponse = DepositFundsResponse;
|
|
92
|
+
interface PurchaseAirtimeStockResponse {
|
|
93
|
+
Status: string;
|
|
94
|
+
StatusCode: string;
|
|
95
|
+
StatusMessage?: string;
|
|
96
|
+
TransactionReference?: string;
|
|
97
|
+
TotalCurrencyDebited?: string;
|
|
98
|
+
CommissionAmount?: string;
|
|
99
|
+
ErrorMessageCode?: string;
|
|
100
|
+
ErrorMessage?: string;
|
|
101
|
+
}
|
|
102
|
+
interface MsisdnKycInfoResponse {
|
|
103
|
+
Status: string;
|
|
104
|
+
StatusCode: string;
|
|
105
|
+
StatusMessage?: string;
|
|
106
|
+
FirstName?: string;
|
|
107
|
+
MiddleName?: string;
|
|
108
|
+
Surname?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Error thrown for transport-level and protocol-level failures:
|
|
113
|
+
* connection errors, timeouts, non-2xx HTTP statuses, oversized bodies,
|
|
114
|
+
* malformed XML and responses missing the <Response> node.
|
|
115
|
+
* Gateway-level business failures (e.g. Status FAILED) are still returned
|
|
116
|
+
* as normal response objects, exactly like the PHP library.
|
|
117
|
+
*/
|
|
118
|
+
declare class YoAPIError extends Error {
|
|
119
|
+
/** HTTP status code when the failure came with an HTTP response. */
|
|
120
|
+
readonly status?: number;
|
|
121
|
+
/** Truncated response body (up to 500 chars) when one was received. */
|
|
122
|
+
readonly body?: string;
|
|
123
|
+
constructor(message: string, options?: {
|
|
124
|
+
status?: number;
|
|
125
|
+
body?: string;
|
|
126
|
+
cause?: unknown;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Yo! Payments API client (TypeScript port of the official PHP library YoAPI.php).
|
|
132
|
+
*
|
|
133
|
+
* Values are inserted into the request XML verbatim (exactly like the PHP library),
|
|
134
|
+
* so any special XML characters in narratives, references or notification URLs must
|
|
135
|
+
* be escaped by the caller.
|
|
136
|
+
*/
|
|
137
|
+
declare class YoAPI {
|
|
138
|
+
/** The Yo! Payments API Username. Required. */
|
|
139
|
+
private username;
|
|
140
|
+
/** The Yo! Payments API Password. Required. */
|
|
141
|
+
private password;
|
|
142
|
+
/** Whether the gateway connection is held open until the request completes. Default "FALSE". */
|
|
143
|
+
private nonBlocking;
|
|
144
|
+
/** An externally agreed reference (e.g. an invoice number). */
|
|
145
|
+
private externalReference;
|
|
146
|
+
/** A reference code related to another Yo! Payments system transaction. */
|
|
147
|
+
private internalReference;
|
|
148
|
+
/** Text appended to the confirmation SMS sent by the mobile money provider. */
|
|
149
|
+
private providerReferenceText;
|
|
150
|
+
/** URL notified as soon as funds are successfully deposited into your account. */
|
|
151
|
+
private instantNotificationUrl;
|
|
152
|
+
/** URL notified as soon as a deposit request fails. */
|
|
153
|
+
private failureNotificationUrl;
|
|
154
|
+
/** May be required to authenticate certain deposit requests. */
|
|
155
|
+
private authenticationSignatureBase64;
|
|
156
|
+
/** "PULL" or "PUSH". Default "PULL". */
|
|
157
|
+
private depositTransactionType;
|
|
158
|
+
/** The URL API requests are submitted to. */
|
|
159
|
+
private yoUrl;
|
|
160
|
+
/** Certificate used to verify IPN signatures (sandbox or production). */
|
|
161
|
+
private publicKeyFile;
|
|
162
|
+
/** Whether publicKeyFile is still the bundled default (enables the embedded-cert fallback). */
|
|
163
|
+
private publicKeyFileIsDefault;
|
|
164
|
+
private transactionLimitAccountIdentifier;
|
|
165
|
+
/** Unique nonce per request, required when public key authentication is enabled. */
|
|
166
|
+
private publicKeyAuthenticationNonce;
|
|
167
|
+
/** Base64 RSA signature over SHA1(username+amount+account+narrative+external_ref+nonce). */
|
|
168
|
+
private publicKeyAuthenticationSignatureBase64;
|
|
169
|
+
/** Location of the private key used to sign the public key authentication signature. */
|
|
170
|
+
private privateKeyFileLocation;
|
|
171
|
+
/**
|
|
172
|
+
* Private key PEM content used to sign the public key authentication signature.
|
|
173
|
+
* Prefer this over a file location on serverless/bundled hosts where the
|
|
174
|
+
* filesystem is ephemeral (e.g. Vercel). Takes precedence when both are set.
|
|
175
|
+
*/
|
|
176
|
+
private privateKeyContent;
|
|
177
|
+
private readonly mode;
|
|
178
|
+
/** Request timeout in milliseconds (PHP library uses curl timeout 120s). <= 0 means no timeout, like curl. */
|
|
179
|
+
private timeoutMs;
|
|
180
|
+
/**
|
|
181
|
+
* Whether to verify the gateway TLS certificate. Default true.
|
|
182
|
+
* The PHP library disables peer verification; this port verifies by default and
|
|
183
|
+
* only skips verification when explicitly opted out via setTlsVerificationEnabled(false).
|
|
184
|
+
*/
|
|
185
|
+
private verifyTls;
|
|
186
|
+
/** Maximum accepted gateway response body in bytes (default 1 MiB). */
|
|
187
|
+
private maxResponseBytes;
|
|
188
|
+
constructor(username: string, password: string, mode?: YoMode);
|
|
189
|
+
/** Returns the mode ("production" or "sandbox") this instance was created with. */
|
|
190
|
+
getMode(): YoMode;
|
|
191
|
+
/** Set the API Username. */
|
|
192
|
+
setUsername(username: string): void;
|
|
193
|
+
/** Returns the API Username. */
|
|
194
|
+
getUsername(): string;
|
|
195
|
+
/** Set the API Password. */
|
|
196
|
+
setPassword(password: string): void;
|
|
197
|
+
/** Returns the API Password. */
|
|
198
|
+
getPassword(): string;
|
|
199
|
+
/** Set the URL to submit API requests to. */
|
|
200
|
+
setUrl(url: string): void;
|
|
201
|
+
/** Returns the URL API requests are submitted to. */
|
|
202
|
+
getUrl(): string;
|
|
203
|
+
/** Set the path of the certificate used to verify IPN signatures. */
|
|
204
|
+
setPublicKeyFileUrl(publicKeyFileUrl: string): void;
|
|
205
|
+
/** Returns the path of the certificate used to verify IPN signatures. */
|
|
206
|
+
getPublicKeyFileUrl(): string;
|
|
207
|
+
/** Set the NonBlocking variable: "TRUE" for non-blocking API requests. */
|
|
208
|
+
setNonblocking(nonblocking: NonBlocking): void;
|
|
209
|
+
/** Returns the NonBlocking variable. */
|
|
210
|
+
getNonblocking(): NonBlocking;
|
|
211
|
+
/** Set the External Reference used when submitting payment requests. */
|
|
212
|
+
setExternalReference(externalReference: string | null): void;
|
|
213
|
+
/** Returns the externalReference variable. */
|
|
214
|
+
getExternalReference(): string | null;
|
|
215
|
+
/** Set the Internal Reference used when submitting payment requests. */
|
|
216
|
+
setInternalReference(internalReference: string | null): void;
|
|
217
|
+
/** Returns the internalReference variable. */
|
|
218
|
+
getInternalReference(): string | null;
|
|
219
|
+
/** Set the Provider Reference Text used when submitting payment requests. */
|
|
220
|
+
setProviderReferenceText(providerReferenceText: string | null): void;
|
|
221
|
+
/** Returns the providerReferenceText variable. */
|
|
222
|
+
getProviderReferenceText(): string | null;
|
|
223
|
+
/** Set the Instant Notification URL (useful for non-blocking requests). */
|
|
224
|
+
setInstantNotificationUrl(instantNotificationUrl: string | null): void;
|
|
225
|
+
/** Returns the instantNotificationUrl variable. */
|
|
226
|
+
getInstantNotificationUrl(): string | null;
|
|
227
|
+
/** Set the Failure Notification URL (useful for non-blocking requests). */
|
|
228
|
+
setFailureNotificationUrl(failureNotificationUrl: string | null): void;
|
|
229
|
+
/** Returns the failureNotificationUrl variable. */
|
|
230
|
+
getFailureNotificationUrl(): string | null;
|
|
231
|
+
/** Set the Authentication Signature Base64. */
|
|
232
|
+
setAuthenticationSignatureBase64(authenticationSignatureBase64: string | null): void;
|
|
233
|
+
/** Returns the Authentication Signature Base64 variable. */
|
|
234
|
+
getAuthenticationSignatureBase64(): string | null;
|
|
235
|
+
/** Set the Deposit Transaction Type ("PULL" or "PUSH") used by acTransactionCheckStatus. */
|
|
236
|
+
setDepositTransactionType(depositTransactionType: DepositTransactionType): void;
|
|
237
|
+
/** Returns the Deposit Transaction Type variable. */
|
|
238
|
+
getDepositTransactionType(): DepositTransactionType;
|
|
239
|
+
/** Set the Transaction Limit Account Identifier (refer to your account administrator). */
|
|
240
|
+
setTransactionLimitAccountIdentifier(transactionLimitAccountIdentifier: string | null): void;
|
|
241
|
+
/** Returns the Transaction Limit Account Identifier variable. */
|
|
242
|
+
getTransactionLimitAccountIdentifier(): string | null;
|
|
243
|
+
/** Set the Public Key Authentication Nonce (refer to your account administrator). */
|
|
244
|
+
setPublicKeyAuthenticationNonce(publicKeyAuthenticationNonce: string | null): void;
|
|
245
|
+
/** Returns the Public Key Authentication Nonce variable. */
|
|
246
|
+
getPublicKeyAuthenticationNonce(): string | null;
|
|
247
|
+
/** Set the Public Key Authentication Base64-Encoded Signature (refer to your account administrator). */
|
|
248
|
+
setPublicKeyAuthenticationSignatureBase64(publicKeyAuthenticationSignatureBase64: string | null): void;
|
|
249
|
+
/** Returns the Public Key Authentication Base64-Encoded Signature variable. */
|
|
250
|
+
getPublicKeyAuthenticationSignatureBase64(): string | null;
|
|
251
|
+
/** Set the location of the private key used to sign the public key authentication signature. */
|
|
252
|
+
setPrivateKeyFileLocation(privateKeyFileLocation: string | null): void;
|
|
253
|
+
/** Returns the Private Key File variable. */
|
|
254
|
+
getPrivateKeyFileLocation(): string | null;
|
|
255
|
+
/**
|
|
256
|
+
* Set the private key PEM content directly (alternative to setPrivateKeyFileLocation).
|
|
257
|
+
* Useful where key files are unavailable, e.g. serverless deployments reading
|
|
258
|
+
* the key from an environment variable. Takes precedence when both are set.
|
|
259
|
+
*/
|
|
260
|
+
setPrivateKeyContent(privateKeyContent: string | null): void;
|
|
261
|
+
/** Returns the Private Key PEM content variable. */
|
|
262
|
+
getPrivateKeyContent(): string | null;
|
|
263
|
+
/** Set the request timeout in milliseconds. Values <= 0 disable the timeout (like PHP curl timeout 0). */
|
|
264
|
+
setTimeout(timeoutMs: number): void;
|
|
265
|
+
/** Returns the request timeout in milliseconds. */
|
|
266
|
+
getTimeout(): number;
|
|
267
|
+
/**
|
|
268
|
+
* Enable or disable verification of the gateway TLS certificate (default enabled).
|
|
269
|
+
* Disable only for testing against endpoints with self-signed certificates —
|
|
270
|
+
* the PHP library always skips verification.
|
|
271
|
+
* Note: the underlying mechanism is a Bun fetch extension; on Node.js, disabling
|
|
272
|
+
* verification additionally requires NODE_TLS_REJECT_UNAUTHORIZED=0 in the environment.
|
|
273
|
+
*/
|
|
274
|
+
setTlsVerificationEnabled(enabled: boolean): void;
|
|
275
|
+
/** Returns whether gateway TLS certificate verification is enabled. */
|
|
276
|
+
getTlsVerificationEnabled(): boolean;
|
|
277
|
+
/** Set the maximum accepted gateway response body in bytes (default 1048576). */
|
|
278
|
+
setMaxResponseBytes(maxResponseBytes: number): void;
|
|
279
|
+
/** Returns the maximum accepted gateway response body in bytes. */
|
|
280
|
+
getMaxResponseBytes(): number;
|
|
281
|
+
/**
|
|
282
|
+
* Request Mobile Money User to deposit funds into your account.
|
|
283
|
+
* Shortly after submitting, the mobile money user receives an on-screen prompt to
|
|
284
|
+
* authorize the transfer. Not supported by all mobile money operator networks.
|
|
285
|
+
* @param msisdn the mobile money phone number in the format 256772123456
|
|
286
|
+
* @param amount the amount to deposit into your account (fractions supported)
|
|
287
|
+
* @param narrative the reason for the mobile money user to deposit funds
|
|
288
|
+
*/
|
|
289
|
+
acDepositFunds(msisdn: string, amount: number | string, narrative: string): Promise<DepositFundsResponse>;
|
|
290
|
+
/**
|
|
291
|
+
* Check the status of a transaction that was earlier submitted for processing.
|
|
292
|
+
* Particularly useful when NonBlocking is "TRUE".
|
|
293
|
+
* @param transactionReference the gateway reference uniquely identifying the transaction
|
|
294
|
+
* @param privateTransactionReference the External Reference used to carry out the transaction
|
|
295
|
+
*/
|
|
296
|
+
acTransactionCheckStatus(transactionReference: string | null, privateTransactionReference?: string | null): Promise<TransactionCheckStatusResponse>;
|
|
297
|
+
/**
|
|
298
|
+
* Transfer funds from your Payment Account to another Yo! Payments Account.
|
|
299
|
+
* @param currencyCode e.g. "UGX-MTNMM", "UGX-MTNAT", "UGX-WTLAT", "UGX-OULAT", "UGX-AIRAT"
|
|
300
|
+
* @param amount the amount to be transferred
|
|
301
|
+
* @param beneficiaryAccount account number of the beneficiary Yo! Payments user
|
|
302
|
+
* @param beneficiaryEmail email address of the recipient of funds
|
|
303
|
+
* @param narrative textual narrative about the transaction
|
|
304
|
+
*/
|
|
305
|
+
acInternalTransfer(currencyCode: string, amount: number | string, beneficiaryAccount: number | string, beneficiaryEmail: string, narrative: string): Promise<InternalTransferResponse>;
|
|
306
|
+
/**
|
|
307
|
+
* Get the current balance of your Yo! Payments Account.
|
|
308
|
+
* The returned object contains an array of balances (including airtime).
|
|
309
|
+
*/
|
|
310
|
+
acAcctBalance(): Promise<AcctBalanceResponse>;
|
|
311
|
+
/**
|
|
312
|
+
* Return transactions carried out on your account for a certain period of time.
|
|
313
|
+
* @param startDate format YYYY-MM-DD HH:MM:SS
|
|
314
|
+
* @param endDate format YYYY-MM-DD HH:MM:SS
|
|
315
|
+
* @param transactionStatus e.g. "FAILED", "PENDING", "INDETERMINATE", "SUCCEEDED", "FAILED,SUCCEEDED"
|
|
316
|
+
* @param currencyCode e.g. "UGX-MTNMM", "UGX-WARIDMM", "UGX-MTNAT", "UGX-WTLAT", "UGX-OULAT", "UGX-AIRAT"
|
|
317
|
+
* @param resultSetLimit a value of 0 returns all; default gateway limit = 15
|
|
318
|
+
* @param transactionEntryDesignation "TRANSACTION", "CHARGES" or "ANY"
|
|
319
|
+
* @param externalReference filter using this external reference
|
|
320
|
+
*/
|
|
321
|
+
acGetMinistatement(startDate?: string | null, endDate?: string | null, transactionStatus?: string | null, currencyCode?: string | null, resultSetLimit?: number | null, transactionEntryDesignation?: string, externalReference?: string | null): Promise<MinistatementResponse>;
|
|
322
|
+
/**
|
|
323
|
+
* Send airtime to a mobile phone user.
|
|
324
|
+
* @param msisdn the mobile phone number in the format 256772123456
|
|
325
|
+
* @param amount the amount of airtime to be sent to the mobile user
|
|
326
|
+
* @param narrative textual narrative about the transfer
|
|
327
|
+
*/
|
|
328
|
+
acSendAirtimeMobile(msisdn: string, amount: number | string, narrative: string): Promise<SendAirtimeResponse>;
|
|
329
|
+
/**
|
|
330
|
+
* Send airtime from your Yo! Payments account to another Yo! Payments user account.
|
|
331
|
+
* @param currencyCode e.g. "UGX-MTNAT", "UGX-WTLAT", "UGX-OULAT", "UGX-AIRAT"
|
|
332
|
+
* @param amount the amount of airtime to be sent to the beneficiary Yo! Payments user
|
|
333
|
+
* @param beneficiaryAccount the beneficiary Yo! Payments account number
|
|
334
|
+
* @param beneficiaryEmail the beneficiary email address
|
|
335
|
+
* @param narrative textual narrative about the transfer
|
|
336
|
+
*/
|
|
337
|
+
acSendAirtimeInternal(currencyCode: string, amount: number | string, beneficiaryAccount: number | string, beneficiaryEmail: string, narrative: string): Promise<SendAirtimeResponse>;
|
|
338
|
+
/**
|
|
339
|
+
* Withdraw funds from your Yo! Payments Account to a mobile money user.
|
|
340
|
+
* Handle with care: if compromised, it can lead to withdrawal of funds from your account.
|
|
341
|
+
* Requires permission granted by the issuance of an API Access Letter.
|
|
342
|
+
* @param msisdn the mobile money phone number in the format 256772123456
|
|
343
|
+
* @param amount the amount to withdraw from your account (fractions supported)
|
|
344
|
+
* @param narrative the reason for withdrawal of funds from your account
|
|
345
|
+
*/
|
|
346
|
+
acWithdrawFunds(msisdn: string, amount: number | string, narrative: string): Promise<DepositFundsResponse>;
|
|
347
|
+
/**
|
|
348
|
+
* Purchase airtime using your Mobile Money Credit.
|
|
349
|
+
* @param airtimeCurrencyCode e.g. "UGX-MTNAT", "UGX-AIRAT", "UGX-OULAT", "UGX-UTLAT", "UGX-SMTAT"
|
|
350
|
+
* @param amount the amount to spend (fractions supported)
|
|
351
|
+
*/
|
|
352
|
+
acUserPurchaseAirtimestock(airtimeCurrencyCode: string, amount: number | string): Promise<PurchaseAirtimeStockResponse>;
|
|
353
|
+
/**
|
|
354
|
+
* Obtain the name of a phone number before paying out funds.
|
|
355
|
+
* Only available for MTN Uganda and Airtel Uganda networks; requires permission
|
|
356
|
+
* from support@yo.co.ug.
|
|
357
|
+
* @param msisdn the phone number in the format 2567XXXXXXXXXX
|
|
358
|
+
*/
|
|
359
|
+
acGetMsisdnKycInfo(msisdn: string): Promise<MsisdnKycInfoResponse>;
|
|
360
|
+
/**
|
|
361
|
+
* Decode and verify a successful payment notification (IPN) POSTed to your
|
|
362
|
+
* Instant Notification URL. Pass the parsed form body of the request.
|
|
363
|
+
*/
|
|
364
|
+
receivePaymentNotification(body: PaymentNotificationBody): PaymentNotificationResult;
|
|
365
|
+
/**
|
|
366
|
+
* Decode and verify a failed payment notification POSTed to your
|
|
367
|
+
* Failure Notification URL. Pass the parsed form body of the request.
|
|
368
|
+
*/
|
|
369
|
+
receivePaymentFailureNotification(body: PaymentFailureNotificationBody): PaymentFailureNotificationResult;
|
|
370
|
+
/**
|
|
371
|
+
* Calculate the Public Key Authentication Signature required by some payout requests.
|
|
372
|
+
* Sets publicKeyAuthenticationSignatureBase64 on success.
|
|
373
|
+
* @param msisdn the account the funds will be pushed to
|
|
374
|
+
* @param amount the transaction amount
|
|
375
|
+
* @param narrative the transaction narrative
|
|
376
|
+
*/
|
|
377
|
+
generatePublicKeyAuthenticationSignature(msisdn: string, amount: number | string, narrative: string): void;
|
|
378
|
+
/** POST raw XML to the gateway and return the XML response body. */
|
|
379
|
+
protected getXmlResponse(xml: string): Promise<string>;
|
|
380
|
+
/** Verify the RSA-SHA256 signature on a payment notification against the Yo public certificate. */
|
|
381
|
+
protected verifyPaymentNotification(body: PaymentNotificationBody): boolean;
|
|
382
|
+
/** Verify the RSA-SHA256 signature on a payment failure notification against the Yo public certificate. */
|
|
383
|
+
protected verifyPaymentFailureNotification(body: PaymentFailureNotificationBody): boolean;
|
|
384
|
+
private verifySignature;
|
|
385
|
+
private authXml;
|
|
386
|
+
private requestXml;
|
|
387
|
+
/** POST the request XML to the gateway and return the parsed envelope that holds the <Response> node. */
|
|
388
|
+
private parseResponse;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export { type AcctBalanceResponse, type BalanceEntry, type DepositFundsResponse, type DepositTransactionType, type InternalTransferResponse, type MinistatementResponse, type MsisdnKycInfoResponse, type NonBlocking, type PaymentFailureNotificationBody, type PaymentFailureNotificationResult, type PaymentNotificationBody, type PaymentNotificationResult, type PurchaseAirtimeStockResponse, type SendAirtimeResponse, type TransactionCheckStatusResponse, type TransactionDetail, YoAPI, YoAPIError, type YoMode, YoAPI as default };
|