func (s *Service) GetCards(c *gin.Context) {
	username := c.GetString("username")
	if username == "" {
		c.JSON(http.StatusUnauthorized, gin.H{"message": "unauthorized access", "code": "unauthorized_access"})
		return
	}
	cards, err := s.Redis.ZRange(username+":cards", 0, -1).Result()
	if err != nil {
		logrus.WithFields(logrus.Fields{
			"error":   "unable to get results from redis",
			"message": err.Error(),
		}).Info("unable to get results from redis")
		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error(), "message": "error in redis"})
		return
	}
	cardBytes := cardsFromZ(cards)
	m, _ := s.Redis.HGet(username+":cards", "main_card").Result()
	mCard := cardsFromZ([]string{m})
	c.JSON(http.StatusOK, gin.H{"cards": cardBytes, "main_card": mCard[0]})
}
GetCards Get all cards for the currently authorized user
package consumer
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"time"
	"github.com/adonese/noebs/ebs_fields"
	"github.com/adonese/noebs/utils"
	"github.com/google/uuid"
	"github.com/gin-gonic/gin"
	"github.com/gin-gonic/gin/binding"
	"github.com/go-redis/redis/v7"
	"github.com/noebs/ipin"
	"github.com/sirupsen/logrus"
)
func (s *Service) ResetPassword(c *gin.Context) {
}
func (s *Service) NewBiller(c *gin.Context) {
	var b ebs_fields.Merchant
	if err := c.BindJSON(&b); err != nil {
		verr := validationError{Message: "Empty request fields", Code: "empty_fields"}
		c.JSON(http.StatusBadRequest, verr)
		return
	}
	p := paymentTokens{redisClient: s.Redis}
	var retry int
begin:
	name := GetRandomName(retry)
	if err := p.newBiller(name); err != nil {
		retry++
		goto begin
	}
	c.JSON(http.StatusCreated, gin.H{"result": "ok", "namespace": name})
}
func (s *Service) CardFromNumber(c *gin.Context) {
	q, ok := c.GetQuery("mobile_number")
	if !ok {
		c.JSON(http.StatusBadRequest, gin.H{"message": "mobile number is empty", "code": "empty_mobile_number"})
		return
	}
	pan, err := s.Redis.Get(q + ":pan").Result()
	if err == nil {
		c.JSON(http.StatusOK, gin.H{"result": pan})
		return
	}
	username, err := s.Redis.Get(q).Result()
	if err == redis.Nil {
		c.JSON(http.StatusBadRequest, gin.H{"message": "No user with such mobile number", "code": "mobile_number_not_found"})
		return
	}
	if pan, ok := utils.PanfromMobile(username, s.Redis); ok {
		c.JSON(http.StatusOK, gin.H{"result": pan})
	} else {
		c.JSON(http.StatusBadRequest, gin.H{"message": "No user with such mobile number", "code": "mobile_number_not_found"})
	}
}