pawapay-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.
@@ -0,0 +1,1257 @@
1
+ interface PawaPayResponse<T = any, E = any> {
2
+ success: boolean;
3
+ data?: T;
4
+ status?: number;
5
+ error?: E;
6
+ headers?: any;
7
+ }
8
+ interface RequestOptions {
9
+ timeout?: number;
10
+ headers?: Record<string, string>;
11
+ }
12
+ type DepositConfig = {
13
+ /**
14
+ * @description A UUIDv4 based ID specified by you, that uniquely identifies the deposit.
15
+ * Required string length: 36
16
+ * @example depositId: "<INSERT_UUID_FOR_DEPOSIT>"
17
+ */
18
+ depositId: string;
19
+ /**
20
+ * @description The amount to be collected (deposit) or disbursed (payout or refund).
21
+ *
22
+ * Amount must follow below requirements or the request will be rejected:
23
+ *
24
+ * Between zero and two decimal places can be supplied, depending on what the specific MMO supports. Learn about all MMO supported decimal places.
25
+ * The minimum and maximum amount depends on the limits of the specific MMO. You can find them from the Active Configuration endpoint.
26
+ * Leading zeroes are not permitted except where the value is less than 1. For any value less than one, one and only one leading zero must be supplied.
27
+ * Trailing zeroes are permitted.
28
+ *
29
+ * Valid examples:
30
+ *
31
+ * 5, 5.0, 5.00, 5.5, 5.55, 5555555, 0.5
32
+ *
33
+ * Not valid examples:
34
+ *
35
+ * @ 5., 5.555, 5555555555555555555, .5, -5.5, 00.5, 00.00, 00001.32
36
+ *
37
+ * Required string length: 1 - 23
38
+ *
39
+ * @example Example: "15"
40
+
41
+ */
42
+ amount: string;
43
+ /**
44
+ * @description The currency in which the amount is specified.
45
+ *
46
+ * Format must be the ISO 4217 three character currency code in upper case. Read more from {@link https://en.wikipedia.org/wiki/ISO_4217#Active_codes |Wikipedia}.
47
+ *
48
+ * You can find all the supported currencies that the specific correspondent supports {@link https://docs.pawapay.io/using_the_api#correspondents | from here}.
49
+ *
50
+ * The {@link https://docs.pawapay.io/v1/api-reference/toolkit/active-configuration | active configuration} endpoint provides the list of correspondents configured for your account together with the currencies.
51
+ *
52
+ * @example Example: "MWK"
53
+ */
54
+ currency: string;
55
+ /**
56
+ * @description The country in which the MMO operates.
57
+ *
58
+ * Format is ISO 3166-1 alpha-3, three character country code in upper case. Read more from {@link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements | Wikipedia}.
59
+ *
60
+ * @example Example: "MWI"
61
+ */
62
+ country?: string;
63
+ /**
64
+ * @description The correspondent code refers to the specific MMO that the specified phone number (MSISDN) has an active mobile money wallet with.
65
+ *
66
+ * You can find all the supported correspondents {@link https://docs.pawapay.io/using_the_api#correspondents | listed here}.
67
+ *
68
+ * The {@link https://docs.pawapay.io/v1/api-reference/toolkit/active-configuration | active configuration} endpoint provides the list of correspondents configured for your account.
69
+ *
70
+ * You can use the {@link https://docs.pawapay.io/v1/api-reference/toolkit/predict-correspondent | predict correspondent} enpoint to predict the correct correspondent to use based on the phone number (MSISDN).
71
+ *
72
+ * @example
73
+ * Example: "AIRTEL_MWI"
74
+ */
75
+ correspondent: string;
76
+ /**
77
+ * @description The phone number (MSISDN) of the recipient or payer must be specified as the `value` of the `address`.
78
+ */
79
+ payer: {
80
+ /** @description The type of financial address. At the moment, only MSISDN is supported as the financial address.
81
+ * @example
82
+ * {
83
+ * type: "MSISDN"
84
+ * }
85
+ */
86
+ type: "MSISDN" & string;
87
+ /**
88
+ * @description The phone number (MSISDN) of the payer or recipient.
89
+ *
90
+ * The format is described in {@link https://en.wikipedia.org/wiki/MSISDN | Wikipedia}.
91
+ *
92
+ * MSISDN validation has following rules:
93
+ *
94
+ * - Only digits without whitespaces or any other separators or prefixes like '+'
95
+ * - Should not start with zero.
96
+ * - Country code is mandatory.
97
+ * - Should not exceed or be less than the valid length of specified country.
98
+ * - Valid examples for Malawi: 265999123456
99
+ *
100
+ * Not valid examples for Malawi:
101
+ * +265999123456, +2650999123456, 265 999 123 456, 265-9991-23456, 0265999123456,
102
+ *
103
+ * @example {value: "265 999 123 678"}
104
+ *
105
+ */
106
+ address: {
107
+ value: string;
108
+ };
109
+ };
110
+ /**
111
+ * @description The timestamp of when the deposit was created in the pawaPay platform.
112
+ *
113
+ * Format defined by 'date-time' in RFC3339 section 5.6 from {@link https://tools.ietf.org/html/rfc3339#section-5.6 | IETF}
114
+ *
115
+ * @example Example:"2020-02-21T17:32:28Z"
116
+ */
117
+ customerTimestamp: string;
118
+ /**
119
+ * @description Short description for the transaction.
120
+ *
121
+ * Depending on the specific MMO performing the transaction this message may be visible to the customer in the SMS receipt or within their transaction history.
122
+ *
123
+ * Must be between 4 and 22 alphanumeric characters.
124
+ *
125
+ * Required string length: 4 - 22
126
+ *
127
+ * @example Example: "Note of 4 to 22 chars"
128
+ */
129
+ statementDescription: string;
130
+ /**
131
+ * @description For MMOs (correspondents) that use a preauthorisation code instead of a PIN prompt for authorising the deposit.
132
+ *
133
+ * Required string length: 1 - 36
134
+ */
135
+ preAuthorisationCode?: string;
136
+ /**
137
+ * @description A list of metadata that you can attach to the payment for providing additional context about the payment.
138
+ *
139
+ * For example, adding orderId to indicate for which order this payment was for or customerId to know which customer this payment pertains to.
140
+ *
141
+ * Metadata will not be visible to the customer that is party to this payment.
142
+ * It will be visible in the pawaPay Dashboard on the payment details page and in your financial statements as a JSON object to support automated reconciliation.\
143
+ * It is also possible to search for recent payments in the pawaPay Dashboard using global search based on the values of metadata.
144
+ *
145
+ * Up to 10 metadata fields can be attached to a payment.
146
+ *
147
+ *
148
+ * @param {string} metadata.fieldName - The name of the metadata that you are attaching to the payment.
149
+ * @example {fieldName: "orderId"}
150
+ *
151
+ *
152
+ * @param {string} metadata.metadata.fieldValue - The value for this metadata field
153
+ * @example {fieldValue: "ORD-123456789"}
154
+ *
155
+ *
156
+ * @param {boolean} metadata.isPII - Indicates whether the field contains personally identifiable information. Used for enabling compliance with GDPR or other relevant data privacy laws.
157
+ * @example {isPII: true}
158
+ */
159
+ metadata?: Array<{
160
+ fieldName: string;
161
+ fieldValue: string;
162
+ isPII?: boolean;
163
+ }>;
164
+ };
165
+ type RequestPayoutConfig = {
166
+ /**
167
+ * @description A UUIDv4 based ID specified by you, that uniquely identifies the payout.
168
+ * Required string length: 36
169
+ * @example payoutId: "<INSERT_UUID_FOR_PAYOUT>"
170
+ */
171
+ payoutId: string;
172
+ /**
173
+ * @description The amount to be disbursed for the payout.
174
+ *
175
+ * Amount must follow the same requirements as in DepositConfig.
176
+ * Valid examples: 5, 5.0, 5.00, 5.5, 5.55, 5555555, 0.5
177
+ * Not valid examples: 5., 5.555, 5555555555555555555, .5, -5.5, 00.5, 00.00, 00001.32
178
+ * Required string length: 1 - 23
179
+ * @example "15"
180
+ */
181
+ amount: string;
182
+ /**
183
+ * @description The currency in which the amount is specified.
184
+ * Format must be the ISO 4217 three character currency code in upper case.
185
+ * @example "MWK"
186
+ */
187
+ currency: string;
188
+ /**
189
+ * @description The correspondent code refers to the specific MMO that the recipient has an active mobile money wallet with.
190
+ * @example "AIRTEL_MWI"
191
+ */
192
+ correspondent: string;
193
+ /**
194
+ * @description The phone number (MSISDN) of the recipient.
195
+ * Format: Only digits, no whitespaces or separators, no leading zero, must include country code.
196
+ * @example "265999123456"
197
+ */
198
+ receipient: string;
199
+ /**
200
+ * @description The timestamp of when the payout was created in the pawaPay platform.
201
+ * Format defined by 'date-time' in RFC3339 section 5.6.
202
+ * @example "2020-02-21T17:32:28Z"
203
+ */
204
+ customerTimestamp: string;
205
+ /**
206
+ * @description Short description for the transaction, visible to the customer in SMS or transaction history.
207
+ * Must be between 4 and 22 alphanumeric characters.
208
+ * @example "Note of 4 to 22 chars"
209
+ */
210
+ statementDescription: string;
211
+ /**
212
+ * @description The country in which the MMO operates. ISO 3166-1 alpha-3 code in upper case.
213
+ * @example "MWI"
214
+ */
215
+ country: string;
216
+ /**
217
+ * @description A list of metadata for providing additional context about the payout. Up to 10 fields allowed.
218
+ * @example [{ fieldName: "orderId", fieldValue: "ORD-123456789", isPII: false }]
219
+ */
220
+ metadata: Array<{
221
+ fieldName: string;
222
+ fieldValue: string;
223
+ isPII?: boolean;
224
+ }>;
225
+ };
226
+ type BaseRequestPayoutResponse = {
227
+ payoutId: string;
228
+ status: string;
229
+ };
230
+ type AcceptedRequestPayout = BaseRequestPayoutResponse & {
231
+ status: "ACCEPTED";
232
+ created: string;
233
+ };
234
+ type DuplicateIgnoredRequestPayout = BaseRequestPayoutResponse & {
235
+ status: "DUPLICATE_IGNORED";
236
+ created: string;
237
+ };
238
+ type RejectedRequestPayout = BaseRequestPayoutResponse & {
239
+ status: "REJECTED";
240
+ rejectionReason: {
241
+ rejectionCode: string;
242
+ rejectionMessage: string;
243
+ };
244
+ };
245
+ type RequestPayoutRespose = AcceptedRequestPayout | DuplicateIgnoredRequestPayout | RejectedRequestPayout;
246
+ type PayoutCallback = {
247
+ payoutId: string;
248
+ status: string;
249
+ amount: string;
250
+ currency: string;
251
+ country: string;
252
+ correspondent: string;
253
+ recipient: {
254
+ type: string;
255
+ address: {
256
+ value: string;
257
+ };
258
+ };
259
+ customerTimestamp: string;
260
+ statementDescription: string;
261
+ created: string;
262
+ receivedByRecipient: string;
263
+ correspondentIds: {};
264
+ failureReason: {
265
+ failureCode: string;
266
+ failureMessage: string;
267
+ };
268
+ metadata: {};
269
+ };
270
+ type CheckPayoutStatusBase = {
271
+ payoutId: string;
272
+ status: string;
273
+ amount: string;
274
+ currency: string;
275
+ country: string;
276
+ correspondent: string;
277
+ recipient: {
278
+ type: string;
279
+ address: {
280
+ value: string;
281
+ };
282
+ };
283
+ customerTimestamp: string;
284
+ statementDescription: string;
285
+ created: string;
286
+ metadata: {};
287
+ };
288
+ type CheckPayoutStatusAccepted = CheckPayoutStatusBase & {
289
+ status: "ACCEPTED";
290
+ created: string;
291
+ };
292
+ type CheckPayoutStatusCompleted = CheckPayoutStatusBase & {
293
+ status: "COMPLETED";
294
+ receivedByRecipient: string;
295
+ correspondentIds: {};
296
+ };
297
+ type CheckPayoutStatusSubmitted = CheckPayoutStatusBase & {
298
+ status: "SUBMITTED";
299
+ created: string;
300
+ };
301
+ type CheckPayoutStatusEnqueued = CheckPayoutStatusBase & {
302
+ status: "ENQUEUED";
303
+ created: string;
304
+ };
305
+ type CheckPayoutStatusSFailed = CheckPayoutStatusBase & {
306
+ status: "FAILED";
307
+ failureReason: {
308
+ failureCode: string;
309
+ failureMessage: string;
310
+ };
311
+ created: string;
312
+ };
313
+ type CheckPayoutStatusResponse = CheckPayoutStatusAccepted | CheckPayoutStatusCompleted | CheckPayoutStatusSubmitted | CheckPayoutStatusEnqueued | CheckPayoutStatusSFailed;
314
+ type CancelEnqueuedPayoutBase = {
315
+ payoutId: string;
316
+ status: string;
317
+ };
318
+ type CancelEnqueuedPayoutAccepted = CancelEnqueuedPayoutBase & {
319
+ status: "ACCEPTED";
320
+ created: string;
321
+ };
322
+ type CancelEnqueuedPayoutRejected = CancelEnqueuedPayoutBase & {
323
+ status: "REJECTED";
324
+ failureReason: string;
325
+ };
326
+ type CancelEnqueuedPayoutFailed = CancelEnqueuedPayoutBase & {
327
+ status: "FAILED";
328
+ };
329
+ type CancelEnqueuedPayoutResponse = CancelEnqueuedPayoutAccepted | CancelEnqueuedPayoutRejected | CancelEnqueuedPayoutFailed;
330
+ type RequestBulkPayoutConfig = {
331
+ payoutId: string;
332
+ amount: string;
333
+ currency: string;
334
+ country: string;
335
+ correspondent: string;
336
+ recipient: {
337
+ type: string;
338
+ address: {
339
+ value: string;
340
+ };
341
+ };
342
+ customerTimestamp: string;
343
+ statementDescription: string;
344
+ metadata: Array<{
345
+ fieldName: string;
346
+ fieldValue: string;
347
+ isPII: boolean;
348
+ }>;
349
+ };
350
+ type RequestBuildPayoutResponseBase = {
351
+ payoutId: string;
352
+ status: string;
353
+ created: string;
354
+ };
355
+ type RequestBuildPayoutResponseAccepted = RequestBuildPayoutResponseBase & {
356
+ status: "ACCEPTED";
357
+ created: string;
358
+ };
359
+ type RequestBuildPayoutResponseDuplicateIgnored = RequestBuildPayoutResponseBase & {
360
+ status: "DUPLICATE_IGNORED";
361
+ };
362
+ type RequestBuildPayoutResponseRejected = RequestBuildPayoutResponseBase & {
363
+ status: "REJECTED";
364
+ failureReason: {
365
+ rejectionCode: string;
366
+ rejectionMessage: string;
367
+ };
368
+ };
369
+ type RequestBuildPayoutResponse = RequestBuildPayoutResponseAccepted | RequestBuildPayoutResponseDuplicateIgnored | RequestBuildPayoutResponseRejected;
370
+ type ResendPayoutCallbackBase = {
371
+ payoutId: string;
372
+ status: string;
373
+ };
374
+ type ResendPayoutCallbackAccepted = ResendPayoutCallbackBase & {
375
+ status: "ACCEPTED";
376
+ };
377
+ type ResendPayoutCallbackRejected = ResendPayoutCallbackBase & {
378
+ status: "REJECTED";
379
+ failureReason: string;
380
+ };
381
+ type ResendPayoutCallbackFailed = ResendPayoutCallbackBase & {
382
+ status: "FAILED";
383
+ };
384
+ type ResendPayoutCallbackResponse = ResendPayoutCallbackAccepted | ResendPayoutCallbackRejected | ResendPayoutCallbackFailed;
385
+ type RequestPayPageConfig = {
386
+ /**
387
+ * A UUIDv4 based ID specified by you, that uniquely identifies the deposit.
388
+ *
389
+ * Required string length: 36
390
+ * @example depositId: "<INSERT_UUID_FOR_DEPOSIT>"
391
+ */
392
+ depositId: string;
393
+ /**
394
+ * The URL to which the user will be redirected after completion of the operation.
395
+ *
396
+ * @example returnUrl: "https://merchant.com/paymentProcessed"
397
+ */
398
+ returnUrl: string;
399
+ /**
400
+ * @description Short description for the transaction.
401
+ *
402
+ * Depending on the specific MMO performing the transaction this message may be visible to the customer in the SMS receipt or within their transaction history.
403
+ *
404
+ * Must be between 4 and 22 alphanumeric characters.
405
+ *
406
+ * Required string length: 4 - 22
407
+ *
408
+ * @example Example: "Note of 4 to 22 chars"
409
+ */
410
+ statementDescription?: string;
411
+ /**
412
+ * If specified, the amount will be displayed to the customer as the payment amount. For example, when paying for specific goods or services.
413
+ *
414
+ * If not specified, the customer will have to specify the amount they wish to pay. For example, when depositing money into their eWallet.
415
+ *
416
+ * Amount must follow below requirements or the request will be rejected:
417
+ *
418
+ * - Between zero and two decimal places can be supplied, depending on what the specific MMO supports. Learn about all MMO supported decimal places.
419
+ *
420
+ * - The minimum and maximum amounts depend on the limits of the specific MMO. You can find them from the Active Configuration endpoint.
421
+ * - Leading zeroes are not permitted except where the value is less than 1. For any value less than one, one and only one leading zero must be supplied.
422
+ * - Trailing zeroes are permitted.
423
+ *
424
+ * Valid examples:
425
+ * 5, 5.0, 5.00, 5.5, 5.55, 5555555, 0.5
426
+ *
427
+ * Not valid examples:
428
+ * 5., 5.555, 5555555555555555555, .5, -5.5, 00.5, 00.00, 00001.32
429
+ *
430
+ * Required string length: 1 - 23
431
+ *
432
+ * @example amount: "15"
433
+ */
434
+ amount?: string;
435
+ /**
436
+ * @description The phone number (MSISDN) of the payer or recipient.
437
+ *
438
+ * The format is described in {@link https://en.wikipedia.org/wiki/MSISDN | Wikipedia}.
439
+ *
440
+ * MSISDN validation has following rules:
441
+ *
442
+ * - Only digits without whitespaces or any other separators or prefixes like '+'
443
+ * - Should not start with zero.
444
+ * - Country code is mandatory.
445
+ * - Should not exceed or be less than the valid length of specified country.
446
+ * - Valid examples for Malawi: 265999123456
447
+ *
448
+ * Not valid examples for Malawi:
449
+ * +265999123456, +2650999123456, 265 999 123 456, 265-9991-23456, 0265999123456,
450
+ *
451
+ * @example {value: "265 999 123 678"}
452
+ *
453
+ */
454
+ msisdn: string;
455
+ /**
456
+ * The language in which the Payment Page will be presented to the customer. If the user has explicitly changed their languages preferences, their selection will override this parameter.
457
+ *
458
+ * Available options: EN, FR
459
+ *
460
+ * @example language: "EN"
461
+ */
462
+ language?: string;
463
+ /**
464
+ * @description The country in which the MMO operates.
465
+ *
466
+ * Format is ISO 3166-1 alpha-3, three character country code in upper case. Read more from {@link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements | Wikipedia}.
467
+ *
468
+ * @example Example: "MWI"
469
+ */
470
+ country?: string;
471
+ /**
472
+ * Optional text which will be displayed to the customer on the payment page to specify what they are paying for.
473
+ *
474
+ * Required string length: 1 - 50
475
+ *
476
+ * @example reason: "Ticket to festival"
477
+ */
478
+ reason?: string;
479
+ /**
480
+ * @description A list of metadata that you can attach to the payment for providing additional context about the payment.
481
+ *
482
+ * For example, adding orderId to indicate for which order this payment was for or customerId to know which customer this payment pertains to.
483
+ *
484
+ * Metadata will not be visible to the customer that is party to this payment.
485
+ * It will be visible in the pawaPay Dashboard on the payment details page and in your financial statements as a JSON object to support automated reconciliation.\
486
+ * It is also possible to search for recent payments in the pawaPay Dashboard using global search based on the values of metadata.
487
+ *
488
+ * Up to 10 metadata fields can be attached to a payment.
489
+ *
490
+ *
491
+ * @param {string} metadata.fieldName - The name of the metadata that you are attaching to the payment.
492
+ * @example {fieldName: "orderId"}
493
+ *
494
+ *
495
+ * @param {string} metadata.metadata.fieldValue - The value for this metadata field
496
+ * @example {fieldValue: "ORD-123456789"}
497
+ *
498
+ *
499
+ * @param {boolean} metadata.isPII - Indicates whether the field contains personally identifiable information. Used for enabling compliance with GDPR or other relevant data privacy laws.
500
+ * @example {isPII: true}
501
+ */
502
+ metadata?: Array<{
503
+ fieldName: string;
504
+ fieldValue: string;
505
+ isPII?: boolean;
506
+ }>;
507
+ };
508
+ type RequestRefundConfig = {
509
+ /**
510
+ *@description A UUIDv4 based ID specified by you, that uniquely identifies the refund.
511
+ *
512
+ * Required string length: 36
513
+ *
514
+ * @example refundId:"<INSERT_UUID_FOR_REFUND>"
515
+ */
516
+ refundId: string;
517
+ /**
518
+ * @description The depositId of the deposit to be refunded.
519
+ *
520
+ * Required string length: 36
521
+ *
522
+ * @example depositId:"<INSERT_UUID_OF_DEPOSIT_TO_REFUND>"
523
+ */
524
+ depositId: string;
525
+ /**
526
+ * @description The amount to be collected (deposit) or disbursed (payout or refund).
527
+ *
528
+ * Amount must follow below requirements or the request will be rejected:
529
+ *
530
+ * - Between zero and two decimal places can be supplied, depending on what the specific MMO supports. Learn about all MMO supported decimal places.
531
+ *
532
+ * - The minimum and maximum amounts depend on the limits of the specific MMO. You can find them from the Active Configuration endpoint.
533
+ * - Leading zeroes are not permitted except where the value is less than 1. For any value less than one, one and only one leading zero must be supplied.
534
+ * - Trailing zeroes are permitted.
535
+ *
536
+ * Valid examples:
537
+ * 5, 5.0, 5.00, 5.5, 5.55, 5555555, 0.5
538
+ *
539
+ * Not valid examples:
540
+ * 5., 5.555, 5555555555555555555, .5, -5.5, 00.5, 00.00, 00001.32
541
+ *
542
+ * Required string length: 1 - 23
543
+ *
544
+ * @example amount: "15"
545
+ */
546
+ amount?: string;
547
+ /**
548
+ * @description A list of metadata that you can attach to the payment for providing additional context about the payment.
549
+ *
550
+ * For example, adding orderId to indicate for which order this payment was for or customerId to know which customer this payment pertains to.
551
+ *
552
+ * Metadata will not be visible to the customer that is party to this payment.
553
+ * It will be visible in the pawaPay Dashboard on the payment details page and in your financial statements as a JSON object to support automated reconciliation.\
554
+ * It is also possible to search for recent payments in the pawaPay Dashboard using global search based on the values of metadata.
555
+ *
556
+ * Up to 10 metadata fields can be attached to a payment.
557
+ *
558
+ *
559
+ * @param {string} metadata.fieldName - The name of the metadata that you are attaching to the payment.
560
+ * @example {fieldName: "orderId"}
561
+ *
562
+ *
563
+ * @param {string} metadata.metadata.fieldValue - The value for this metadata field
564
+ * @example {fieldValue: "ORD-123456789"}
565
+ *
566
+ *
567
+ * @param {boolean} metadata.isPII - Indicates whether the field contains personally identifiable information. Used for enabling compliance with GDPR or other relevant data privacy laws.
568
+ * @example {isPII: true}
569
+ */
570
+ metadata?: Array<{
571
+ fieldName: string;
572
+ fieldValue: string;
573
+ isPII?: boolean;
574
+ }>;
575
+ };
576
+ type RequestPayPageResponse = {
577
+ /**
578
+ * @description The unique URL of the payment page for this specific payment session.
579
+ *
580
+ * Customer has to be forwarded to this URL where they can complete the payment.
581
+ * The session is valid for 15 minutes for the customer to complete the payment.
582
+ *
583
+ * Please note! The URL is valid for 5 minutes.
584
+ *
585
+ * @example
586
+ * redirectUrl: "https://paywith.pawapay.io/?token=AgV4aA3ZxKfGcdMIo6a6Upf7X2MRptdFUrc6Oi3U53CxC0YAkAADABVhd3MtY3J5cHRv"
587
+ */
588
+ redirectUrl: string;
589
+ };
590
+ type PawaPayError = {
591
+ /**
592
+ * @description A unique error ID in the pawaPay platform.
593
+ *
594
+ * Maximum length: 36
595
+ *
596
+ * @example errorId: "63743264-7292-11ea-bc55-0242ac130003"
597
+ *
598
+ */
599
+ errorId?: string;
600
+ /**
601
+ * @description pawaPay internal error code.
602
+ * @example errorCode: 1
603
+ */
604
+ errorCode?: number;
605
+ /**
606
+ * @description Error message.
607
+ *
608
+ * @example errorMessage: "Internal error"
609
+ */
610
+ errorMessage?: string;
611
+ };
612
+ type AcceptedDeposit = {
613
+ /**
614
+ * @description The depositId of the deposit transaction.
615
+ *
616
+ * Required string length: 36
617
+ * @example depositId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
618
+ */
619
+ depositId: string;
620
+ /**
621
+ * @description The deposit request has been accepted by pawaPay for processing.
622
+ */
623
+ status: "ACCEPTED";
624
+ /**
625
+ * ISO Date String
626
+ * @example "2020-10-19T11:17:01Z"
627
+ */
628
+ created: string;
629
+ };
630
+ type DuplicatedIgnoredDeposit = {
631
+ /**
632
+ * @description The depositId of the deposit transaction.
633
+ *
634
+ * Required string length: 36
635
+ * @example depositId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
636
+ */
637
+ depositId: string;
638
+ /**
639
+ * @description The deposit request has been ignored as a duplicate of an already accepted deposit request. Duplication logic relies upon depositId.
640
+ */
641
+ status: "DUPLICATE_IGNORED";
642
+ /**
643
+ * ISO Date String
644
+ * @example "2020-10-19T11:17:01Z"
645
+ */
646
+ created: string;
647
+ };
648
+ type RejectedDeposit = {
649
+ /**
650
+ * @description The depositId of the deposit transaction.
651
+ *
652
+ * Required string length: 36
653
+ * @example depositId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
654
+ */
655
+ depositId: string;
656
+ /**
657
+ * @description The deposit request has been rejected. See rejectionReason for details.
658
+ */
659
+ status: "REJECTED";
660
+ rejectionReason: {
661
+ /**
662
+ * @description Possible deposit rejection codes:
663
+ *
664
+ * - INVALID_PAYER_FORMAT - The payer address (phone number) is invalid.
665
+ * - INVALID_CORRESPONDENT - The specified correspondent is not supported.
666
+ * - INVALID_AMOUNT - The specified amount is not supported.
667
+ * - AMOUNT_TOO_SMALL - The specified amount is smaller than the minimum allowed by the MMO specified as the correspondent.
668
+ * - AMOUNT_TOO_LARGE - The specified amount is larger than the maximum allowed by the MMO specified as the correspondent.
669
+ * - INVALID_CURRENCY - The specified currency is not supported for the MMO specified as the correspondent.
670
+ * - INVALID_COUNTRY - The specified country is not supported for this MMO specified as the correspondent.
671
+ * - PARAMETER_INVALID - One or more parameters are invalid.
672
+ * - INVALID_INPUT - We were unable to parse the payload of the request.
673
+ * - DEPOSITS_NOT_ALLOWED - Deposits are not allowed for the merchant or the MMO specified as the correspondent.
674
+ * - CORRESPONDENT_TEMPORARILY_UNAVAILABLE - The MMO specified as the correspondent is currently experiencing an outage and processing of payments has been temporarily halted.
675
+ *
676
+ * Please refer to our {@link https://status.pawapay.io/ | Status Page} for live information about MMO availability.
677
+ *
678
+ * @example rejectionCode: "INVALID_AMOUNT"
679
+ *
680
+ */
681
+ rejectionCode: "INVALID_PAYER_FORMAT" | "INVALID_CORRESPONDENT" | "INVALID_AMOUNT" | "AMOUNT_TOO_SMALL" | "AMOUNT_TOO_LARGE" | "INVALID_CURRENCY" | "INVALID_COUNTRY" | "PARAMETER_INVALID" | "INVALID_INPUT" | "DEPOSITS_NOT_ALLOWED" | "CORRESPONDENT_TEMPORARILY_UNAVAILABLE";
682
+ /**
683
+ * Additional optional rejection message
684
+ * @example rejectionMessage: "You don't have access to this correspondent"
685
+ */
686
+ rejectionMessage: string;
687
+ };
688
+ };
689
+ type DepositResponse = AcceptedDeposit | DuplicatedIgnoredDeposit | RejectedDeposit;
690
+ type CheckStatusBaseResponse = {
691
+ /**
692
+ * A UUIDv4 based ID specified by you, that uniquely identifies the deposit.
693
+ *
694
+ * Required string length: 36
695
+ *
696
+ * @example depositId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
697
+ */
698
+ depositId: string;
699
+ /**
700
+ * The amount to be collected (deposit) or disbursed (payout or refund).
701
+ *
702
+ * Amount must follow below requirements or the request will be rejected:
703
+ * Between zero and two decimal places can be supplied, depending on what the specific MMO supports. Learn about all MMO supported decimal places.
704
+ * The minimum and maximum amount depends on the limits of the specific MMO. You can find them from the Active Configuration endpoint.\
705
+ * Leading zeroes are not permitted except where the value is less than 1. For any value less than one, one and only one leading zero must be supplied.
706
+ * Trailing zeroes are permitted.
707
+ *
708
+ * Valid examples:
709
+ * 5, 5.0, 5.00, 5.5, 5.55, 5555555, 0.5
710
+ *
711
+ * Not valid examples:
712
+ * 5., 5.555, 5555555555555555555, .5, -5.5, 00.5, 00.00, 00001.32
713
+ *
714
+ * Required string length: 1 - 23
715
+ *
716
+ * @example requestedAmount: "15"
717
+ */
718
+ requestedAmout: string;
719
+ /**
720
+ * @description The currency in which the amount is specified.
721
+ *
722
+ * Format must be the ISO 4217 three character currency code in upper case. Read more from {@link https://en.wikipedia.org/wiki/ISO_4217#Active_codes |Wikipedia}.
723
+ *
724
+ * You can find all the supported currencies that the specific correspondent supports {@link https://docs.pawapay.io/using_the_api#correspondents | from here}.
725
+ *
726
+ * The {@link https://docs.pawapay.io/v1/api-reference/toolkit/active-configuration | active configuration} endpoint provides the list of correspondents configured for your account together with the currencies.
727
+ *
728
+ * @example Example: "MWK"
729
+ */
730
+ currency: string;
731
+ /**
732
+ * @description The country in which the MMO operates.
733
+ *
734
+ * Format is ISO 3166-1 alpha-3, three character country code in upper case. Read more from {@link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements | Wikipedia}.
735
+ *
736
+ * @example Example: "MWI"
737
+ */
738
+ country: string;
739
+ /**
740
+ * @description The correspondent code refers to the specific MMO that the specified phone number (MSISDN) has an active mobile money wallet with.
741
+ *
742
+ * You can find all the supported correspondents {@link https://docs.pawapay.io/using_the_api#correspondents | listed here}.
743
+ *
744
+ * The {@link https://docs.pawapay.io/v1/api-reference/toolkit/active-configuration | active configuration} endpoint provides the list of correspondents configured for your account.
745
+ *
746
+ * You can use the {@link https://docs.pawapay.io/v1/api-reference/toolkit/predict-correspondent | predict correspondent} enpoint to predict the correct correspondent to use based on the phone number (MSISDN).
747
+ *
748
+ * @example
749
+ * Example: "AIRTEL_MWI"
750
+ */
751
+ correspondent: string;
752
+ /**
753
+ * @description The phone number (MSISDN) of the recipient or payer must be specified as the `value` of the `address`.
754
+ */
755
+ payer: {
756
+ /** @description The type of financial address. At the moment, only MSISDN is supported as the financial address.
757
+ * @example
758
+ * {
759
+ * type: "MSISDN"
760
+ * }
761
+ */
762
+ type: "MSISDN" & string;
763
+ /**
764
+ * @description The phone number (MSISDN) of the payer or recipient.
765
+ *
766
+ * The format is described in {@link https://en.wikipedia.org/wiki/MSISDN | Wikipedia}.
767
+ *
768
+ * MSISDN validation has following rules:
769
+ *
770
+ * - Only digits without whitespaces or any other separators or prefixes like '+'
771
+ * - Should not start with zero.
772
+ * - Country code is mandatory.
773
+ * - Should not exceed or be less than the valid length of specified country.
774
+ * - Valid examples for Malawi: 265999123456
775
+ *
776
+ * Not valid examples for Malawi:
777
+ * +265999123456, +2650999123456, 265 999 123 456, 265-9991-23456, 0265999123456,
778
+ *
779
+ * @example {value: "260763456789"}
780
+ *
781
+ */
782
+ address: {
783
+ value: string;
784
+ };
785
+ };
786
+ /**
787
+ * @description The timestamp of when the deposit was created in the pawaPay platform.
788
+ *
789
+ * Format defined by 'date-time' in RFC3339 section 5.6 from {@link https://tools.ietf.org/html/rfc3339#section-5.6 | IETF}
790
+ *
791
+ * @example Example:"2020-02-21T17:32:28Z"
792
+ */
793
+ customerTimestamp: string;
794
+ /**
795
+ * @description Short description for the transaction.
796
+ *
797
+ * Depending on the specific MMO performing the transaction this message may be visible to the customer in the SMS receipt or within their transaction history.
798
+ *
799
+ * Must be between 4 and 22 alphanumeric characters.
800
+ *
801
+ * Required string length: 4 - 22
802
+ *
803
+ * @example Example: "Note of 4 to 22 chars"
804
+ */
805
+ statementDescription: string;
806
+ /**
807
+ * ISO Date String
808
+ * @example "2020-10-19T11:17:01Z"
809
+ */
810
+ created: string;
811
+ /**
812
+ * @description The metadata that was provided in the original initation request in a JSON object format.
813
+ */
814
+ metadata: {};
815
+ };
816
+ type CompletedStatus = CheckStatusBaseResponse & {
817
+ /**
818
+ * @description The payout request has been successfully processed. This is a Final state.
819
+ */
820
+ status: "COMPLETED";
821
+ /**
822
+ * @description The amount to be collected (deposit) or disbursed (payout or refund).
823
+ *
824
+ * Amount must follow below requirements or the request will be rejected:
825
+ *
826
+ * Between zero and two decimal places can be supplied, depending on what the specific MMO supports. Learn about all MMO supported decimal places.
827
+ * The minimum and maximum amount depends on the limits of the specific MMO. You can find them from the Active Configuration endpoint.
828
+ * Leading zeroes are not permitted except where the value is less than 1. For any value less than one, one and only one leading zero must be supplied.
829
+ * Trailing zeroes are permitted.
830
+ *
831
+ * Valid examples:
832
+ * 5, 5.0, 5.00, 5.5, 5.55, 5555555, 0.5
833
+ *
834
+ * Not valid examples:
835
+ *
836
+ * 5., 5.555, 5555555555555555555, .5, -5.5, 00.5, 00.00, 00001.32
837
+ *
838
+ * Required string length: 1 - 23
839
+ *
840
+ * @example depositedAmount: "15"
841
+ */
842
+ depositedAmount: string;
843
+ /**
844
+ * When the MMO responded to this deposit request. Format defined by 'date-time' in RFC3339 section 5.6 from IETF
845
+ *
846
+ * @example
847
+ * respondedByPayer: "2020-02-21T17:32:30Z"
848
+ */
849
+ respondedByPayer: string;
850
+ /**
851
+ * @description The unique ID for this financial transaction assigned by the MMO.
852
+ * @example
853
+ * {
854
+ "MTN_INIT": "ABC123",
855
+ "MTN_FINAL": "DEF456"
856
+ }
857
+ */
858
+ correspondentIds: {
859
+ [key: string]: string;
860
+ };
861
+ };
862
+ type AcceptedStatus = CheckStatusBaseResponse & {
863
+ /**
864
+ * @description The payout request has been accepted by pawaPay for processing.
865
+ */
866
+ status: "ACCEPTED";
867
+ };
868
+ type EnqueuedStatus = CheckStatusBaseResponse & {
869
+ /**
870
+ * @description The payout request has been accepted, but has been enqueued for processing later. Read more about {@link https://docs.pawapay.io/payouts#enqueued-payouts | enqueued payouts}.
871
+ */
872
+ status: "ENQUEUED";
873
+ };
874
+ type SubmittedStatus = CheckStatusBaseResponse & {
875
+ /**
876
+ * @description The payout request has been submitted to the MMO and is being processed.
877
+ */
878
+ status: "SUBMITTED";
879
+ };
880
+ type FailedStatus = CheckStatusBaseResponse & {
881
+ /**
882
+ * @description The payout request has been processed, but failed. Final state.
883
+ */
884
+ status: "FAILED";
885
+ failureReason: {
886
+ /**
887
+ * @description Possible deposit failure codes:
888
+ *
889
+ * - PAYER_NOT_FOUND - The phone number specified as the Payer does not belong to the MMO specified as the correspondent.
890
+ * - PAYMENT_NOT_APPROVED - Payer did not approve the payment.
891
+ * - PAYER_LIMIT_REACHED - Payer has reached a transaction limit of their mobile money wallet.
892
+ * - INSUFFICIENT_BALANCE - Payer does not have enough funds.
893
+ * - TRANSACTION_ALREADY_IN_PROCESS - Payer already has an unfinalized transaction being processed by the MMO.
894
+ * - OTHER_ERROR - Any other error. Please refer to failureMessage.
895
+ *
896
+ * @example failureCode: "OTHER_ERROR"
897
+ */
898
+ failureCode: "PAYER_NOT_FOUND" | "PAYMENT_NOT_APPROVED" | "PAYER_LIMIT_REACHED" | "INSUFFICIENT_BALANCE" | "TRANSACTION_ALREADY_IN_PROCESS" | "OTHER_ERROR";
899
+ /**
900
+ * @description Additional optional failure message
901
+ * @example failureMessage: "Recipient's address is blocked"
902
+ */
903
+ failureMessage: string;
904
+ };
905
+ };
906
+ type DepositStatus = CompletedStatus | AcceptedStatus | EnqueuedStatus | SubmittedStatus | FailedStatus;
907
+ type ResendDepositBase = {
908
+ /**
909
+ * @description A UUIDv4 based ID specified by you, that uniquely identifies the deposit.
910
+ *
911
+ * Required string length: 36
912
+ *
913
+ * @example depositId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
914
+ */
915
+ despositId: string;
916
+ };
917
+ type ResendDepositAccepted = ResendDepositBase & {
918
+ /**
919
+ *@description The manual action request has been accepted by pawaPay for processing. */
920
+ status: "ACCEPTED";
921
+ };
922
+ type ResendDepositRejected = ResendDepositBase & {
923
+ /**
924
+ *@description The manual action request has been rejected by pawaPay. See rejectionReason for details. */
925
+ status: "REJECTED";
926
+ /**
927
+ * @description Human-readable explanation why request has been rejected
928
+ * @example rejectionReason:"Deposit with ID \\#f4401bd2-1568-4140-bf2d-eb77d2b2b639 not found"
929
+ */
930
+ rejectionReason: string;
931
+ };
932
+ type ResendDepositFailed = ResendDepositBase & {
933
+ /**
934
+ *@description The manual action request has failed during submitting for processing due to internal reasons. */
935
+ status: "FAILED";
936
+ };
937
+ type ResendDepositResponse = ResendDepositAccepted | ResendDepositRejected | ResendDepositFailed;
938
+ type AcceptedRefund = {
939
+ /**
940
+ * @description The refundId of the deposit transaction.
941
+ *
942
+ * Required string length: 36
943
+ * @example depositId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
944
+ */
945
+ refundId: string;
946
+ /**
947
+ * @description The refund request has been accepted by pawaPay for processing.
948
+ */
949
+ status: "ACCEPTED";
950
+ /**
951
+ * ISO Date String
952
+ * @example "2020-10-19T11:17:01Z"
953
+ */
954
+ created: string;
955
+ };
956
+ type DuplicatedIgnoredRefund = {
957
+ /**
958
+ * @description The refundId of the deposit transaction.
959
+ *
960
+ * Required string length: 36
961
+ * @example depositId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
962
+ */
963
+ depositId: string;
964
+ /**
965
+ * @description The refund request has been ignored as a duplicate of an already accepted refund request. Duplication logic relies upon refundId.
966
+ */
967
+ status: "DUPLICATE_IGNORED";
968
+ /**
969
+ * ISO Date String
970
+ * @example "2020-10-19T11:17:01Z"
971
+ */
972
+ created: string;
973
+ };
974
+ type RejectedRefund = {
975
+ /**
976
+ * @description The refundId of the deposit transaction.
977
+ *
978
+ * Required string length: 36
979
+ * @example depositId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
980
+ */
981
+ refundId: string;
982
+ /**
983
+ * @description The refund request has been rejected by pawaPay. See rejectionReason for details.
984
+ */
985
+ status: "REJECTED";
986
+ rejectionReason: {
987
+ /**
988
+ * @description Possible deposit rejection codes:
989
+ *
990
+ * - DEPOSIT_NOT_FOUND- Requested deposit for refund has not been found.
991
+ * - DEPOSIT_NOT_COMPLETED- Requested deposit was not completed.
992
+ * - ALREADY_REFUNDED- Requested deposit has been already refunded.
993
+ * - IN_PROGRESS- Another refund transaction is already in progress.
994
+ * - INVALID_AMOUNT- The specified amount is not supported.
995
+ * - AMOUNT_TOO_SMALL - The specified amount is smaller than the minimum allowed by the MMO specified as the correspondent.
996
+ * - AMOUNT_TOO_LARGE - The specified amount is larger than the maximum allowed by the MMO specified as the correspondent.
997
+ * - INVALID_CURRENCY - The specified currency is not supported by the MMO specified as the correspondent.
998
+ * - INVALID_COUNTRY - The specified country is not supported for the MMO specified as the correspondent.
999
+ * - PARAMETER_INVALID - One or more parameters are invalid.
1000
+ * - INVALID_INPUT - We were unable to parse the payload of the request.
1001
+ * - REFUNDS_NOT_ALLOWED - Refunds are not allowed for this merchant or the MMO specified as the correspondent.
1002
+ * - CORRESPONDENT_TEMPORARILY_UNAVAILABLE - The MMO specified as the correspondent is currently experiencing an outage and processing of payments has been temporarily halted.
1003
+ *
1004
+ * Please refer to our {@link https://status.pawapay.io/ | Status Page} for live information about MMO availability.
1005
+ *
1006
+ * @example rejectionCode: "INVALID_AMOUNT"
1007
+ *
1008
+ */
1009
+ rejectionCode: "DEPOSIT_NOT_FOUND" | "DEPOSIT_NOT_COMPLETED" | "ALREADY_REFUNDED" | "IN_PROGRESS" | "INVALID_AMOUNT" | "AMOUNT_TOO_SMALL" | "AMOUNT_TOO_LARGE" | "PARAMETER_INVALID" | "INVALID_INPUT" | "REFUNDS_NOT_ALLOWED" | "CORRESPONDENT_TEMPORARILY_UNAVAILABLE";
1010
+ /**
1011
+ * Additional optional rejection message
1012
+ * @example rejectionMessage: "You don't have access to this correspondent"
1013
+ */
1014
+ rejectionMessage: string;
1015
+ };
1016
+ };
1017
+ type RequestRefundResponse = AcceptedRefund | RejectedRefund | DuplicatedIgnoredRefund;
1018
+ type ResendRefundBase = {
1019
+ /**
1020
+ * @description The refundId of the refund transaction.
1021
+ *
1022
+ * Required string length: 36
1023
+ *
1024
+ * @example refundId: "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
1025
+ */
1026
+ refundId: string;
1027
+ };
1028
+ type ResendRefundAccepted = ResendRefundBase & {
1029
+ /**
1030
+ *@description The manual action request has been accepted by pawaPay for processing. */
1031
+ status: "ACCEPTED";
1032
+ };
1033
+ type ResendRefundRejected = ResendRefundBase & {
1034
+ /**
1035
+ *@description The manual action request has been rejected by pawaPay. See rejectionReason for details. */
1036
+ status: "REJECTED";
1037
+ /**
1038
+ * @description Human-readable explanation why request has been rejected
1039
+ * @example rejectionReason:"Refund with ID \\#f4401bd2-1568-4140-bf2d-eb77d2b2b639 not found"
1040
+ */
1041
+ rejectionReason: string;
1042
+ };
1043
+ type ResendRefundFailed = ResendRefundBase & {
1044
+ /**
1045
+ *@description The manual action request has failed during submitting for processing due to internal reasons. */
1046
+ status: "FAILED";
1047
+ };
1048
+ type ResendRefundCallbackResponse = ResendRefundAccepted | ResendRefundRejected | ResendRefundFailed;
1049
+ type CheckRefundStatusBase = {
1050
+ refundId: string;
1051
+ status: string;
1052
+ amount: string;
1053
+ currency: string;
1054
+ country: string;
1055
+ correspondent: string;
1056
+ recipient: {
1057
+ type: string;
1058
+ address: {
1059
+ value: string;
1060
+ };
1061
+ };
1062
+ customerTimestamp: string;
1063
+ statementDescription: string;
1064
+ created: string;
1065
+ metadata: {};
1066
+ };
1067
+ type CheckRefundStatusCompleted = CheckRefundStatusBase & {
1068
+ status: "COMPLETED";
1069
+ receivedByRecipient: string;
1070
+ correspondentIds: {};
1071
+ };
1072
+ type CheckRefundStatusAccepted = CheckRefundStatusBase & {
1073
+ status: "ACCEPTED";
1074
+ };
1075
+ type CheckRefundStatusSubmitted = CheckRefundStatusBase & {
1076
+ status: "SUBMITTED";
1077
+ };
1078
+ type CheckRefundStatusFailed = CheckRefundStatusBase & {
1079
+ status: "FAILED";
1080
+ failureReason: {
1081
+ failureCode: string;
1082
+ failureMessage: string;
1083
+ };
1084
+ };
1085
+ type CheckRefundStatusResponse = CheckRefundStatusCompleted | CheckRefundStatusAccepted | CheckRefundStatusSubmitted | CheckRefundStatusFailed;
1086
+ type RefundCallback = {
1087
+ refundId: string;
1088
+ status: string;
1089
+ amount: string;
1090
+ currency: string;
1091
+ country: string;
1092
+ correspondent: string;
1093
+ recipient: {
1094
+ type: string;
1095
+ address: {
1096
+ value: string;
1097
+ };
1098
+ };
1099
+ customerTimestamp: string;
1100
+ statementDescription: string;
1101
+ created: string;
1102
+ receivedByRecipient: string;
1103
+ correspondentIds: {};
1104
+ failureReason: {
1105
+ failureCode: string;
1106
+ failureMessage: string;
1107
+ };
1108
+ metadata: {};
1109
+ };
1110
+ type WalletBalance = {
1111
+ balances: {
1112
+ /**
1113
+ * @description The country in which the MMO operates.
1114
+ *
1115
+ * Format is ISO 3166-1 alpha-3, three character country code in upper case. Read more from {@link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements | Wikipedia}.
1116
+ *
1117
+ * @example Example: "MWI"
1118
+ */
1119
+ country: string;
1120
+ /**
1121
+ * @description The current balance of the wallet.
1122
+ *
1123
+ * @example balance: "1000.0"
1124
+ */
1125
+ balance: string;
1126
+ /**
1127
+ * @description The currency in which the amount is specified.
1128
+ *
1129
+ * Format must be the ISO 4217 three character currency code in upper case. Read more from {@link https://en.wikipedia.org/wiki/ISO_4217#Active_codes |Wikipedia}.
1130
+ *
1131
+ * You can find all the supported currencies that the specific correspondent supports {@link https://docs.pawapay.io/using_the_api#correspondents | from here}.
1132
+ *
1133
+ * The {@link https://docs.pawapay.io/v1/api-reference/toolkit/active-configuration | active configuration} endpoint provides the list of correspondents configured for your account together with the currencies.
1134
+ *
1135
+ * @example Example: "MWK"
1136
+ */
1137
+ currency: string;
1138
+ /**
1139
+ * @example If you are using a wallet that is only used by a single MMO, that MMO-s correspondent code will be shown here.
1140
+ *
1141
+ * @example mno: "AIRTEL_MWI"
1142
+ */
1143
+ mno: string;
1144
+ }[];
1145
+ };
1146
+ type OperationalType = {
1147
+ operationType: string;
1148
+ minTransactionLimit: string;
1149
+ maxTransactionLimit: string;
1150
+ };
1151
+ type Correspondent = {
1152
+ correspondent: string;
1153
+ currency: string;
1154
+ ownerName: string;
1155
+ operationTypes: Array<OperationalType>;
1156
+ };
1157
+ interface Countries<T> {
1158
+ country: string;
1159
+ correspondents: Array<T>;
1160
+ }
1161
+ type ActiveConfigurationResponse = {
1162
+ merchantId: string;
1163
+ merchantName: string;
1164
+ countries: Array<Countries<Correspondent>>;
1165
+ };
1166
+ type CorrespondentOperationalType = {
1167
+ operationType: "DEPOSIT" | "PAYOUT";
1168
+ status: "OPERATIONAL" | "DELAYED" | "CLOSED";
1169
+ };
1170
+ type CorrespondentData = {
1171
+ correspondent: string;
1172
+ operationaType: Array<CorrespondentOperationalType>;
1173
+ };
1174
+ interface AvailableCorrespondentResponse extends Countries<CorrespondentData> {
1175
+ }
1176
+ interface PredictCorrespondentResponse {
1177
+ country: string;
1178
+ operator: string;
1179
+ correspondent: string;
1180
+ msisdn: string;
1181
+ }
1182
+ type PublicKeysResponse = {
1183
+ /**
1184
+ * @description The ID of the public key. */
1185
+ id: string;
1186
+ /**
1187
+ * @description The public key to use when verifying the signature in a callback sent by pawaPay. */
1188
+ key: string;
1189
+ };
1190
+
1191
+ type ClientConfig = {
1192
+ environment?: "live" | "sandbox";
1193
+ overrideUrl?: string;
1194
+ };
1195
+ declare class PawaPayClient {
1196
+ private apiClient;
1197
+ protected apiKey: string;
1198
+ private config?;
1199
+ constructor(apiKey: string, config?: ClientConfig);
1200
+ private request;
1201
+ requestDeposit(data: DepositConfig, { options }?: {
1202
+ options?: RequestOptions;
1203
+ }): Promise<PawaPayResponse<DepositResponse, PawaPayError>>;
1204
+ checkDepositStatus(depositId: string, { options }?: {
1205
+ options?: RequestOptions;
1206
+ }): Promise<PawaPayResponse<DepositStatus[], PawaPayError>>;
1207
+ resendDepositCallback(depositId: string, { options }?: {
1208
+ options?: RequestOptions;
1209
+ }): Promise<PawaPayResponse<ResendDepositResponse, PawaPayError>>;
1210
+ requestPayout(data: RequestPayoutConfig, { options }?: {
1211
+ options?: RequestOptions;
1212
+ }): Promise<PawaPayResponse<RequestPayoutRespose, PawaPayError>>;
1213
+ checkPayoutStatus(payoutId: string, { options }?: {
1214
+ options?: RequestOptions;
1215
+ }): Promise<PawaPayResponse<CheckPayoutStatusResponse[], PawaPayError>>;
1216
+ resendPayoutCallback(payoutId: string, { options }?: {
1217
+ options?: RequestOptions;
1218
+ }): Promise<PawaPayResponse<ResendPayoutCallbackResponse, PawaPayError>>;
1219
+ cancelEnqueuedPayout(payoutId: string, { options }?: {
1220
+ options?: RequestOptions;
1221
+ }): Promise<PawaPayResponse<CancelEnqueuedPayoutResponse, PawaPayError>>;
1222
+ requestBulkPayout(data: RequestBulkPayoutConfig[], { options }?: {
1223
+ options?: RequestOptions;
1224
+ }): Promise<PawaPayResponse<RequestBuildPayoutResponse[], PawaPayError>>;
1225
+ requestRefund(refundConfig: RequestRefundConfig, { options }?: {
1226
+ options?: RequestOptions;
1227
+ }): Promise<PawaPayResponse<RequestRefundResponse, PawaPayError>>;
1228
+ checkRefundStatus(refundId: string, { options }?: {
1229
+ options?: RequestOptions;
1230
+ }): Promise<PawaPayResponse<CheckRefundStatusResponse[], PawaPayError>>;
1231
+ resendRefundCallback(refundId: string, { options }?: {
1232
+ options?: RequestOptions;
1233
+ }): Promise<PawaPayResponse<ResendRefundCallbackResponse, PawaPayError>>;
1234
+ requestPaymentPage(payload: RequestPayPageConfig, { options }?: {
1235
+ options?: RequestOptions;
1236
+ }): Promise<PawaPayResponse<RequestPayPageResponse, PawaPayError>>;
1237
+ checkWalletBalances({ options }?: {
1238
+ options?: RequestOptions;
1239
+ }): Promise<PawaPayResponse<WalletBalance, PawaPayError>>;
1240
+ checkWalletBalancesByCountry(country: string, { options }?: {
1241
+ options?: RequestOptions;
1242
+ }): Promise<PawaPayResponse<WalletBalance, PawaPayError>>;
1243
+ getActiveConfiguration({ options }?: {
1244
+ options?: RequestOptions;
1245
+ }): Promise<PawaPayResponse<ActiveConfigurationResponse, PawaPayError>>;
1246
+ getAvailableCorrespondent({ options }?: {
1247
+ options?: RequestOptions;
1248
+ }): Promise<PawaPayResponse<AvailableCorrespondentResponse[], PawaPayError>>;
1249
+ redictCorrespondent(msisdn: string, { options }?: {
1250
+ options?: RequestOptions;
1251
+ }): Promise<PawaPayResponse<PredictCorrespondentResponse, PawaPayError>>;
1252
+ getPublicKey({ options }?: {
1253
+ options?: RequestOptions;
1254
+ }): Promise<PawaPayResponse<PublicKeysResponse[], PawaPayError>>;
1255
+ }
1256
+
1257
+ export { type ActiveConfigurationResponse, type AvailableCorrespondentResponse, type CancelEnqueuedPayoutResponse, type CheckPayoutStatusResponse, type CheckRefundStatusResponse, type DepositConfig, type DepositResponse, type DepositStatus, PawaPayClient, type PawaPayError, type PawaPayResponse, type PayoutCallback, type PredictCorrespondentResponse, type PublicKeysResponse, type RefundCallback, type RequestBuildPayoutResponse, type RequestBulkPayoutConfig, type RequestOptions, type RequestPayPageConfig, type RequestPayPageResponse, type RequestPayoutConfig, type RequestPayoutRespose, type RequestRefundConfig, type RequestRefundResponse, type ResendDepositResponse, type ResendPayoutCallbackResponse, type ResendRefundCallbackResponse, type WalletBalance };