@singularity-payments/core 1.3.1 → 1.3.3
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/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +19 -4
- package/dist/index.mjs +19 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -318,6 +318,13 @@ interface CallbackHandlerOptions {
|
|
|
318
318
|
isSuccess: boolean;
|
|
319
319
|
transactionId?: string;
|
|
320
320
|
amount?: number;
|
|
321
|
+
conversationId?: string;
|
|
322
|
+
originatorConversationId?: string;
|
|
323
|
+
debitAccountBalance?: string;
|
|
324
|
+
debitPartyAffectedAccountBalance?: string;
|
|
325
|
+
transactionCompletedTime?: string;
|
|
326
|
+
receiverPartyPublicName?: string;
|
|
327
|
+
currency?: string;
|
|
321
328
|
errorMessage?: string;
|
|
322
329
|
}) => void | Promise<void>;
|
|
323
330
|
onAccountBalanceResult?: (data: {
|
|
@@ -416,6 +423,13 @@ declare class MpesaCallbackHandler {
|
|
|
416
423
|
isSuccess: boolean;
|
|
417
424
|
transactionId?: string;
|
|
418
425
|
amount?: number;
|
|
426
|
+
conversationId?: string;
|
|
427
|
+
originatorConversationId?: string;
|
|
428
|
+
debitAccountBalance?: string;
|
|
429
|
+
debitPartyAffectedAccountBalance?: string;
|
|
430
|
+
transactionCompletedTime?: string;
|
|
431
|
+
receiverPartyPublicName?: string;
|
|
432
|
+
currency?: string;
|
|
419
433
|
errorMessage?: string;
|
|
420
434
|
};
|
|
421
435
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -318,6 +318,13 @@ interface CallbackHandlerOptions {
|
|
|
318
318
|
isSuccess: boolean;
|
|
319
319
|
transactionId?: string;
|
|
320
320
|
amount?: number;
|
|
321
|
+
conversationId?: string;
|
|
322
|
+
originatorConversationId?: string;
|
|
323
|
+
debitAccountBalance?: string;
|
|
324
|
+
debitPartyAffectedAccountBalance?: string;
|
|
325
|
+
transactionCompletedTime?: string;
|
|
326
|
+
receiverPartyPublicName?: string;
|
|
327
|
+
currency?: string;
|
|
321
328
|
errorMessage?: string;
|
|
322
329
|
}) => void | Promise<void>;
|
|
323
330
|
onAccountBalanceResult?: (data: {
|
|
@@ -416,6 +423,13 @@ declare class MpesaCallbackHandler {
|
|
|
416
423
|
isSuccess: boolean;
|
|
417
424
|
transactionId?: string;
|
|
418
425
|
amount?: number;
|
|
426
|
+
conversationId?: string;
|
|
427
|
+
originatorConversationId?: string;
|
|
428
|
+
debitAccountBalance?: string;
|
|
429
|
+
debitPartyAffectedAccountBalance?: string;
|
|
430
|
+
transactionCompletedTime?: string;
|
|
431
|
+
receiverPartyPublicName?: string;
|
|
432
|
+
currency?: string;
|
|
419
433
|
errorMessage?: string;
|
|
420
434
|
};
|
|
421
435
|
/**
|
package/dist/index.js
CHANGED
|
@@ -512,17 +512,32 @@ var MpesaCallbackHandler = class {
|
|
|
512
512
|
const result = callback.Result;
|
|
513
513
|
const parsed = {
|
|
514
514
|
isSuccess: result.ResultCode === 0,
|
|
515
|
+
transactionId: result.TransactionID,
|
|
516
|
+
conversationId: result.ConversationID,
|
|
517
|
+
originatorConversationId: result.OriginatorConversationID,
|
|
515
518
|
errorMessage: result.ResultCode !== 0 ? this.getErrorMessage(result.ResultCode) : void 0
|
|
516
519
|
};
|
|
517
520
|
if (result.ResultCode === 0 && result.ResultParameters) {
|
|
518
521
|
result.ResultParameters.ResultParameter.forEach((param) => {
|
|
519
522
|
switch (param.Key) {
|
|
520
|
-
case "
|
|
521
|
-
parsed.transactionId = String(param.Value);
|
|
522
|
-
break;
|
|
523
|
-
case "TransactionAmount":
|
|
523
|
+
case "Amount":
|
|
524
524
|
parsed.amount = Number(param.Value);
|
|
525
525
|
break;
|
|
526
|
+
case "DebitAccountBalance":
|
|
527
|
+
parsed.debitAccountBalance = String(param.Value);
|
|
528
|
+
break;
|
|
529
|
+
case "DebitPartyAffectedAccountBalance":
|
|
530
|
+
parsed.debitPartyAffectedAccountBalance = String(param.Value);
|
|
531
|
+
break;
|
|
532
|
+
case "TransCompletedTime":
|
|
533
|
+
parsed.transactionCompletedTime = String(param.Value);
|
|
534
|
+
break;
|
|
535
|
+
case "ReceiverPartyPublicName":
|
|
536
|
+
parsed.receiverPartyPublicName = String(param.Value);
|
|
537
|
+
break;
|
|
538
|
+
case "Currency":
|
|
539
|
+
parsed.currency = String(param.Value);
|
|
540
|
+
break;
|
|
526
541
|
}
|
|
527
542
|
});
|
|
528
543
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -463,17 +463,32 @@ var MpesaCallbackHandler = class {
|
|
|
463
463
|
const result = callback.Result;
|
|
464
464
|
const parsed = {
|
|
465
465
|
isSuccess: result.ResultCode === 0,
|
|
466
|
+
transactionId: result.TransactionID,
|
|
467
|
+
conversationId: result.ConversationID,
|
|
468
|
+
originatorConversationId: result.OriginatorConversationID,
|
|
466
469
|
errorMessage: result.ResultCode !== 0 ? this.getErrorMessage(result.ResultCode) : void 0
|
|
467
470
|
};
|
|
468
471
|
if (result.ResultCode === 0 && result.ResultParameters) {
|
|
469
472
|
result.ResultParameters.ResultParameter.forEach((param) => {
|
|
470
473
|
switch (param.Key) {
|
|
471
|
-
case "
|
|
472
|
-
parsed.transactionId = String(param.Value);
|
|
473
|
-
break;
|
|
474
|
-
case "TransactionAmount":
|
|
474
|
+
case "Amount":
|
|
475
475
|
parsed.amount = Number(param.Value);
|
|
476
476
|
break;
|
|
477
|
+
case "DebitAccountBalance":
|
|
478
|
+
parsed.debitAccountBalance = String(param.Value);
|
|
479
|
+
break;
|
|
480
|
+
case "DebitPartyAffectedAccountBalance":
|
|
481
|
+
parsed.debitPartyAffectedAccountBalance = String(param.Value);
|
|
482
|
+
break;
|
|
483
|
+
case "TransCompletedTime":
|
|
484
|
+
parsed.transactionCompletedTime = String(param.Value);
|
|
485
|
+
break;
|
|
486
|
+
case "ReceiverPartyPublicName":
|
|
487
|
+
parsed.receiverPartyPublicName = String(param.Value);
|
|
488
|
+
break;
|
|
489
|
+
case "Currency":
|
|
490
|
+
parsed.currency = String(param.Value);
|
|
491
|
+
break;
|
|
477
492
|
}
|
|
478
493
|
});
|
|
479
494
|
}
|