Subversion Repositories SmartDukaan

Rev

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

Rev 6050 Rev 6091
Line 93... Line 93...
93
    public String create(){
93
    public String create(){
94
        
94
        
95
        if(rechargeOrderId == null){
95
        if(rechargeOrderId == null){
96
            return "recharge-redirect";
96
            return "recharge-redirect";
97
        }
97
        }
-
 
98
        UserClient uc;
98
        
99
        try {
-
 
100
            uc = new UserClient();
-
 
101
            TransactionClient tc = new TransactionClient();
-
 
102
            rechargeOrder = tc.getClient().getRechargeOrder(Long.parseLong(rechargeOrderId));
99
        if(name != null) {
103
            if(!name.isEmpty()) {
100
            Address address = new Address();
104
                Address address = new Address();
101
            address.setName(name);
105
                address.setName(name);
102
            address.setLine1(line1);
106
                address.setLine1(line1);
103
            address.setLine2(line2);
107
                address.setLine2(line2);
104
            address.setCity(city);
108
                address.setCity(city);
105
            address.setState(state);
109
                address.setState(state);
106
            address.setCountry("India");
110
                address.setCountry("India");
107
            address.setPin(pincode);
111
                address.setPin(pincode);
108
            address.setPhone(phone);
112
                address.setPhone(phone);
109
            
-
 
110
            UserClient uc;
-
 
111
            try {
113
                
112
                uc = new UserClient();
-
 
113
                TransactionClient tc = new TransactionClient();
-
 
114
                rechargeOrder = tc.getClient().getRechargeOrder(Long.parseLong(rechargeOrderId));
-
 
115
                uc.getClient().addAddressForUser(rechargeOrder.getUserId(), address, true);
114
                uc.getClient().addAddressForUser(rechargeOrder.getUserId(), address, true);
116
            } catch (TTransportException e) {
-
 
117
                // TODO Auto-generated catch block
-
 
118
                e.printStackTrace();
-
 
119
            } catch (NumberFormatException e) {
-
 
120
                // TODO Auto-generated catch block
-
 
121
                e.printStackTrace();
-
 
122
            } catch (TransactionServiceException e) {
-
 
123
                // TODO Auto-generated catch block
-
 
124
                e.printStackTrace();
-
 
125
            } catch (TException e) {
-
 
126
                // TODO Auto-generated catch block
-
 
127
                e.printStackTrace();
-
 
128
            } catch (UserContextException e) {
-
 
129
                // TODO Auto-generated catch block
-
 
130
                e.printStackTrace();
-
 
131
            }
115
            }
132
            
116
            
-
 
117
        } catch (TTransportException e) {
-
 
118
            // TODO Auto-generated catch block
-
 
119
            e.printStackTrace();
-
 
120
        } catch (NumberFormatException e) {
-
 
121
            // TODO Auto-generated catch block
-
 
122
            e.printStackTrace();
-
 
123
        } catch (TransactionServiceException e) {
-
 
124
            // TODO Auto-generated catch block
-
 
125
            e.printStackTrace();
-
 
126
        } catch (TException e) {
-
 
127
            // TODO Auto-generated catch block
-
 
128
            e.printStackTrace();
-
 
129
        } catch (UserContextException e) {
-
 
130
            // TODO Auto-generated catch block
-
 
131
            e.printStackTrace();
133
        }
132
        }
-
 
133
 
134
        
134
 
135
        String paymentOption = request.getParameter("payment_option");
135
        String paymentOption = request.getParameter("payment_option");
136
        log.info("Payment Option Selected: " + paymentOption);
136
        log.info("Payment Option Selected: " + paymentOption);
137
        if(paymentOption == null || paymentOption.equals("")){
137
        if(paymentOption == null || paymentOption.equals("")){
138
            addActionError("Please select a payment method to continue.");
138
            addActionError("Please select a payment method to continue.");
139
            return "recharge-pay-options-redirect";
139
            return "recharge-pay-options-redirect";