Skip to content

Commit

Permalink
Merge pull request #3 from Elshaden/elshaden
Browse files Browse the repository at this point in the history
Fix Force close a completed Payment,
  • Loading branch information
alifaraun authored Sep 16, 2024
2 parents e31465e + 80bb826 commit 94603d4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/views/pay.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class MoamalataPay {
this.amount = amount;
this.merchantReference = merchantReference;
this.debug = debug;
this.isCompleteCalled = false
}
log(data) {
Expand Down Expand Up @@ -68,6 +69,7 @@ class MoamalataPay {
TrxDateTime: secureHashResponse.DateTimeLocalTrxn,
SecureHash: secureHashResponse.secureHash,
completeCallback: function(data) {
this.isCompleteCalled = true;
window.dispatchEvent(
new CustomEvent('moamalatCompleted', {
detail: data
Expand All @@ -91,9 +93,11 @@ class MoamalataPay {
});
},
cancelCallback: function() {
window.dispatchEvent(
new CustomEvent('moamalatCancel')
)
if (!this.isCompleteCalled) {
window.dispatchEvent(
new CustomEvent('moamalatCancel')
)
}
parent_.log({
"status": "canceled"
});
Expand Down

0 comments on commit 94603d4

Please sign in to comment.