From bfef77e20eca9570d287c366231234abd32fe45b Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Fri, 20 Feb 2026 09:41:03 +0300 Subject: [PATCH] add a CATCH for low amounts and API errors --- services/registration/get_mpesa.vis | 5 ++++- services/registration/low_withdraw_mpesa_amount | 1 + services/registration/low_withdraw_mpesa_amount.vis | 6 ++++++ services/registration/low_withdraw_mpesa_amount_swa | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 services/registration/low_withdraw_mpesa_amount create mode 100644 services/registration/low_withdraw_mpesa_amount.vis create mode 100644 services/registration/low_withdraw_mpesa_amount_swa diff --git a/services/registration/get_mpesa.vis b/services/registration/get_mpesa.vis index f9a9b42..2e595e4 100644 --- a/services/registration/get_mpesa.vis +++ b/services/registration/get_mpesa.vis @@ -10,6 +10,9 @@ INCMP > 88 INCMP < 98 INCMP _ 0 INCMP quit 99 -LOAD get_mpesa_max_limit 0 +LOAD get_mpesa_max_limit 89 RELOAD get_mpesa_max_limit +CATCH . flag_incorrect_voucher 1 +CATCH low_withdraw_mpesa_amount flag_low_swap_amount 1 +CATCH low_withdraw_mpesa_amount flag_api_call_error 1 INCMP mpesa_max_limit * diff --git a/services/registration/low_withdraw_mpesa_amount b/services/registration/low_withdraw_mpesa_amount new file mode 100644 index 0000000..6837aab --- /dev/null +++ b/services/registration/low_withdraw_mpesa_amount @@ -0,0 +1 @@ +Available amount {{.get_mpesa_max_limit}} is too low, please choose a different voucher: \ No newline at end of file diff --git a/services/registration/low_withdraw_mpesa_amount.vis b/services/registration/low_withdraw_mpesa_amount.vis new file mode 100644 index 0000000..d9cd485 --- /dev/null +++ b/services/registration/low_withdraw_mpesa_amount.vis @@ -0,0 +1,6 @@ +MAP get_mpesa_max_limit +MOUT back 0 +MOUT quit 9 +HALT +INCMP _ 0 +INCMP quit 9 diff --git a/services/registration/low_withdraw_mpesa_amount_swa b/services/registration/low_withdraw_mpesa_amount_swa new file mode 100644 index 0000000..4de665d --- /dev/null +++ b/services/registration/low_withdraw_mpesa_amount_swa @@ -0,0 +1 @@ +Kiasi kinachopatikana {{.get_mpesa_max_limit}} ni cha chini sana, tafadhali chagua sarafu tofauti: \ No newline at end of file