Compare commits
6 Commits
4c80606b56
...
582f349be3
| Author | SHA1 | Date | |
|---|---|---|---|
| 582f349be3 | |||
| 8ce17a8d1e | |||
| 4092437d21 | |||
| 37f4b60679 | |||
| 878b5d0aa5 | |||
| d2b934feda |
@ -335,8 +335,8 @@ func (h *MenuHandlers) MaxAmount(ctx context.Context, sym string, input []byte)
|
|||||||
// Format the active balance amount to 2 decimal places
|
// Format the active balance amount to 2 decimal places
|
||||||
formattedBalance, _ := store.TruncateDecimalString(string(activeBal), 2)
|
formattedBalance, _ := store.TruncateDecimalString(string(activeBal), 2)
|
||||||
|
|
||||||
// If normal transaction, return balance
|
// If normal transaction, or if the sym is max_amount, return balance
|
||||||
if string(transactionType) == "normal" {
|
if string(transactionType) == "normal" || sym == "max_amount" {
|
||||||
res.FlagReset = append(res.FlagReset, flag_swap_transaction)
|
res.FlagReset = append(res.FlagReset, flag_swap_transaction)
|
||||||
|
|
||||||
res.Content = l.Get("Maximum amount: %s %s\nEnter amount:", formattedBalance, string(activeSym))
|
res.Content = l.Get("Maximum amount: %s %s\nEnter amount:", formattedBalance, string(activeSym))
|
||||||
|
|||||||
@ -86,6 +86,7 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService)
|
|||||||
ls.DbRs.AddLocalFunc("transaction_reset", appHandlers.TransactionReset)
|
ls.DbRs.AddLocalFunc("transaction_reset", appHandlers.TransactionReset)
|
||||||
ls.DbRs.AddLocalFunc("invite_valid_recipient", appHandlers.InviteValidRecipient)
|
ls.DbRs.AddLocalFunc("invite_valid_recipient", appHandlers.InviteValidRecipient)
|
||||||
ls.DbRs.AddLocalFunc("max_amount", appHandlers.MaxAmount)
|
ls.DbRs.AddLocalFunc("max_amount", appHandlers.MaxAmount)
|
||||||
|
ls.DbRs.AddLocalFunc("credit_max_amount", appHandlers.MaxAmount)
|
||||||
ls.DbRs.AddLocalFunc("validate_amount", appHandlers.ValidateAmount)
|
ls.DbRs.AddLocalFunc("validate_amount", appHandlers.ValidateAmount)
|
||||||
ls.DbRs.AddLocalFunc("reset_transaction_amount", appHandlers.ResetTransactionAmount)
|
ls.DbRs.AddLocalFunc("reset_transaction_amount", appHandlers.ResetTransactionAmount)
|
||||||
ls.DbRs.AddLocalFunc("get_recipient", appHandlers.GetRecipient)
|
ls.DbRs.AddLocalFunc("get_recipient", appHandlers.GetRecipient)
|
||||||
|
|||||||
@ -4,9 +4,6 @@ RELOAD max_amount
|
|||||||
MAP max_amount
|
MAP max_amount
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
HALT
|
HALT
|
||||||
LOAD clear_trans_type_flag 6
|
|
||||||
RELOAD clear_trans_type_flag
|
|
||||||
CATCH transaction_swap flag_swap_transaction 1
|
|
||||||
LOAD validate_amount 64
|
LOAD validate_amount 64
|
||||||
RELOAD validate_amount
|
RELOAD validate_amount
|
||||||
CATCH api_failure flag_api_call_error 1
|
CATCH api_failure flag_api_call_error 1
|
||||||
|
|||||||
1
services/registration/credit_amount
Normal file
1
services/registration/credit_amount
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{.credit_max_amount}}
|
||||||
18
services/registration/credit_amount.vis
Normal file
18
services/registration/credit_amount.vis
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
LOAD reset_transaction_amount 10
|
||||||
|
LOAD credit_max_amount 160
|
||||||
|
RELOAD credit_max_amount
|
||||||
|
MAP credit_max_amount
|
||||||
|
MOUT back 0
|
||||||
|
HALT
|
||||||
|
LOAD clear_trans_type_flag 6
|
||||||
|
RELOAD clear_trans_type_flag
|
||||||
|
CATCH transaction_swap flag_swap_transaction 1
|
||||||
|
LOAD validate_amount 64
|
||||||
|
RELOAD validate_amount
|
||||||
|
CATCH api_failure flag_api_call_error 1
|
||||||
|
CATCH invalid_amount flag_invalid_amount 1
|
||||||
|
INCMP _ 0
|
||||||
|
LOAD get_recipient 0
|
||||||
|
LOAD get_sender 64
|
||||||
|
LOAD get_amount 32
|
||||||
|
INCMP transaction_pin *
|
||||||
1
services/registration/credit_amount_swa
Normal file
1
services/registration/credit_amount_swa
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{.credit_max_amount}}
|
||||||
1
services/registration/credit_send
Normal file
1
services/registration/credit_send
Normal file
@ -0,0 +1 @@
|
|||||||
|
Enter recipient's phone number/address/alias:
|
||||||
12
services/registration/credit_send.vis
Normal file
12
services/registration/credit_send.vis
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
LOAD transaction_reset 0
|
||||||
|
RELOAD transaction_reset
|
||||||
|
CATCH no_voucher flag_no_active_voucher 1
|
||||||
|
MOUT back 0
|
||||||
|
HALT
|
||||||
|
LOAD validate_recipient 50
|
||||||
|
RELOAD validate_recipient
|
||||||
|
CATCH api_failure flag_api_call_error 1
|
||||||
|
CATCH invalid_recipient flag_invalid_recipient 1
|
||||||
|
CATCH invite_recipient flag_invalid_recipient_with_invite 1
|
||||||
|
INCMP _ 0
|
||||||
|
INCMP credit_amount *
|
||||||
1
services/registration/credit_send_menu
Normal file
1
services/registration/credit_send_menu
Normal file
@ -0,0 +1 @@
|
|||||||
|
Credit-Send
|
||||||
1
services/registration/credit_send_menu_swa
Normal file
1
services/registration/credit_send_menu_swa
Normal file
@ -0,0 +1 @@
|
|||||||
|
Tuma-Mkopo
|
||||||
1
services/registration/credit_send_swa
Normal file
1
services/registration/credit_send_swa
Normal file
@ -0,0 +1 @@
|
|||||||
|
Weka nambari ya simu/anwani/lakabu:
|
||||||
@ -7,18 +7,20 @@ LOAD check_balance 128
|
|||||||
RELOAD check_balance
|
RELOAD check_balance
|
||||||
MAP check_balance
|
MAP check_balance
|
||||||
MOUT send 1
|
MOUT send 1
|
||||||
MOUT swap 2
|
MOUT credit_send 2
|
||||||
MOUT vouchers 3
|
MOUT swap 3
|
||||||
MOUT select_pool 4
|
MOUT vouchers 4
|
||||||
MOUT account 5
|
MOUT select_pool 5
|
||||||
MOUT help 6
|
MOUT account 6
|
||||||
|
MOUT help 7
|
||||||
MOUT quit 9
|
MOUT quit 9
|
||||||
HALT
|
HALT
|
||||||
INCMP send 1
|
INCMP send 1
|
||||||
INCMP swap_to_list 2
|
INCMP credit_send 2
|
||||||
INCMP my_vouchers 3
|
INCMP swap_to_list 3
|
||||||
INCMP select_pool 4
|
INCMP my_vouchers 4
|
||||||
INCMP my_account 5
|
INCMP select_pool 5
|
||||||
INCMP help 6
|
INCMP my_account 6
|
||||||
|
INCMP help 7
|
||||||
INCMP quit 9
|
INCMP quit 9
|
||||||
INCMP . *
|
INCMP . *
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Weka nambari ya simu:
|
Weka nambari ya simu/Anwani/Lakabu:
|
||||||
Loading…
Reference in New Issue
Block a user