From 9646cc29557aaa4800039725f1d27a4f5a4c2d6c Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Fri, 20 Feb 2026 09:48:10 +0300 Subject: [PATCH] add a CATCH when one cannot swap from the current pool --- handlers/application/mpesa.go | 5 ++++- services/registration/get_mpesa.vis | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/handlers/application/mpesa.go b/handlers/application/mpesa.go index a4ac4a7..a497d65 100644 --- a/handlers/application/mpesa.go +++ b/handlers/application/mpesa.go @@ -36,7 +36,7 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [ inputStr := string(input) if inputStr == "0" || inputStr == "99" || inputStr == "88" || inputStr == "98" { - res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error, flag_incorrect_voucher) + res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error, flag_incorrect_voucher, flag_incorrect_pool) return res, nil } @@ -142,6 +142,7 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [ if !canSwap.CanSwapFrom { // pool issue (CATCH on .vis) res.FlagSet = append(res.FlagSet, flag_incorrect_pool) + res.Content = "0" return res, nil } @@ -199,6 +200,8 @@ func (h *MenuHandlers) GetMpesaMaxLimit(ctx context.Context, sym string, input [ maxKshFormatted, ) + res.FlagReset = append(res.FlagReset, flag_low_swap_amount, flag_api_call_error, flag_incorrect_voucher, flag_incorrect_pool) + return res, nil } diff --git a/services/registration/get_mpesa.vis b/services/registration/get_mpesa.vis index 2e595e4..a30204d 100644 --- a/services/registration/get_mpesa.vis +++ b/services/registration/get_mpesa.vis @@ -13,6 +13,7 @@ INCMP quit 99 LOAD get_mpesa_max_limit 89 RELOAD get_mpesa_max_limit CATCH . flag_incorrect_voucher 1 +CATCH low_withdraw_mpesa_amount flag_incorrect_pool 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 *