Compare commits
3 Commits
dc14480519
...
2e7c07e6f4
Author | SHA1 | Date | |
---|---|---|---|
2e7c07e6f4 | |||
01f7571185 | |||
065c8e5c1d |
@ -84,7 +84,7 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
rs.AddLocalFunc("select_language", ussdHandlers.SetLanguage)
|
rs.AddLocalFunc("set_language", ussdHandlers.SetLanguage)
|
||||||
rs.AddLocalFunc("create_account", ussdHandlers.CreateAccount)
|
rs.AddLocalFunc("create_account", ussdHandlers.CreateAccount)
|
||||||
rs.AddLocalFunc("save_pin", ussdHandlers.SavePin)
|
rs.AddLocalFunc("save_pin", ussdHandlers.SavePin)
|
||||||
rs.AddLocalFunc("verify_pin", ussdHandlers.VerifyPin)
|
rs.AddLocalFunc("verify_pin", ussdHandlers.VerifyPin)
|
||||||
@ -116,7 +116,10 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
|
|||||||
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
|
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
|
||||||
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
|
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
|
||||||
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
|
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
|
||||||
rs.AddLocalFunc("set_new_language", ussdHandlers.SetNewLanguage)
|
rs.AddLocalFunc("save_temporary_pin", ussdHandlers.SaveTemporaryPin)
|
||||||
|
rs.AddLocalFunc("verify_new_pin", ussdHandlers.VerifyNewPin)
|
||||||
|
rs.AddLocalFunc("confirm_pin_change", ussdHandlers.ConfirmPinChange)
|
||||||
|
rs.AddLocalFunc("quit_with_help",ussdHandlers.QuitWithHelp)
|
||||||
|
|
||||||
return ussdHandlers, nil
|
return ussdHandlers, nil
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
rs.AddLocalFunc("select_language", ussdHandlers.SetLanguage)
|
rs.AddLocalFunc("set_language", ussdHandlers.SetLanguage)
|
||||||
rs.AddLocalFunc("create_account", ussdHandlers.CreateAccount)
|
rs.AddLocalFunc("create_account", ussdHandlers.CreateAccount)
|
||||||
rs.AddLocalFunc("save_pin", ussdHandlers.SavePin)
|
rs.AddLocalFunc("save_pin", ussdHandlers.SavePin)
|
||||||
rs.AddLocalFunc("verify_pin", ussdHandlers.VerifyPin)
|
rs.AddLocalFunc("verify_pin", ussdHandlers.VerifyPin)
|
||||||
@ -86,7 +86,10 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
|
|||||||
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
|
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
|
||||||
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
|
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
|
||||||
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
|
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
|
||||||
rs.AddLocalFunc("set_new_language", ussdHandlers.SetNewLanguage)
|
rs.AddLocalFunc("save_temporary_pin", ussdHandlers.SaveTemporaryPin)
|
||||||
|
rs.AddLocalFunc("verify_new_pin", ussdHandlers.VerifyNewPin)
|
||||||
|
rs.AddLocalFunc("confirm_pin_change", ussdHandlers.ConfirmPinChange)
|
||||||
|
rs.AddLocalFunc("quit_with_help",ussdHandlers.QuitWithHelp)
|
||||||
|
|
||||||
return ussdHandlers, nil
|
return ussdHandlers, nil
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
rs.AddLocalFunc("select_language", ussdHandlers.SetLanguage)
|
rs.AddLocalFunc("set_language", ussdHandlers.SetLanguage)
|
||||||
rs.AddLocalFunc("create_account", ussdHandlers.CreateAccount)
|
rs.AddLocalFunc("create_account", ussdHandlers.CreateAccount)
|
||||||
rs.AddLocalFunc("save_pin", ussdHandlers.SavePin)
|
rs.AddLocalFunc("save_pin", ussdHandlers.SavePin)
|
||||||
rs.AddLocalFunc("verify_pin", ussdHandlers.VerifyPin)
|
rs.AddLocalFunc("verify_pin", ussdHandlers.VerifyPin)
|
||||||
@ -76,7 +76,10 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, userdataStore
|
|||||||
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
|
rs.AddLocalFunc("reset_incorrect_date_format", ussdHandlers.ResetIncorrectYob)
|
||||||
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
|
rs.AddLocalFunc("set_reset_single_edit", ussdHandlers.SetResetSingleEdit)
|
||||||
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
|
rs.AddLocalFunc("initiate_transaction", ussdHandlers.InitiateTransaction)
|
||||||
rs.AddLocalFunc("set_new_language", ussdHandlers.SetNewLanguage)
|
rs.AddLocalFunc("save_temporary_pin", ussdHandlers.SaveTemporaryPin)
|
||||||
|
rs.AddLocalFunc("verify_new_pin", ussdHandlers.VerifyNewPin)
|
||||||
|
rs.AddLocalFunc("confirm_pin_change", ussdHandlers.ConfirmPinChange)
|
||||||
|
rs.AddLocalFunc("quit_with_help",ussdHandlers.QuitWithHelp)
|
||||||
|
|
||||||
return ussdHandlers, nil
|
return ussdHandlers, nil
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, pe *persist.P
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
ussdHandlers = ussdHandlers.WithPersister(pe)
|
ussdHandlers = ussdHandlers.WithPersister(pe)
|
||||||
rs.AddLocalFunc("select_language", ussdHandlers.SetLanguage)
|
rs.AddLocalFunc("set_language", ussdHandlers.SetLanguage)
|
||||||
rs.AddLocalFunc("create_account", ussdHandlers.CreateAccount)
|
rs.AddLocalFunc("create_account", ussdHandlers.CreateAccount)
|
||||||
rs.AddLocalFunc("save_pin", ussdHandlers.SavePin)
|
rs.AddLocalFunc("save_pin", ussdHandlers.SavePin)
|
||||||
rs.AddLocalFunc("verify_pin", ussdHandlers.VerifyPin)
|
rs.AddLocalFunc("verify_pin", ussdHandlers.VerifyPin)
|
||||||
@ -75,7 +75,6 @@ func getHandler(appFlags *asm.FlagParser, rs *resource.DbResource, pe *persist.P
|
|||||||
rs.AddLocalFunc("verify_new_pin", ussdHandlers.VerifyNewPin)
|
rs.AddLocalFunc("verify_new_pin", ussdHandlers.VerifyNewPin)
|
||||||
rs.AddLocalFunc("confirm_pin_change", ussdHandlers.ConfirmPinChange)
|
rs.AddLocalFunc("confirm_pin_change", ussdHandlers.ConfirmPinChange)
|
||||||
rs.AddLocalFunc("quit_with_help",ussdHandlers.QuitWithHelp)
|
rs.AddLocalFunc("quit_with_help",ussdHandlers.QuitWithHelp)
|
||||||
rs.AddLocalFunc("set_new_language", ussdHandlers.SetNewLanguage)
|
|
||||||
|
|
||||||
return ussdHandlers, nil
|
return ussdHandlers, nil
|
||||||
}
|
}
|
||||||
|
@ -121,15 +121,15 @@ func (h *Handlers) Init(ctx context.Context, sym string, input []byte) (resource
|
|||||||
// SetLanguage sets the language across the menu
|
// SetLanguage sets the language across the menu
|
||||||
func (h *Handlers) SetLanguage(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
func (h *Handlers) SetLanguage(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
var res resource.Result
|
var res resource.Result
|
||||||
var err error
|
|
||||||
|
|
||||||
inputStr := string(input)
|
sym, _ = h.st.Where()
|
||||||
switch inputStr {
|
|
||||||
case "0":
|
switch sym {
|
||||||
res.FlagSet = []uint32{state.FLAG_LANG}
|
case "set_default":
|
||||||
|
res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
|
||||||
res.Content = "eng"
|
res.Content = "eng"
|
||||||
case "1":
|
case "set_swa":
|
||||||
res.FlagSet = []uint32{state.FLAG_LANG}
|
res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
|
||||||
res.Content = "swa"
|
res.Content = "swa"
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
@ -1045,22 +1045,3 @@ func (h *Handlers) GetProfileInfo(ctx context.Context, sym string, input []byte)
|
|||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetNewLanguage sets the new language based on user input
|
|
||||||
func (h *Handlers) SetNewLanguage(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
|
||||||
var res resource.Result
|
|
||||||
|
|
||||||
inputStr := string(input)
|
|
||||||
|
|
||||||
switch inputStr {
|
|
||||||
case "0":
|
|
||||||
res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
|
|
||||||
res.Content = "eng"
|
|
||||||
case "1":
|
|
||||||
res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
|
|
||||||
res.Content = "swa"
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
|
|
||||||
return res, nil
|
|
||||||
}
|
|
||||||
|
@ -5,6 +5,6 @@ CATCH pin_entry flag_account_authorized 0
|
|||||||
MOUT english 0
|
MOUT english 0
|
||||||
MOUT kiswahili 1
|
MOUT kiswahili 1
|
||||||
HALT
|
HALT
|
||||||
INCMP language_changed 0
|
INCMP set_default 0
|
||||||
INCMP language_changed 1
|
INCMP set_swa 1
|
||||||
INCMP . *
|
INCMP . *
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
LOAD set_new_language 6
|
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
MOUT quit 9
|
MOUT quit 9
|
||||||
HALT
|
HALT
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
MOUT english 0
|
MOUT english 0
|
||||||
MOUT kiswahili 1
|
MOUT kiswahili 1
|
||||||
HALT
|
HALT
|
||||||
INCMP terms 0
|
INCMP set_default 0
|
||||||
INCMP terms 1
|
INCMP set_swa 1
|
||||||
INCMP . *
|
INCMP . *
|
||||||
|
3
services/registration/set_default.vis
Normal file
3
services/registration/set_default.vis
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
LOAD set_language 6
|
||||||
|
CATCH terms flag_account_created 0
|
||||||
|
MOVE language_changed
|
3
services/registration/set_swa.vis
Normal file
3
services/registration/set_swa.vis
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
LOAD set_language 6
|
||||||
|
CATCH terms flag_account_created 0
|
||||||
|
MOVE language_changed
|
@ -1,5 +1,3 @@
|
|||||||
LOAD select_language 0
|
|
||||||
RELOAD select_language
|
|
||||||
MOUT yes 0
|
MOUT yes 0
|
||||||
MOUT no 1
|
MOUT no 1
|
||||||
HALT
|
HALT
|
||||||
|
Loading…
Reference in New Issue
Block a user