Subversion Repositories SmartDukaan

Rev

Rev 6057 | Rev 6215 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6050 anupam.sin 1
package in.shop2020.serving.controllers;
2
 
3
import java.util.HashMap;
4
import java.util.List;
5
import java.util.Map;
6091 anupam.sin 6
import java.util.ResourceBundle;
6050 anupam.sin 7
 
8
import org.apache.log4j.Logger;
9
import org.apache.struts2.convention.annotation.Result;
10
import org.apache.struts2.convention.annotation.Results;
11
import org.apache.thrift.TException;
12
import org.apache.thrift.transport.TTransportException;
13
 
14
import in.shop2020.model.v1.order.RechargeOrder;
15
import in.shop2020.thrift.clients.HelperClient;
6091 anupam.sin 16
import in.shop2020.thrift.clients.UserClient;
6050 anupam.sin 17
import in.shop2020.utils.HelperServiceException;
18
import in.shop2020.utils.QuickLink;
19
 
20
public class RechargePayOptionsController extends BaseController {
21
 
22
    /**
23
     * 
24
     */
6091 anupam.sin 25
 
26
    //private static final ResourceBundle resource = ResourceBundle.getBundle(ProceedToPayController.class.getName());
27
    //private static final boolean SHOW_EBS_TEST_GATEWAY = Boolean.parseBoolean(resource.getString("show_ebs_test_gateway"));
6050 anupam.sin 28
    private RechargeOrder rechargeOrder = null;
6057 anupam.sin 29
    private String rechargeOrderId = "";
30
    private String amount = "";
31
    private String errorMsg = "";
6091 anupam.sin 32
    private String userId = null;
6050 anupam.sin 33
 
34
    private static final long serialVersionUID = 2079308723099307749L;
35
 
36
    private static Logger log = Logger.getLogger(Class.class);
37
 
38
    public String index() {
39
        return "index";
40
    }
41
 
42
    public String create() {
43
        return index();
44
    }
45
 
6091 anupam.sin 46
    public boolean shouldShowEbsTestGateway() {
47
        //return SHOW_EBS_TEST_GATEWAY;
48
        return true;
49
    }
50
 
51
    public boolean isAddressRequired() {
52
        UserClient ucl;
53
        long addressId = 0;
54
        try {
55
            ucl = new UserClient();
56
            addressId = ucl.getClient().getDefaultAddressId(Long.parseLong(userId));
57
        } catch (Exception e) {
58
            log.error("Unable to connect to user service", e);
59
        }
60
        if (addressId <= 0) {
61
            return true;
62
        } else {
63
            return false;
64
        }
65
    }
66
 
6050 anupam.sin 67
    public void setRechargeOrder(RechargeOrder rechargeOrder) {
68
        this.rechargeOrder = rechargeOrder;
69
    }
70
 
71
    public RechargeOrder getRechargeOrder() {
72
        return rechargeOrder;
73
    }
74
 
75
    public void setRechargeOrderId(String rechargeOrderId) {
6057 anupam.sin 76
        this.rechargeOrderId = rechargeOrderId;
6050 anupam.sin 77
    }
78
 
79
    public String getRechargeOrderId() {
6057 anupam.sin 80
        return rechargeOrderId;
6050 anupam.sin 81
    }
6057 anupam.sin 82
 
83
    public void setAmount(String amount) {
84
        this.amount = amount;
85
    }
86
 
87
    public String getAmount() {
88
        return amount;
89
    }
90
 
91
    public String getErrorMsg() {
92
        return errorMsg;
93
    }
6091 anupam.sin 94
 
95
    public String getUserId() {
96
        return userId;
97
    }
98
 
99
    public void setUserId(String userId) {
100
        this.userId = userId;
101
    }
6050 anupam.sin 102
}