Subversion Repositories SmartDukaan

Rev

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

Rev 6073 Rev 6086
Line 42... Line 42...
42
     * 
42
     * 
43
     */
43
     */
44
    private static final long serialVersionUID = 1L;
44
    private static final long serialVersionUID = 1L;
45
    private long rechargeOrderId = 0;
45
    private long rechargeOrderId = 0;
46
    private String amount = "";
46
    private String amount = "";
47
    private String walletAmountUsed = "";
47
    private String walletAmountUsed = "0";
48
    private String operator = "";
48
    private String operator = "";
49
    private String number = "";
49
    private String number = "";
50
    private String email = "";
50
    private String email = "";
51
    private String rechargeType = "";
51
    private String rechargeType = "";
52
    private DesEncrypter desEncrypter = new DesEncrypter("saholic");
52
    private DesEncrypter desEncrypter = new DesEncrypter("saholic");
Line 60... Line 60...
60
    public String index() {
60
    public String index() {
61
        return "index";
61
        return "index";
62
    }
62
    }
63
    
63
    
64
    public String create() {
64
    public String create() {
65
        
65
        setTotalAmount(amount);
66
        if(userinfo.isLoggedIn()) {
66
        if(userinfo.isLoggedIn()) {
67
            try {
67
            try {
68
            TransactionClient tc = new TransactionClient();
68
            TransactionClient tc = new TransactionClient();
69
            UserWallet wallet = tc.getClient().getUserWallet(userinfo.getUserId());
69
            UserWallet wallet = tc.getClient().getUserWallet(userinfo.getUserId());
70
            long amountA = 0;
70
            long amountA = 0;
71
            setTotalAmount(amount);
-
 
72
            if(wallet.getAmount() == 0){
71
            if(wallet.getAmount() == 0){
73
                setMessage("Your RechargeWallet is empty.");
72
                setMessage("Your RechargeWallet is empty.");
74
            } else if ((amountA = wallet.getAmount() - Long.parseLong(amount)) >= 0) {
73
            } else if ((amountA = wallet.getAmount() - Long.parseLong(amount)) >= 0) {
75
                setAmount("0");
74
                setAmount("0");
76
                setMessage("You now have Rs. " + amountA + " left in your RechargeWallet.");
75
                setMessage("You now have Rs. " + amountA + " left in your RechargeWallet.");
Line 96... Line 95...
96
    }
95
    }
97
 
96
 
98
    public String createRecharge(){
97
    public String createRecharge(){
99
        if(userinfo.isLoggedIn()) {
98
        if(userinfo.isLoggedIn()) {
100
            setUserId("" + userinfo.getUserId());
99
            setUserId("" + userinfo.getUserId());
-
 
100
        } else {
-
 
101
            setUserId("686085");
101
        }
102
        }
102
        
103
        
103
        try {
104
        try {
104
            TransactionClient tc = new TransactionClient();
105
            TransactionClient tc = new TransactionClient();
105
            RechargeOrder rechargeOrder = new RechargeOrder();
106
            RechargeOrder rechargeOrder = new RechargeOrder();