Subversion Repositories SmartDukaan

Rev

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

Rev 6215 Rev 6228
Line 44... Line 44...
44
	
44
	
45
	private static String mode;
45
	private static String mode;
46
	
46
	
47
	private static String ebsSecretKey;
47
	private static String ebsSecretKey;
48
	
48
	
49
	private String phone;//This is used for recharge orders.
49
	private String phone;//This is used for recharge orders of value less than 1000.
50
	
50
	
51
	static{
51
	static{
52
		try {
52
		try {
53
			accountId = ConfigClient.getClient().get("ebs_account_id");
53
			accountId = ConfigClient.getClient().get("ebs_account_id");
54
			returnUrl = ConfigClient.getClient().get("ebs_return_url");
54
			returnUrl = ConfigClient.getClient().get("ebs_return_url");
Line 144... Line 144...
144
        String desc = "Recharge for Rs. " + rechargeOrder.getTotalAmount() + ", operator : " + rechargeOrder.getOperatorId();
144
        String desc = "Recharge for Rs. " + rechargeOrder.getTotalAmount() + ", operator : " + rechargeOrder.getOperatorId();
145
        this.description = new StringBuilder(desc);
145
        this.description = new StringBuilder(desc);
146
        setPaymentOption(payment);
146
        setPaymentOption(payment);
147
        
147
        
148
        this.amount = payment.getAmount();
148
        this.amount = payment.getAmount();
-
 
149
        if(payment.getAmount() > 1000) {
149
        UserClient userClient;
150
            UserClient userClient;
150
        in.shop2020.model.v1.user.Address address = null;
151
            in.shop2020.model.v1.user.Address address = null;
151
        try {
152
            try {
152
            userClient = new UserClient();
153
                userClient = new UserClient();
153
            long addressId = userClient.getClient().getDefaultAddressId(rechargeOrder.getUserId());
154
                long addressId = userClient.getClient().getDefaultAddressId(rechargeOrder.getUserId());
154
            address = userClient.getClient().getAddressById(addressId);
155
                address = userClient.getClient().getAddressById(addressId);
-
 
156
                this.billingDetails = new ContactDetails(address.getName(),
-
 
157
                        rechargeOrder.getUserEmailId(), address.getLine1(),
-
 
158
                        address.getCity(), address.getState(),
-
 
159
                        address.getPin(), "IND",
-
 
160
                        address.getPhone());
155
        } catch (Exception e) {
161
            } catch (Exception e) {
156
            log.error("Unable to get address to put in billing details");
162
                log.error("Unable to get address to put in billing details");
157
            e.printStackTrace();
163
                e.printStackTrace();
158
        }
164
            }
-
 
165
        } else {
159
        this.billingDetails = new ContactDetails("",
166
        this.billingDetails = new ContactDetails(rechargeOrder.getUserEmailId(),
160
                rechargeOrder.getUserEmailId(), "",
167
                rechargeOrder.getUserEmailId(), id,
161
                "", "",
168
                id, id,
162
                "", "IND",
169
                "110001", "IND",
163
                getPhone());
170
                getPhone());
164
        
171
        }
165
        log.info("Billing details of recharge order " + rechargeOrder.getDisplayId() + " : " + billingDetails);
172
        log.info("Billing details of recharge order " + rechargeOrder.getDisplayId() + " : " + billingDetails);
166
        
-
 
167
        return "show";
173
        return "show";
168
    }
174
    }
169
 
175
 
170
	public String getDescription(){
176
	public String getDescription(){
171
		if(this.description.length() >= 255)
177
		if(this.description.length() >= 255)