Subversion Repositories SmartDukaan

Rev

Rev 6289 | Rev 6336 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6289 Rev 6307
Line 27... Line 27...
27
    private String uri;
27
    private String uri;
28
    private String operatorId;
28
    private String operatorId;
29
    private String operatorName;
29
    private String operatorName;
30
    private String serviceName;
30
    private String serviceName;
31
    private String denominationType;
31
    private String denominationType;
32
    private String circleName;
32
    private String circleCode;
33
    private List<RechargeDenomination> rechargeDenominations = null;
33
    private List<RechargeDenomination> rechargeDenominations = null;
34
    private static final long serialVersionUID = 2079308723099307749L;
34
    private static final long serialVersionUID = 2079308723099307749L;
35
 
35
 
36
    private static Logger log = Logger.getLogger(Class.class);
36
    private static Logger log = Logger.getLogger(Class.class);
37
    
37
    
Line 52... Line 52...
52
    
52
    
53
    public String create() {
53
    public String create() {
54
        if(form.equals("serviceSelect")) {
54
        if(form.equals("serviceSelect")) {
55
            return index();
55
            return index();
56
        }
56
        }
57
        return "hello";
57
        return "";
58
    }
58
    }
59
    
59
    
60
    public Map<Long, String> getProviderMap() {
60
    public Map<Long, String> getProviderMap() {
61
        if(serviceType.equals("1"))
61
        if(serviceType.equals("1"))
62
            providers = Utils.getMobileProvidersMap();
62
            providers = Utils.getMobileProvidersMap();
Line 83... Line 83...
83
    
83
    
84
    public String getAllDenominations() {
84
    public String getAllDenominations() {
85
        TransactionClient tcl;
85
        TransactionClient tcl;
86
        try {
86
        try {
87
            tcl = new TransactionClient();
87
            tcl = new TransactionClient();
88
            rechargeDenominations =  tcl.getClient().getRechargeDenominations(Long.parseLong(operatorId), circleName, DenominationType.findByValue(Integer.parseInt(denominationType)));
88
            rechargeDenominations =  tcl.getClient().getRechargeDenominations(Long.parseLong(operatorId), circleCode, DenominationType.findByValue(Integer.parseInt(denominationType)));
89
            if(rechargeDenominations == null || rechargeDenominations.isEmpty()) {
89
            if(rechargeDenominations == null || rechargeDenominations.isEmpty()) {
90
                setError("This information is unavailable for now.<br>You can recharge with the amount you normally use or you can try later.");
90
                setError("This information is unavailable for now.<br>You can recharge with the amount you normally use or you can try later.");
91
            }
91
            }
92
        } catch (Exception e) {
92
        } catch (Exception e) {
93
            log.error("Unable to get rechargeDenominations for operatorId " + operatorId + " and circleName : " +  circleName + " and DenominationType : " + denominationType, e);
93
            log.error("Unable to get rechargeDenominations for operatorId " + operatorId + " and circleCode : " +  circleCode + " and DenominationType : " + denominationType, e);
94
            setError("This information is unavailable for now.<br>You can recharge with the amount you normally use or you can try later.");
94
            setError("This information is unavailable for now.<br>You can recharge with the amount you normally use or you can try later.");
95
        }
95
        }
96
        return "recharge-denomination";
96
        return "recharge-denomination";
97
    }
97
    }
98
    
98
    
Line 155... Line 155...
155
 
155
 
156
    public void setDenominationType(String denominationType) {
156
    public void setDenominationType(String denominationType) {
157
        this.denominationType = denominationType;
157
        this.denominationType = denominationType;
158
    }
158
    }
159
 
159
 
160
    public String getCircleName() {
160
    public String getCircleCode() {
161
        return circleName;
161
        return circleCode;
162
    }
162
    }
163
 
163
 
164
    public void setCircleName(String circleName) {
164
    public void setCircleCode(String circleCode) {
165
        this.circleName = circleName;
165
        this.circleCode = circleCode;
166
    }
166
    }
167
 
167
 
168
    public List<RechargeDenomination> getRechargeDenominations() {
168
    public List<RechargeDenomination> getRechargeDenominations() {
169
        return rechargeDenominations;
169
        return rechargeDenominations;
170
    }
170
    }