Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21464 kshitij.so 1
package com.spice.profitmandi.web.controller;
2
 
3
import java.time.LocalDateTime;
21468 kshitij.so 4
import java.util.ArrayList;
5
import java.util.List;
6
import java.util.Map;
21464 kshitij.so 7
 
8
import javax.servlet.http.HttpServletRequest;
9
 
21505 kshitij.so 10
import org.apache.thrift.TException;
11
import org.apache.thrift.transport.TTransportException;
21464 kshitij.so 12
import org.slf4j.Logger;
13
import org.slf4j.LoggerFactory;
21505 kshitij.so 14
import org.springframework.beans.factory.annotation.Autowired;
21464 kshitij.so 15
import org.springframework.http.HttpStatus;
16
import org.springframework.http.MediaType;
17
import org.springframework.http.ResponseEntity;
18
import org.springframework.stereotype.Controller;
21514 kshitij.so 19
import org.springframework.web.bind.annotation.RequestBody;
21464 kshitij.so 20
import org.springframework.web.bind.annotation.RequestMapping;
21
import org.springframework.web.bind.annotation.RequestMethod;
22
import org.springframework.web.bind.annotation.RequestParam;
23
 
21505 kshitij.so 24
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
21464 kshitij.so 25
import com.spice.profitmandi.common.model.ProfitMandiConstants;
21468 kshitij.so 26
import com.spice.profitmandi.common.util.Utils;
21514 kshitij.so 27
import com.spice.profitmandi.dao.entity.User;
21505 kshitij.so 28
import com.spice.profitmandi.dao.entity.UserAccounts;
29
import com.spice.profitmandi.dao.enumuration.AccountType;
30
import com.spice.profitmandi.dao.repository.UserAccountRepository;
21514 kshitij.so 31
import com.spice.profitmandi.dao.repository.UserRepository;
21464 kshitij.so 32
import com.spice.profitmandi.thrift.clients.TransactionClient;
21514 kshitij.so 33
import com.spice.profitmandi.thrift.clients.PaymentClient;
21464 kshitij.so 34
import com.spice.profitmandi.web.model.ProfitMandiResponse;
35
import com.spice.profitmandi.web.model.ResponseStatus;
21514 kshitij.so 36
import com.spice.profitmandi.web.req.CreateRechargeRequest;
21505 kshitij.so 37
import com.spice.profitmandi.web.res.ConfirmRechargeResponse;
21514 kshitij.so 38
import com.spice.profitmandi.web.res.CreateRechargeResponse;
21464 kshitij.so 39
 
21468 kshitij.so 40
import in.shop2020.model.v1.order.DenominationType;
21464 kshitij.so 41
import in.shop2020.model.v1.order.DeviceNumberInfo;
21514 kshitij.so 42
import in.shop2020.model.v1.order.OrderType;
21468 kshitij.so 43
import in.shop2020.model.v1.order.RechargeDenomination;
21514 kshitij.so 44
import in.shop2020.model.v1.order.RechargeOrder;
45
import in.shop2020.model.v1.order.RechargeOrderStatus;
21464 kshitij.so 46
import in.shop2020.model.v1.order.RechargeType;
21514 kshitij.so 47
import in.shop2020.model.v1.order.TransactionServiceException;
21505 kshitij.so 48
import in.shop2020.model.v1.order.UserWallet;
21514 kshitij.so 49
import in.shop2020.payments.Payment;
50
import in.shop2020.payments.PaymentException;
51
import in.shop2020.payments.PaymentStatus;
21464 kshitij.so 52
import io.swagger.annotations.ApiImplicitParam;
53
import io.swagger.annotations.ApiImplicitParams;
54
import io.swagger.annotations.ApiOperation;
55
 
56
@Controller
57
public class RechargeController {
58
 
59
	private static final Logger log=LoggerFactory.getLogger(RechargeController.class);
21514 kshitij.so 60
	private static final String HEADER_X_FORWARDED_FOR = "X-FORWARDED-FOR";
21464 kshitij.so 61
 
21505 kshitij.so 62
	@Autowired
63
	UserAccountRepository userAccountRepository;
21514 kshitij.so 64
 
65
	@Autowired
66
	UserRepository userRepository;
67
 
21464 kshitij.so 68
	@RequestMapping(value = ProfitMandiConstants.URL_GET_SERVICE_PROVIDER, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
69
	@ApiImplicitParams({
70
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
71
				required = true, dataType = "string", paramType = "header")
72
	})
73
	@ApiOperation(value = "")
74
	public ResponseEntity<?> getServiceProvider(HttpServletRequest request, @RequestParam(value="deviceNumber") String deviceNumber, @RequestParam(value="rechargeType") String rechargeType){
75
		DeviceNumberInfo deviceInfo = null;
76
		TransactionClient tcl;
77
		try {
78
			tcl = new TransactionClient();
79
			deviceInfo = tcl.getClient().getServiceProviderForDevice(RechargeType.valueOf(rechargeType), deviceNumber.substring(0,4));
80
		} catch (Exception e) {
81
			log.error("Unable to get service provider for Device number " + deviceNumber + " and rechargeType : " +  rechargeType, e);
82
		}
83
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, deviceInfo);
84
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
85
	}
21505 kshitij.so 86
 
21468 kshitij.so 87
	@RequestMapping(value = ProfitMandiConstants.URL_GET_ALL_DENOMINATIONS, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
88
	@ApiImplicitParams({
89
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
90
				required = true, dataType = "string", paramType = "header")
91
	})
92
	@ApiOperation(value = "")
93
	public ResponseEntity<?> getAllDenominations(HttpServletRequest request, @RequestParam(value="operatorId") long operatorId, @RequestParam(value="circleCode") String circleCode, @RequestParam(value="denominationType") String denominationType){
94
		List<RechargeDenomination> rechargeDenominations = new ArrayList<RechargeDenomination>();
95
		TransactionClient tcl;
96
		try {
97
			tcl = new TransactionClient();
98
			rechargeDenominations =  tcl.getClient().getRechargeDenominations(operatorId, circleCode, DenominationType.valueOf(denominationType));
99
		} catch (Exception e) {
100
			log.error("Unable to get rechargeDenominations for operatorId " + operatorId + " and circleCode : " +  circleCode + " and DenominationType : " + denominationType, e);
101
		}
102
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, rechargeDenominations);
103
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
104
	}
21505 kshitij.so 105
 
21468 kshitij.so 106
	@RequestMapping(value = ProfitMandiConstants.URL_MOBILE_OPERATORS, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
107
	@ApiImplicitParams({
108
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
109
				required = true, dataType = "string", paramType = "header")
110
	})
111
	@ApiOperation(value = "")
112
	public ResponseEntity<?> getAllMobileOperators(HttpServletRequest request){
113
		Map<Long, String> mobileProviderMap = Utils.getMobileProvidersMap();
114
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, mobileProviderMap);
115
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
116
	}
21505 kshitij.so 117
 
21468 kshitij.so 118
	@RequestMapping(value = ProfitMandiConstants.URL_DTH_OPERATORS, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
119
	@ApiImplicitParams({
120
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
121
				required = true, dataType = "string", paramType = "header")
122
	})
123
	@ApiOperation(value = "")
124
	public ResponseEntity<?> getAllDTHOperators(HttpServletRequest request){
125
		Map<Long, String> dthProviderMap = Utils.getDthProvidersMap();
126
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, dthProviderMap);
127
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
128
	}
129
 
21505 kshitij.so 130
	@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_CONFIRM, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
131
	@ApiImplicitParams({
132
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
133
				required = true, dataType = "string", paramType = "header")
134
	})
135
	@ApiOperation(value = "")
21510 kshitij.so 136
	public ResponseEntity<?> confirmRecharge(HttpServletRequest request, @RequestParam(value="rechargeAmount") long rechargeAmount){
21505 kshitij.so 137
		int userId = (int)request.getAttribute("userId");
138
		UserAccounts userAccount = null;
139
		UserWallet wallet = null;
140
		if (rechargeAmount <=0){
141
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.BAD_REQUEST.toString(), HttpStatus.BAD_REQUEST, ResponseStatus.SUCCESS, null);
142
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.BAD_REQUEST);
143
		}
21514 kshitij.so 144
 
21505 kshitij.so 145
		try {
146
			userAccount = userAccountRepository.getUserAccountByType(userId, AccountType.saholic);
147
		} catch (ProfitMandiBusinessException e) {
148
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.SUCCESS, null);
149
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
150
		}
151
		try {
152
			TransactionClient tc = new TransactionClient();
153
			wallet = tc.getClient().getUserWallet(Long.valueOf(userAccount.getAccount_key()));
154
		} catch (NumberFormatException | TException e) {
155
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.SUCCESS, null);
156
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
157
		}
21514 kshitij.so 158
 
21505 kshitij.so 159
		ConfirmRechargeResponse crr = new ConfirmRechargeResponse();
160
		crr.setWalletAmount(wallet.getAmount());
161
		crr.setWalletAmountLeft(wallet.getAmount() - rechargeAmount);
162
		crr.setCanProceed(true);
163
		if (crr.getWalletAmountLeft() < 0){
164
			crr.setCanProceed(false);
165
			crr.setReason("You don't have sufficient wallet balance");
166
		}
167
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, crr);
168
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
169
	}
21514 kshitij.so 170
 
21505 kshitij.so 171
	@RequestMapping(value = ProfitMandiConstants.URL_CREATE_RECHARGE , method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
172
	@ApiImplicitParams({
173
		@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", 
174
				required = true, dataType = "string", paramType = "header")
175
	})
21514 kshitij.so 176
	public ResponseEntity<?> createRecharge(HttpServletRequest request, @RequestBody CreateRechargeRequest createRechargeRequest){
177
		String ipAddress  = remoteAddr(request);
178
		String errorMessage = validateRecharge(RechargeType.valueOf(createRechargeRequest.getRechargeType()), createRechargeRequest.getNumber(), createRechargeRequest.getOperatorId(), ipAddress);
179
		CreateRechargeResponse crr =  new CreateRechargeResponse();
180
		if(!errorMessage.equals("SUCCESS")){
181
			crr.setReason(errorMessage);
182
			crr.setResult(false);
183
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.BAD_REQUEST.toString(), HttpStatus.BAD_REQUEST, ResponseStatus.SUCCESS, crr);
184
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.BAD_REQUEST);
185
		}
186
		int userId = (int)request.getAttribute("userId");
187
		UserAccounts userAccount = null;
188
		UserWallet wallet = null;
189
		if (createRechargeRequest.getRechargeAmount() <=0){
190
			crr.setReason("Illegal recharge amount");
191
			crr.setResult(false);
192
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.BAD_REQUEST.toString(), HttpStatus.BAD_REQUEST, ResponseStatus.SUCCESS, crr);
193
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.BAD_REQUEST);
194
		}
195
 
196
		try {
197
			userAccount = userAccountRepository.getUserAccountByType(userId, AccountType.saholic);
198
		} catch (ProfitMandiBusinessException e) {
199
			log.error("Unable to get user account ",e);
200
			crr.setReason("We are experiencing some problem right now.");
201
			crr.setResult(false);
202
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.SUCCESS, crr);
203
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
204
		}
205
		try {
206
			TransactionClient tc = new TransactionClient();
207
			wallet = tc.getClient().getUserWallet(Long.valueOf(userAccount.getAccount_key()));
208
		} catch (NumberFormatException | TException e) {
209
			log.error("Unable to get user wallet ",e);
210
			crr.setReason("We are experiencing some problem right now.");
211
			crr.setResult(false);
212
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.SUCCESS, crr);
213
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
214
		}
215
 
216
		if (wallet.getAmount() < createRechargeRequest.getRechargeAmount()){
217
			crr.setReason("You don't have sufficient wallet balance.");
218
			crr.setResult(false);
219
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.BAD_REQUEST.toString(), HttpStatus.BAD_REQUEST, ResponseStatus.SUCCESS, crr);
220
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.BAD_REQUEST);
221
		}
222
 
223
		User user = null;
224
		try {
225
			user = userRepository.selectById(userId);
226
		} catch (ProfitMandiBusinessException e) {
227
			log.error("Unable to get user",e);
228
			crr.setReason("We are experiencing some problem right now.");
229
			crr.setResult(false);
230
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.SUCCESS, crr);
231
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
232
		}
233
 
234
 
235
		RechargeOrder t_rechargeOrder = new RechargeOrder();
236
		t_rechargeOrder.setTotalAmount(createRechargeRequest.getRechargeAmount());
237
		t_rechargeOrder.setUserEmailId(user.getEmailId());
238
		t_rechargeOrder.setUserId(userId);
239
		t_rechargeOrder.setDeviceNumber(createRechargeRequest.getNumber());
240
		t_rechargeOrder.setPlan(createRechargeRequest.getPlan()==null?"":createRechargeRequest.getPlan());
241
		t_rechargeOrder.setOperatorId(createRechargeRequest.getOperatorId());
242
		t_rechargeOrder.setRechargeType(RechargeType.valueOf(createRechargeRequest.getRechargeType()));
243
		t_rechargeOrder.setStatus(RechargeOrderStatus.PAYMENT_PENDING);
244
		t_rechargeOrder.setOrderType(OrderType.B2C);
245
		t_rechargeOrder.setWalletAmount(createRechargeRequest.getRechargeAmount());
246
		t_rechargeOrder.setCouponAmount(0);
247
		t_rechargeOrder.setCouponCode("");
248
		t_rechargeOrder.setIpAddress(ipAddress);
249
		TransactionClient tc = null;
250
		RechargeOrder rechargeOrder;
251
		try {
252
			tc = new TransactionClient();
253
			rechargeOrder = tc.getClient().createRechargeOrder(t_rechargeOrder);
254
		} catch (TransactionServiceException | TException e) {
255
			log.error("Unable to create recharge order",e);
256
			crr.setReason("We are experiencing some problem right now.");
257
			crr.setResult(false);
258
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.SUCCESS, crr);
259
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
260
		}
261
 
262
		log.info("Recharge Order:" + rechargeOrder);
263
		PaymentClient paymentServiceClient = null;
264
		try {
265
			paymentServiceClient = new PaymentClient();
266
		} catch (TTransportException e) {
267
			log.error("Unable to create payment client",e);
268
			crr.setReason("We are experiencing some problem right now.");
269
			crr.setResult(false);
270
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.SUCCESS, crr);
271
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
272
		}
273
		try {
274
			RechargeOrder d_rechargeOrder = tc.getClient().getRechargeOrder(rechargeOrder.getId());
275
			List<Payment> payments = paymentServiceClient.getClient().getPaymentForRechargeTxnId(d_rechargeOrder.getTransactionId());
276
			if(payments.size() > 0) {
277
				throw new PaymentException(d_rechargeOrder.getId(), "Payment already exists for recharge");
278
			}
279
			Long merchantPaymentId = 0l;
280
			if (d_rechargeOrder.getWalletAmount() +  d_rechargeOrder.getCouponAmount() != d_rechargeOrder.getTotalAmount()) {
281
				log.error("Wallet amount : " + d_rechargeOrder.getWalletAmount() + ", coupon amount : " + d_rechargeOrder.getCouponAmount() + " and total amount : " + d_rechargeOrder.getTotalAmount());
282
				merchantPaymentId = paymentServiceClient.getClient().createPayment(d_rechargeOrder.getUserId(), d_rechargeOrder.getTotalAmount(), 8, d_rechargeOrder.getTransactionId(), true);
283
				paymentServiceClient.getClient().updatePaymentDetails(merchantPaymentId, "","", "0", "", "", "", "", "", PaymentStatus.FAILED, "", null);
284
				tc.getClient().updateRechargeOrderStatus(d_rechargeOrder.getId(),  RechargeOrderStatus.PAYMENT_FAILED);
285
			} else {
286
				merchantPaymentId = paymentServiceClient.getClient().createPayment(d_rechargeOrder.getUserId(), d_rechargeOrder.getTotalAmount(), 8, d_rechargeOrder.getTransactionId(), true);
287
				//Update payment status as authorized
288
				paymentServiceClient.getClient().updatePaymentDetails(merchantPaymentId, "","", "0", "", "", "", "", "", PaymentStatus.SUCCESS, "", null);
289
				tc.getClient().updateRechargeOrderStatus(d_rechargeOrder.getId(),  RechargeOrderStatus.PAYMENT_SUCCESSFUL);
290
			}
291
			crr.setRechargeOrderId(d_rechargeOrder.getId());
292
			crr.setResult(true);
293
		} catch (Exception e) {
294
			log.error("Unable to mark the payment as authorized", e);
295
			crr.setReason("We are experiencing some problem right now.");
296
			crr.setResult(false);
297
			final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.INTERNAL_SERVER_ERROR.toString(), HttpStatus.INTERNAL_SERVER_ERROR, ResponseStatus.SUCCESS, crr);
298
			return new ResponseEntity<>(profitMandiResponse,HttpStatus.INTERNAL_SERVER_ERROR);
299
		}
300
		final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, crr);
301
		return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
21505 kshitij.so 302
	}
21514 kshitij.so 303
 
304
 
305
	private String remoteAddr(HttpServletRequest request) {
306
		String remoteAddr = "";
307
		String x;
308
		x = request.getHeader(HEADER_X_FORWARDED_FOR);
309
		if (x != null && !x.isEmpty()) {
310
			remoteAddr = x;
311
			int idx = remoteAddr.lastIndexOf(',');
312
			if (idx > -1) {
313
				remoteAddr = remoteAddr.substring(idx + 1).trim();
314
			}
315
		} else {
316
			remoteAddr = request.getRemoteAddr();
317
		}
318
		return remoteAddr;
319
	}
320
 
321
	private String validateRecharge(RechargeType rechargeType, String number, long operatorId, String ipAddress){
322
		TransactionClient tcl;
323
		try {
324
			tcl = new TransactionClient();
325
			String result = tcl.getClient().validateRecharge(rechargeType, number, operatorId, ipAddress);
326
			log.info("validateRecharge Called" + number + " and rechargeType : " +  rechargeType + ", IP:" + ipAddress + ", Operator:" + operatorId + ", Result:" + result);
327
			return result;
328
		} catch (Exception e) {
329
			log.error("Unable to get service provider for Device number " + number + " and rechargeType : " +  rechargeType, e);
330
		}
331
		return "Oops! There seems to be a problem. Please try after some time";
332
	}
333
 
334
 
21464 kshitij.so 335
}
21505 kshitij.so 336
 
337
 
338