menu-voucherlist #101
@ -94,6 +94,7 @@ func (ls *LocalHandlerService) GetHandler() (*ussd.Handlers, error) {
|
|||||||
ls.DbRs.AddLocalFunc("verify_new_pin", ussdHandlers.VerifyNewPin)
|
ls.DbRs.AddLocalFunc("verify_new_pin", ussdHandlers.VerifyNewPin)
|
||||||
ls.DbRs.AddLocalFunc("confirm_pin_change", ussdHandlers.ConfirmPinChange)
|
ls.DbRs.AddLocalFunc("confirm_pin_change", ussdHandlers.ConfirmPinChange)
|
||||||
ls.DbRs.AddLocalFunc("quit_with_help", ussdHandlers.QuitWithHelp)
|
ls.DbRs.AddLocalFunc("quit_with_help", ussdHandlers.QuitWithHelp)
|
||||||
|
ls.DbRs.AddLocalFunc("get_vouchers",ussdHandlers.GetVoucherList)
|
||||||
|
|
||||||
return ussdHandlers, nil
|
return ussdHandlers, nil
|
||||||
}
|
}
|
||||||
|
@ -254,6 +254,38 @@ func (h *Handlers) SaveTemporaryPin(ctx context.Context, sym string, input []byt
|
|||||||
return res, nil
|
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) {
|
func (h *Handlers) ConfirmPinChange(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
var res resource.Result
|
var res resource.Result
|
||||||
sessionId, ok := ctx.Value("SessionId").(string)
|
sessionId, ok := ctx.Value("SessionId").(string)
|
||||||
|
@ -8,7 +8,7 @@ MOUT help 4
|
|||||||
MOUT quit 9
|
MOUT quit 9
|
||||||
HALT
|
HALT
|
||||||
INCMP send 1
|
INCMP send 1
|
||||||
INCMP quit 2
|
INCMP select_voucher 2
|
||||||
INCMP my_account 3
|
INCMP my_account 3
|
||||||
INCMP help 4
|
INCMP help 4
|
||||||
INCMP quit 9
|
INCMP quit 9
|
||||||
|
2
services/registration/select_voucher
Normal file
2
services/registration/select_voucher
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Select number or symbol from your vouchers:
|
||||||
|
{{.get_vouchers}}
|
9
services/registration/select_voucher.vis
Normal file
9
services/registration/select_voucher.vis
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
LOAD get_vouchers 0
|
||||||
|
MAP get_vouchers
|
||||||
|
MNEXT next 11
|
||||||
|
MPREV back 22
|
||||||
|
HALT
|
||||||
|
INCMP > 11
|
||||||
|
INCMP < 22
|
||||||
|
INCMP _*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user