Compare commits
4 Commits
7b33f2f644
...
3501a79aea
Author | SHA1 | Date | |
---|---|---|---|
3501a79aea | |||
54bc09b7e9 | |||
9153336412 | |||
d87b70b292 |
@ -130,10 +130,14 @@ func (h *Handlers) SetResetSingleEdit(ctx context.Context, sym string, input []b
|
||||
|
||||
switch menuOPtion {
|
||||
case "2":
|
||||
fmt.Println("Resetting unlock for update")
|
||||
res.FlagReset = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
|
||||
res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT)
|
||||
case "3":
|
||||
res.FlagReset = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
|
||||
res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT)
|
||||
case "4":
|
||||
res.FlagReset = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
|
||||
res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT)
|
||||
default:
|
||||
res.FlagReset = append(res.FlagReset, models.USERFLAG_SINGLE_EDIT)
|
||||
@ -339,6 +343,8 @@ func (h *Handlers) CheckIdentifier(ctx context.Context, sym string, input []byte
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// Unlock attempts to unlock the next sequential nodes by verifying the provided PIN against the already set PIN.
|
||||
// It sets the required flags that control the flow.
|
||||
func (h *Handlers) Unlock(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||
res := resource.Result{}
|
||||
pin := string(input)
|
||||
@ -348,7 +354,7 @@ func (h *Handlers) Unlock(ctx context.Context, sym string, input []byte) (resour
|
||||
return res, err
|
||||
}
|
||||
|
||||
if len(input) > 1 {
|
||||
if len(input) == 4 {
|
||||
if pin != accountData["AccountPIN"] {
|
||||
res.FlagSet = append(res.FlagSet, models.USERFLAG_INCORRECTPIN)
|
||||
res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED)
|
||||
@ -359,6 +365,7 @@ func (h *Handlers) Unlock(ctx context.Context, sym string, input []byte) (resour
|
||||
res.FlagSet = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
|
||||
res.FlagSet = append(res.FlagSet, models.USERFLAG_ACCOUNT_UNLOCKED)
|
||||
} else {
|
||||
res.FlagSet = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
|
||||
res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED)
|
||||
}
|
||||
}
|
||||
@ -678,6 +685,8 @@ func (h *Handlers) GetAmount(ctx context.Context, sym string, input []byte) (res
|
||||
}
|
||||
|
||||
|
||||
// QuickWithBalance retrieves the balance for a given public key from the custodial balance API endpoint before
|
||||
// gracefully exiting the session.
|
||||
func (h *Handlers) QuitWithBalance(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||
res := resource.Result{}
|
||||
|
||||
|
11
internal/handlers/ussd/menuhandler_test.go
Normal file
11
internal/handlers/ussd/menuhandler_test.go
Normal file
@ -0,0 +1,11 @@
|
||||
package ussd
|
||||
|
||||
import "testing"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func CreateAccountTest(t *testing.T){
|
||||
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
LOAD reset_unlocked 0
|
||||
LOAD reset_unlocked 16
|
||||
LOAD reset_unlock_for_update 0
|
||||
RELOAD reset_unlock_for_update
|
||||
MOUT edit_name 1
|
||||
MOUT edit_gender 2
|
||||
MOUT edit_yob 3
|
||||
@ -9,6 +11,7 @@ MOUT back 0
|
||||
HALT
|
||||
INCMP _ 0
|
||||
LOAD set_reset_single_edit 0
|
||||
RELOAD set_reset_single_edit
|
||||
INCMP enter_name 1
|
||||
INCMP select_gender 2
|
||||
INCMP enter_yob 3
|
||||
|
Loading…
Reference in New Issue
Block a user