menu-traversals #108

Closed
carlos wants to merge 72 commits from menu-traversals into master
5 changed files with 45 additions and 1 deletions
Showing only changes of commit 188cb573dd - Show all commits

View File

@ -94,6 +94,7 @@ func (ls *LocalHandlerService) GetHandler() (*ussd.Handlers, error) {
ls.DbRs.AddLocalFunc("verify_new_pin", ussdHandlers.VerifyNewPin)
ls.DbRs.AddLocalFunc("confirm_pin_change", ussdHandlers.ConfirmPinChange)
ls.DbRs.AddLocalFunc("quit_with_help", ussdHandlers.QuitWithHelp)
ls.DbRs.AddLocalFunc("get_vouchers",ussdHandlers.GetVoucherList)
return ussdHandlers, nil
}

View File

@ -254,6 +254,38 @@ func (h *Handlers) SaveTemporaryPin(ctx context.Context, sym string, input []byt
return res, nil
}
func (h *Handlers) GetVoucherList(ctx context.Context,sym string,input []byte) (resource.Result,error){
var res resource.Result
vouchers := []string{
"SRF",
"CRF",
"VCF",
"VSAPA",
"FSTMP",
"FSAW",
"PTAQ",
"VCRXT",
"VSGAQ",
"QPWIQQ",
"FSTMP",
"FSAW",
"PTAQ",
"VCRXT",
"VSGAQ",
"QPWIQQ",
"FSTMP",
"FSAW",
"PTAQ",
"VCRXT",
"VSGAQ",
"QPWIQQ",
}
res.Content = strings.Join(vouchers,"\n")
return res,nil
}
func (h *Handlers) ConfirmPinChange(ctx context.Context, sym string, input []byte) (resource.Result, error) {
var res resource.Result
sessionId, ok := ctx.Value("SessionId").(string)

View File

@ -8,7 +8,7 @@ MOUT help 4
MOUT quit 9
HALT
INCMP send 1
INCMP quit 2
INCMP select_voucher 2
INCMP my_account 3
INCMP help 4
INCMP quit 9

View File

@ -0,0 +1,2 @@
Select number or symbol from your vouchers:
{{.get_vouchers}}

View File

@ -0,0 +1,9 @@
LOAD get_vouchers 0
MAP get_vouchers
MNEXT next 11
MPREV back 22
HALT
INCMP > 11
INCMP < 22
INCMP _*