| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
|
2 |
|
| 3 |
import java.util.ArrayList;
|
3 |
import java.util.ArrayList;
|
| - |
|
4 |
import java.util.Arrays;
|
| 4 |
import java.util.Collection;
|
5 |
import java.util.Collection;
|
| 5 |
import java.util.Collections;
|
6 |
import java.util.Collections;
|
| 6 |
import java.util.HashMap;
|
7 |
import java.util.HashMap;
|
| 7 |
import java.util.HashSet;
|
8 |
import java.util.HashSet;
|
| 8 |
import java.util.LinkedHashSet;
|
9 |
import java.util.LinkedHashSet;
|
| Line 90... |
Line 91... |
| 90 |
@Transactional(rollbackFor=Throwable.class)
|
91 |
@Transactional(rollbackFor=Throwable.class)
|
| 91 |
public class RechargeController {
|
92 |
public class RechargeController {
|
| 92 |
|
93 |
|
| 93 |
private static final Logger log=LoggerFactory.getLogger(RechargeController.class);
|
94 |
private static final Logger log=LoggerFactory.getLogger(RechargeController.class);
|
| 94 |
private static final String HEADER_X_FORWARDED_FOR = "X-FORWARDED-FOR";
|
95 |
private static final String HEADER_X_FORWARDED_FOR = "X-FORWARDED-FOR";
|
| - |
|
96 |
|
| - |
|
97 |
private List<String> blockedRecharge = Arrays.asList("abhinav.mangla7@gmail.com", "ysinghal34@gmail.com");
|
| 95 |
private static final String X_REAL_IP = "X-Real-IP";
|
98 |
private static final String X_REAL_IP = "X-Real-IP";
|
| 96 |
@Value("${oxigen.recharge.transaction.url}")
|
99 |
@Value("${oxigen.recharge.transaction.url}")
|
| 97 |
private String oxigenRechargeTransactionUrl;
|
100 |
private String oxigenRechargeTransactionUrl;
|
| 98 |
|
101 |
|
| 99 |
@Value("${oxigen.recharge.enquiry.url}")
|
102 |
@Value("${oxigen.recharge.enquiry.url}")
|
| Line 366... |
Line 369... |
| 366 |
return responseSender.internalServerError(e);
|
369 |
return responseSender.internalServerError(e);
|
| 367 |
}
|
370 |
}
|
| 368 |
|
371 |
|
| 369 |
|
372 |
|
| 370 |
RechargeRequest rechargeRequest = convertRechargeRequest(createRechargeRequest);
|
373 |
RechargeRequest rechargeRequest = convertRechargeRequest(createRechargeRequest);
|
| - |
|
374 |
if(blockedRecharge.contains(user.getEmailId())) {
|
| - |
|
375 |
throw new ProfitMandiBusinessException("Recharge Provider", createRechargeRequest.getOperatorId(), "We are experiencing some problem right now.");
|
| 371 |
|
376 |
}
|
| 372 |
RechargeResponse rechargeResponse = rechargeService.doRecharge(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey, oxigenRechargeValidationUrl,
|
377 |
RechargeResponse rechargeResponse = rechargeService.doRecharge(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey, oxigenRechargeValidationUrl,
|
| 373 |
oxigenRechargeValidationAuthKey, rechargeTransactionMobileCredential, rechargeTransactionDthCredential, retailerId, rechargeRequest);
|
378 |
oxigenRechargeValidationAuthKey, rechargeTransactionMobileCredential, rechargeTransactionDthCredential, retailerId, rechargeRequest);
|
| 374 |
|
379 |
|
| 375 |
crr.setResult(rechargeResponse.getStatus().equals(RechargeStatus.SUCCESS));
|
380 |
crr.setResult(rechargeResponse.getStatus().equals(RechargeStatus.SUCCESS));
|
| 376 |
crr.setRequestId(rechargeResponse.getRequestId());
|
381 |
crr.setRequestId(rechargeResponse.getRequestId());
|