| 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.Arrays;
|
| 5 |
import java.util.Collection;
|
- |
|
| 6 |
import java.util.Collections;
|
- |
|
| 7 |
import java.util.HashMap;
|
5 |
import java.util.HashMap;
|
| 8 |
import java.util.HashSet;
|
- |
|
| 9 |
import java.util.LinkedHashSet;
|
6 |
import java.util.LinkedHashSet;
|
| 10 |
import java.util.List;
|
7 |
import java.util.List;
|
| 11 |
import java.util.Map;
|
8 |
import java.util.Map;
|
| 12 |
import java.util.Optional;
|
9 |
import java.util.Optional;
|
| 13 |
import java.util.Set;
|
10 |
import java.util.Set;
|
| 14 |
import java.util.stream.Collector;
|
- |
|
| 15 |
import java.util.stream.Collectors;
|
11 |
import java.util.stream.Collectors;
|
| 16 |
|
12 |
|
| 17 |
import javax.annotation.PostConstruct;
|
13 |
import javax.annotation.PostConstruct;
|
| 18 |
import javax.servlet.http.HttpServletRequest;
|
14 |
import javax.servlet.http.HttpServletRequest;
|
| 19 |
import javax.swing.SortOrder;
|
- |
|
| 20 |
|
15 |
|
| 21 |
import org.apache.thrift.TException;
|
16 |
import org.apache.thrift.TException;
|
| 22 |
import org.apache.thrift.transport.TTransportException;
|
- |
|
| 23 |
import org.slf4j.Logger;
|
17 |
import org.slf4j.Logger;
|
| 24 |
import org.slf4j.LoggerFactory;
|
18 |
import org.slf4j.LoggerFactory;
|
| 25 |
import org.springframework.beans.factory.annotation.Autowired;
|
19 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 26 |
import org.springframework.beans.factory.annotation.Value;
|
20 |
import org.springframework.beans.factory.annotation.Value;
|
| 27 |
import org.springframework.http.MediaType;
|
21 |
import org.springframework.http.MediaType;
|
| 28 |
import org.springframework.http.ResponseEntity;
|
22 |
import org.springframework.http.ResponseEntity;
|
| 29 |
import org.springframework.stereotype.Controller;
|
23 |
import org.springframework.stereotype.Controller;
|
| 30 |
import org.springframework.transaction.annotation.Transactional;
|
24 |
import org.springframework.transaction.annotation.Transactional;
|
| 31 |
import org.springframework.ui.Model;
|
- |
|
| 32 |
import org.springframework.web.bind.annotation.RequestBody;
|
25 |
import org.springframework.web.bind.annotation.RequestBody;
|
| 33 |
import org.springframework.web.bind.annotation.RequestMapping;
|
26 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 34 |
import org.springframework.web.bind.annotation.RequestMethod;
|
27 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 35 |
import org.springframework.web.bind.annotation.RequestParam;
|
28 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 36 |
|
29 |
|
| 37 |
import com.spice.profitmandi.common.enumuration.RechargeStatus;
|
30 |
import com.spice.profitmandi.common.enumuration.RechargeStatus;
|
| 38 |
import com.spice.profitmandi.common.enumuration.SchemeType;
|
- |
|
| 39 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
31 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 40 |
import com.spice.profitmandi.common.model.CustomPaymentOption;
|
32 |
import com.spice.profitmandi.common.model.CustomPaymentOption;
|
| 41 |
import com.spice.profitmandi.common.model.OperatorType;
|
33 |
import com.spice.profitmandi.common.model.OperatorType;
|
| 42 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
34 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 43 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
35 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
| Line 45... |
Line 37... |
| 45 |
import com.spice.profitmandi.common.model.RechargeResponse;
|
37 |
import com.spice.profitmandi.common.model.RechargeResponse;
|
| 46 |
import com.spice.profitmandi.common.util.Utils;
|
38 |
import com.spice.profitmandi.common.util.Utils;
|
| 47 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
39 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 48 |
import com.spice.profitmandi.dao.entity.dtr.RechargeCommission;
|
40 |
import com.spice.profitmandi.dao.entity.dtr.RechargeCommission;
|
| 49 |
import com.spice.profitmandi.dao.entity.dtr.RechargeOperator;
|
41 |
import com.spice.profitmandi.dao.entity.dtr.RechargeOperator;
|
| 50 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
|
- |
|
| 51 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
42 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
| 52 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
43 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 53 |
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
|
44 |
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
|
| - |
|
45 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
| 54 |
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
|
46 |
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
|
| 55 |
import com.spice.profitmandi.dao.enumuration.dtr.RechargeType;
|
47 |
import com.spice.profitmandi.dao.enumuration.dtr.RechargeType;
|
| 56 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
48 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
| 57 |
import com.spice.profitmandi.dao.repository.dtr.RechargeCommissionRepository;
|
49 |
import com.spice.profitmandi.dao.repository.dtr.RechargeCommissionRepository;
|
| 58 |
import com.spice.profitmandi.dao.repository.dtr.RechargeOperatorRepository;
|
50 |
import com.spice.profitmandi.dao.repository.dtr.RechargeOperatorRepository;
|
| Line 61... |
Line 53... |
| 61 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
53 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 62 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
54 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 63 |
import com.spice.profitmandi.dao.repository.transaction.PendingRechargeCommissionRepository;
|
55 |
import com.spice.profitmandi.dao.repository.transaction.PendingRechargeCommissionRepository;
|
| 64 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
56 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
| 65 |
import com.spice.profitmandi.service.recharge.RechargeService;
|
57 |
import com.spice.profitmandi.service.recharge.RechargeService;
|
| 66 |
import com.spice.profitmandi.thrift.clients.PaymentClient;
|
- |
|
| 67 |
import com.spice.profitmandi.thrift.clients.TransactionClient;
|
58 |
import com.spice.profitmandi.thrift.clients.TransactionClient;
|
| 68 |
import com.spice.profitmandi.web.req.CreateRechargeRequest;
|
59 |
import com.spice.profitmandi.web.req.CreateRechargeRequest;
|
| 69 |
import com.spice.profitmandi.web.res.ConfirmRechargeResponse;
|
60 |
import com.spice.profitmandi.web.res.ConfirmRechargeResponse;
|
| 70 |
import com.spice.profitmandi.web.res.CreateRechargeResponse;
|
61 |
import com.spice.profitmandi.web.res.CreateRechargeResponse;
|
| 71 |
import com.spice.profitmandi.web.res.MyRechargesResponse;
|
62 |
import com.spice.profitmandi.web.res.MyRechargesResponse;
|
| 72 |
import com.spice.profitmandi.web.res.RechargeResultPojo;
|
63 |
import com.spice.profitmandi.web.res.RechargeResultPojo;
|
| 73 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
- |
|
| 74 |
|
64 |
|
| 75 |
import in.shop2020.model.v1.order.DenominationType;
|
65 |
import in.shop2020.model.v1.order.DenominationType;
|
| 76 |
import in.shop2020.model.v1.order.DeviceNumberInfo;
|
66 |
import in.shop2020.model.v1.order.DeviceNumberInfo;
|
| 77 |
import in.shop2020.model.v1.order.OrderType;
|
- |
|
| 78 |
import in.shop2020.model.v1.order.RechargeDenomination;
|
67 |
import in.shop2020.model.v1.order.RechargeDenomination;
|
| 79 |
import in.shop2020.model.v1.order.RechargeOrder;
|
68 |
import in.shop2020.model.v1.order.RechargeOrder;
|
| 80 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
- |
|
| 81 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
- |
|
| 82 |
|
- |
|
| 83 |
import in.shop2020.payments.Payment;
|
- |
|
| 84 |
import in.shop2020.payments.PaymentException;
|
- |
|
| 85 |
import in.shop2020.payments.PaymentStatus;
|
- |
|
| 86 |
import io.swagger.annotations.ApiImplicitParam;
|
69 |
import io.swagger.annotations.ApiImplicitParam;
|
| 87 |
import io.swagger.annotations.ApiImplicitParams;
|
70 |
import io.swagger.annotations.ApiImplicitParams;
|
| 88 |
import io.swagger.annotations.ApiOperation;
|
71 |
import io.swagger.annotations.ApiOperation;
|
| 89 |
|
72 |
|
| 90 |
@Controller
|
73 |
@Controller
|
| 91 |
@Transactional(rollbackFor=Throwable.class)
|
74 |
@Transactional(rollbackFor = Throwable.class)
|
| 92 |
public class RechargeController {
|
75 |
public class RechargeController {
|
| 93 |
|
76 |
|
| 94 |
private static final Logger log=LoggerFactory.getLogger(RechargeController.class);
|
77 |
private static final Logger log = LoggerFactory.getLogger(RechargeController.class);
|
| 95 |
private static final String HEADER_X_FORWARDED_FOR = "X-FORWARDED-FOR";
|
78 |
private static final String HEADER_X_FORWARDED_FOR = "X-FORWARDED-FOR";
|
| 96 |
|
79 |
|
| 97 |
private List<String> blockedRecharge = Arrays.asList();
|
80 |
private List<String> blockedRecharge = Arrays.asList();
|
| 98 |
private static final String X_REAL_IP = "X-Real-IP";
|
81 |
private static final String X_REAL_IP = "X-Real-IP";
|
| 99 |
@Value("${oxigen.recharge.transaction.url}")
|
82 |
@Value("${oxigen.recharge.transaction.url}")
|
| 100 |
private String oxigenRechargeTransactionUrl;
|
83 |
private String oxigenRechargeTransactionUrl;
|
| 101 |
|
84 |
|
| 102 |
@Value("${oxigen.recharge.enquiry.url}")
|
85 |
@Value("${oxigen.recharge.enquiry.url}")
|
| 103 |
private String oxigenRechargeEnquiryUrl;
|
86 |
private String oxigenRechargeEnquiryUrl;
|
| 104 |
|
87 |
|
| 105 |
@Value("${oxigen.recharge.auth.key}")
|
88 |
@Value("${oxigen.recharge.auth.key}")
|
| 106 |
private String oxigenRechargeAuthKey;
|
89 |
private String oxigenRechargeAuthKey;
|
| 107 |
|
90 |
|
| 108 |
@Value("${oxigen.recharge.validation.url}")
|
91 |
@Value("${oxigen.recharge.validation.url}")
|
| 109 |
private String oxigenRechargeValidationUrl;
|
92 |
private String oxigenRechargeValidationUrl;
|
| 110 |
|
93 |
|
| 111 |
@Value("${oxigen.recharge.validation.auth.key}")
|
94 |
@Value("${oxigen.recharge.validation.auth.key}")
|
| 112 |
private String oxigenRechargeValidationAuthKey;
|
95 |
private String oxigenRechargeValidationAuthKey;
|
| 113 |
|
96 |
|
| 114 |
@Value("${think.walnut.digital.recharge.transaction.mobile.url}")
|
97 |
@Value("${think.walnut.digital.recharge.transaction.mobile.url}")
|
| 115 |
private String thinkWalnutDigitalRechargeTransactionMobileUrl;
|
98 |
private String thinkWalnutDigitalRechargeTransactionMobileUrl;
|
| 116 |
|
99 |
|
| 117 |
@Value("${think.walnut.digital.recharge.transaction.mobile.username}")
|
100 |
@Value("${think.walnut.digital.recharge.transaction.mobile.username}")
|
| 118 |
private String thinkWalnutDigitalRechargeTransactionMobileUserName;
|
101 |
private String thinkWalnutDigitalRechargeTransactionMobileUserName;
|
| 119 |
|
102 |
|
| 120 |
@Value("${think.walnut.digital.recharge.transaction.mobile.password}")
|
103 |
@Value("${think.walnut.digital.recharge.transaction.mobile.password}")
|
| 121 |
private String thinkWalnutDigitalRechargeTransactionMobilePassword;
|
104 |
private String thinkWalnutDigitalRechargeTransactionMobilePassword;
|
| 122 |
|
105 |
|
| 123 |
@Value("${think.walnut.digital.recharge.transaction.dth.url}")
|
106 |
@Value("${think.walnut.digital.recharge.transaction.dth.url}")
|
| 124 |
private String thinkWalnutDigitalRechargeTransactionDthUrl;
|
107 |
private String thinkWalnutDigitalRechargeTransactionDthUrl;
|
| 125 |
|
108 |
|
| 126 |
@Value("${think.walnut.digital.recharge.transaction.dth.username}")
|
109 |
@Value("${think.walnut.digital.recharge.transaction.dth.username}")
|
| 127 |
private String thinkWalnutDigitalRechargeTransactionDthUserName;
|
110 |
private String thinkWalnutDigitalRechargeTransactionDthUserName;
|
| 128 |
|
111 |
|
| 129 |
@Value("${think.walnut.digital.recharge.transaction.dth.password}")
|
112 |
@Value("${think.walnut.digital.recharge.transaction.dth.password}")
|
| 130 |
private String thinkWalnutDigitalRechargeTransactionDthPassword;
|
113 |
private String thinkWalnutDigitalRechargeTransactionDthPassword;
|
| 131 |
|
114 |
|
| 132 |
@Value("${think.walnut.digital.recharge.enquiry.url}")
|
115 |
@Value("${think.walnut.digital.recharge.enquiry.url}")
|
| 133 |
private String thinkWalnutDigitalRechargeEnquiryUrl;
|
116 |
private String thinkWalnutDigitalRechargeEnquiryUrl;
|
| 134 |
|
117 |
|
| 135 |
@Value("${think.walnut.digital.recharge.enquiry.username}")
|
118 |
@Value("${think.walnut.digital.recharge.enquiry.username}")
|
| 136 |
private String thinkWalnutDigitalRechargeEnquiryUserName;
|
119 |
private String thinkWalnutDigitalRechargeEnquiryUserName;
|
| 137 |
|
120 |
|
| 138 |
@Value("${think.walnut.digital.recharge.enquiry.password}")
|
121 |
@Value("${think.walnut.digital.recharge.enquiry.password}")
|
| 139 |
private String thinkWalnutDigitalRechargeEnquiryPassword;
|
122 |
private String thinkWalnutDigitalRechargeEnquiryPassword;
|
| 140 |
|
123 |
|
| 141 |
@Value("${think.walnut.digital.recharge.auth.key}")
|
124 |
@Value("${think.walnut.digital.recharge.auth.key}")
|
| 142 |
private String thinkWalnutDigitalRechargeAuthKey;
|
125 |
private String thinkWalnutDigitalRechargeAuthKey;
|
| 143 |
|
126 |
|
| 144 |
@Autowired
|
127 |
@Autowired
|
| 145 |
UserWalletRepository userWalletRepository;
|
128 |
UserWalletRepository userWalletRepository;
|
| 146 |
|
129 |
|
| 147 |
@Autowired
|
130 |
@Autowired
|
| 148 |
private GenericRepository genericRepository;
|
131 |
private GenericRepository genericRepository;
|
| 149 |
|
132 |
|
| 150 |
@Autowired
|
133 |
@Autowired
|
| 151 |
private RechargeCommissionRepository rechargeCommissionRepository;
|
134 |
private RechargeCommissionRepository rechargeCommissionRepository;
|
| 152 |
|
135 |
|
| 153 |
@Autowired
|
136 |
@Autowired
|
| 154 |
private UserAccountRepository userAccountRepository;
|
137 |
private UserAccountRepository userAccountRepository;
|
| 155 |
|
138 |
|
| 156 |
@Autowired
|
139 |
@Autowired
|
| 157 |
private RechargeTransactionRepository rechargeTransactionRepository;
|
140 |
private RechargeTransactionRepository rechargeTransactionRepository;
|
| 158 |
|
141 |
|
| 159 |
@Autowired
|
142 |
@Autowired
|
| 160 |
private RechargeProviderRepository rechargeProviderRepository;
|
143 |
private RechargeProviderRepository rechargeProviderRepository;
|
| 161 |
|
144 |
|
| 162 |
@Autowired
|
145 |
@Autowired
|
| 163 |
private UserRepository userRepository;
|
146 |
private UserRepository userRepository;
|
| 164 |
|
147 |
|
| 165 |
@Autowired
|
148 |
@Autowired
|
| 166 |
private RechargeOperatorRepository rechargeOperatorRepository;
|
149 |
private RechargeOperatorRepository rechargeOperatorRepository;
|
| 167 |
|
150 |
|
| 168 |
@Autowired
|
151 |
@Autowired
|
| 169 |
private RechargeService rechargeService;
|
152 |
private RechargeService rechargeService;
|
| 170 |
|
153 |
|
| 171 |
@Autowired
|
154 |
@Autowired
|
| 172 |
private PendingRechargeCommissionRepository pendingRechargeCommissionRepository;
|
155 |
private PendingRechargeCommissionRepository pendingRechargeCommissionRepository;
|
| 173 |
|
156 |
|
| 174 |
@Autowired
|
157 |
@Autowired
|
| 175 |
private ResponseSender<?> responseSender;
|
158 |
private ResponseSender<?> responseSender;
|
| 176 |
|
159 |
|
| 177 |
private RechargeCredential rechargeTransactionMobileCredential;
|
160 |
private RechargeCredential rechargeTransactionMobileCredential;
|
| 178 |
private RechargeCredential rechargeTransactionDthCredential;
|
161 |
private RechargeCredential rechargeTransactionDthCredential;
|
| 179 |
private RechargeCredential thinkWalnutDigitalRechargeEnquiryCredential;
|
162 |
private RechargeCredential thinkWalnutDigitalRechargeEnquiryCredential;
|
| 180 |
|
163 |
|
| 181 |
@RequestMapping(value = ProfitMandiConstants.URL_GET_SERVICE_PROVIDER, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
164 |
@RequestMapping(value = ProfitMandiConstants.URL_GET_SERVICE_PROVIDER, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 182 |
@ApiImplicitParams({
|
165 |
@ApiImplicitParams({
|
| 183 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
166 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 184 |
required = true, dataType = "string", paramType = "header")
|
- |
|
| 185 |
})
|
- |
|
| 186 |
@ApiOperation(value = "")
|
167 |
@ApiOperation(value = "")
|
| 187 |
public ResponseEntity<?> getServiceProvider(HttpServletRequest request, @RequestParam(value="deviceNumber") String deviceNumber, @RequestParam(value="rechargeType") String rechargeType){
|
168 |
public ResponseEntity<?> getServiceProvider(HttpServletRequest request,
|
| - |
|
169 |
@RequestParam(value = "deviceNumber") String deviceNumber,
|
| - |
|
170 |
@RequestParam(value = "rechargeType") String rechargeType) {
|
| 188 |
DeviceNumberInfo deviceInfo = null;
|
171 |
DeviceNumberInfo deviceInfo = null;
|
| 189 |
TransactionClient tcl;
|
172 |
TransactionClient tcl;
|
| 190 |
try {
|
173 |
try {
|
| 191 |
tcl = new TransactionClient();
|
174 |
tcl = new TransactionClient();
|
| - |
|
175 |
// deviceInfo =
|
| 192 |
//deviceInfo = tcl.getClient().getServiceProviderForDevice(RechargeType.valueOf(rechargeType), deviceNumber.substring(0,4));
|
176 |
// tcl.getClient().getServiceProviderForDevice(RechargeType.valueOf(rechargeType),
|
| - |
|
177 |
// deviceNumber.substring(0,4));
|
| 193 |
} catch (Exception e) {
|
178 |
} catch (Exception e) {
|
| 194 |
log.error("Unable to get service provider for Device number " + deviceNumber + " and rechargeType : " + rechargeType, e);
|
179 |
log.error("Unable to get service provider for Device number " + deviceNumber + " and rechargeType : "
|
| - |
|
180 |
+ rechargeType, e);
|
| 195 |
}
|
181 |
}
|
| 196 |
return responseSender.ok(deviceInfo);
|
182 |
return responseSender.ok(deviceInfo);
|
| 197 |
}
|
183 |
}
|
| 198 |
|
184 |
|
| 199 |
@RequestMapping(value = ProfitMandiConstants.URL_GET_ALL_DENOMINATIONS, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
185 |
@RequestMapping(value = ProfitMandiConstants.URL_GET_ALL_DENOMINATIONS, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 200 |
@ApiImplicitParams({
|
186 |
@ApiImplicitParams({
|
| 201 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
187 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 202 |
required = true, dataType = "string", paramType = "header")
|
- |
|
| 203 |
})
|
- |
|
| 204 |
@ApiOperation(value = "")
|
188 |
@ApiOperation(value = "")
|
| - |
|
189 |
public ResponseEntity<?> getAllDenominations(HttpServletRequest request,
|
| 205 |
public ResponseEntity<?> getAllDenominations(HttpServletRequest request, @RequestParam(value="operatorId") long operatorId, @RequestParam(value="circleCode") String circleCode, @RequestParam(value="denominationType") String denominationType){
|
190 |
@RequestParam(value = "operatorId") long operatorId, @RequestParam(value = "circleCode") String circleCode,
|
| - |
|
191 |
@RequestParam(value = "denominationType") String denominationType) {
|
| 206 |
List<RechargeDenomination> rechargeDenominations = new ArrayList<RechargeDenomination>();
|
192 |
List<RechargeDenomination> rechargeDenominations = new ArrayList<RechargeDenomination>();
|
| 207 |
TransactionClient tcl;
|
193 |
TransactionClient tcl;
|
| 208 |
try {
|
194 |
try {
|
| 209 |
tcl = new TransactionClient();
|
195 |
tcl = new TransactionClient();
|
| 210 |
rechargeDenominations = tcl.getClient().getRechargeDenominations(operatorId, circleCode, DenominationType.valueOf(denominationType));
|
196 |
rechargeDenominations = tcl.getClient().getRechargeDenominations(operatorId, circleCode,
|
| - |
|
197 |
DenominationType.valueOf(denominationType));
|
| 211 |
} catch (Exception e) {
|
198 |
} catch (Exception e) {
|
| 212 |
log.error("Unable to get rechargeDenominations for operatorId " + operatorId + " and circleCode : " + circleCode + " and DenominationType : " + denominationType, e);
|
199 |
log.error("Unable to get rechargeDenominations for operatorId " + operatorId + " and circleCode : "
|
| - |
|
200 |
+ circleCode + " and DenominationType : " + denominationType, e);
|
| 213 |
}
|
201 |
}
|
| 214 |
return responseSender.ok(rechargeDenominations);
|
202 |
return responseSender.ok(rechargeDenominations);
|
| 215 |
}
|
203 |
}
|
| 216 |
|
204 |
|
| 217 |
@RequestMapping(value = ProfitMandiConstants.URL_MOBILE_OPERATORS, method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
205 |
@RequestMapping(value = ProfitMandiConstants.URL_MOBILE_OPERATORS, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 218 |
@ApiImplicitParams({
|
206 |
@ApiImplicitParams({
|
| 219 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
207 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 220 |
required = true, dataType = "string", paramType = "header")
|
- |
|
| 221 |
})
|
- |
|
| 222 |
|
208 |
|
| 223 |
@ApiOperation(value = "")
|
209 |
@ApiOperation(value = "")
|
| - |
|
210 |
public ResponseEntity<?> getAllMobileOperators(HttpServletRequest request,
|
| 224 |
public ResponseEntity<?> getAllMobileOperators(HttpServletRequest request,@RequestParam(name = ProfitMandiConstants.OPERATOR_TYPE) OperatorType operatorType){
|
211 |
@RequestParam(name = ProfitMandiConstants.OPERATOR_TYPE) OperatorType operatorType) {
|
| 225 |
Map<Integer, String> mobileProviderMap = new HashMap<>();
|
212 |
Map<Integer, String> mobileProviderMap = new HashMap<>();
|
| 226 |
List<RechargeOperator> rechargeOperators = rechargeOperatorRepository.selectAllByOperatorType(operatorType);
|
213 |
List<RechargeOperator> rechargeOperators = rechargeOperatorRepository.selectAllByOperatorType(operatorType);
|
| - |
|
214 |
// List<RechargeOperator> rechargeOperators =
|
| 227 |
// List<RechargeOperator> rechargeOperators = rechargeOperatorRepository.selectAllByRechargeType(RechargeType.MOBILE);
|
215 |
// rechargeOperatorRepository.selectAllByRechargeType(RechargeType.MOBILE);
|
| 228 |
for(RechargeOperator rechargeOperator : rechargeOperators) {
|
216 |
for (RechargeOperator rechargeOperator : rechargeOperators) {
|
| 229 |
mobileProviderMap.put(rechargeOperator.getId(), rechargeOperator.getName());
|
217 |
mobileProviderMap.put(rechargeOperator.getId(), rechargeOperator.getName());
|
| 230 |
}
|
218 |
}
|
| 231 |
return responseSender.ok(mobileProviderMap);
|
219 |
return responseSender.ok(mobileProviderMap);
|
| 232 |
}
|
220 |
}
|
| 233 |
|
221 |
|
| 234 |
@RequestMapping(value = ProfitMandiConstants.URL_DTH_OPERATORS, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
222 |
@RequestMapping(value = ProfitMandiConstants.URL_DTH_OPERATORS, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 235 |
@ApiImplicitParams({
|
223 |
@ApiImplicitParams({
|
| 236 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
224 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 237 |
required = true, dataType = "string", paramType = "header")
|
- |
|
| 238 |
})
|
- |
|
| 239 |
@ApiOperation(value = "")
|
225 |
@ApiOperation(value = "")
|
| 240 |
public ResponseEntity<?> getAllDTHOperators(HttpServletRequest request){
|
226 |
public ResponseEntity<?> getAllDTHOperators(HttpServletRequest request) {
|
| 241 |
Map<Integer, String> dthProviderMap = new HashMap<>();
|
227 |
Map<Integer, String> dthProviderMap = new HashMap<>();
|
| 242 |
List<RechargeOperator> dthOperators = rechargeOperatorRepository.selectAllByRechargeType(RechargeType.DTH);
|
228 |
List<RechargeOperator> dthOperators = rechargeOperatorRepository.selectAllByRechargeType(RechargeType.DTH);
|
| 243 |
for(RechargeOperator dthOperator : dthOperators) {
|
229 |
for (RechargeOperator dthOperator : dthOperators) {
|
| 244 |
dthProviderMap.put(dthOperator.getId(), dthOperator.getName());
|
230 |
dthProviderMap.put(dthOperator.getId(), dthOperator.getName());
|
| 245 |
}
|
231 |
}
|
| 246 |
return responseSender.ok(dthProviderMap);
|
232 |
return responseSender.ok(dthProviderMap);
|
| 247 |
|
- |
|
| 248 |
|
233 |
|
| 249 |
}
|
234 |
}
|
| 250 |
|
235 |
|
| 251 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_CONFIRM, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
236 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_CONFIRM, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 252 |
@ApiImplicitParams({
|
237 |
@ApiImplicitParams({
|
| 253 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
238 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 254 |
required = true, dataType = "string", paramType = "header")
|
- |
|
| 255 |
})
|
- |
|
| 256 |
@ApiOperation(value = "")
|
239 |
@ApiOperation(value = "")
|
| 257 |
public ResponseEntity<?> confirmRecharge(HttpServletRequest request, @RequestParam(value="rechargeAmount") long rechargeAmount)
|
240 |
public ResponseEntity<?> confirmRecharge(HttpServletRequest request,
|
| 258 |
throws ProfitMandiBusinessException{
|
241 |
@RequestParam(value = "rechargeAmount") long rechargeAmount) throws ProfitMandiBusinessException {
|
| 259 |
int userId = (int)request.getAttribute(ProfitMandiConstants.USER_ID);
|
242 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
| 260 |
UserAccount userAccount = null;
|
243 |
UserAccount userAccount = null;
|
| 261 |
UserWallet wallet = null;
|
244 |
UserWallet wallet = null;
|
| 262 |
if (rechargeAmount <=0){
|
245 |
if (rechargeAmount <= 0) {
|
| 263 |
return responseSender.badRequest(null);
|
246 |
return responseSender.badRequest(null);
|
| 264 |
}
|
247 |
}
|
| 265 |
|
248 |
|
| 266 |
userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.saholic);
|
249 |
userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.saholic);
|
| 267 |
|
250 |
|
| 268 |
try {
|
251 |
try {
|
| 269 |
TransactionClient tc = new TransactionClient();
|
252 |
TransactionClient tc = new TransactionClient();
|
| - |
|
253 |
// wallet =
|
| 270 |
//wallet = tc.getClient().getUserWallet(Long.valueOf(userAccount.getAccountKey()));
|
254 |
// tc.getClient().getUserWallet(Long.valueOf(userAccount.getAccountKey()));
|
| 271 |
} catch (NumberFormatException | TException e) {
|
255 |
} catch (NumberFormatException | TException e) {
|
| 272 |
return responseSender.internalServerError(e);
|
256 |
return responseSender.internalServerError(e);
|
| 273 |
}
|
257 |
}
|
| 274 |
|
258 |
|
| 275 |
ConfirmRechargeResponse crr = new ConfirmRechargeResponse();
|
259 |
ConfirmRechargeResponse crr = new ConfirmRechargeResponse();
|
| 276 |
//crr.setWalletAmount(wallet.getAmount());
|
260 |
// crr.setWalletAmount(wallet.getAmount());
|
| 277 |
crr.setWalletAmountLeft(wallet.getAmount() - rechargeAmount);
|
261 |
crr.setWalletAmountLeft(wallet.getAmount() - rechargeAmount);
|
| 278 |
crr.setCanProceed(true);
|
262 |
crr.setCanProceed(true);
|
| 279 |
if (crr.getWalletAmountLeft() < 0){
|
263 |
if (crr.getWalletAmountLeft() < 0) {
|
| 280 |
crr.setCanProceed(false);
|
264 |
crr.setCanProceed(false);
|
| 281 |
crr.setReason("You don't have sufficient wallet balance");
|
265 |
crr.setReason("You don't have sufficient wallet balance");
|
| 282 |
}
|
266 |
}
|
| 283 |
return responseSender.ok(crr);
|
267 |
return responseSender.ok(crr);
|
| 284 |
}
|
268 |
}
|
| 285 |
|
269 |
|
| 286 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_PENDING_COMMISSION, method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
270 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_PENDING_COMMISSION, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 287 |
@ApiImplicitParams({
|
271 |
@ApiImplicitParams({
|
| 288 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
272 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 289 |
required = true, dataType = "string", paramType = "header")
|
- |
|
| 290 |
})
|
- |
|
| 291 |
@ApiOperation(value = "")
|
273 |
@ApiOperation(value = "")
|
| 292 |
public ResponseEntity<?> getPendingRechargeCommission(HttpServletRequest request)
|
274 |
public ResponseEntity<?> getPendingRechargeCommission(HttpServletRequest request)
|
| 293 |
throws ProfitMandiBusinessException{
|
275 |
throws ProfitMandiBusinessException {
|
| 294 |
int userId = (int)request.getAttribute(ProfitMandiConstants.USER_ID);
|
276 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
| 295 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
277 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
| 296 |
return responseSender.ok(pendingRechargeCommissionRepository.selectByRetailerId(retailerId));
|
278 |
return responseSender.ok(pendingRechargeCommissionRepository.selectByRetailerId(retailerId));
|
| 297 |
}
|
279 |
}
|
| 298 |
|
280 |
|
| 299 |
private RechargeRequest convertRechargeRequest (CreateRechargeRequest createRechargeRequest ){
|
281 |
private RechargeRequest convertRechargeRequest(CreateRechargeRequest createRechargeRequest) {
|
| 300 |
RechargeRequest rr= new RechargeRequest();
|
282 |
RechargeRequest rr = new RechargeRequest();
|
| 301 |
rr.setAmount(createRechargeRequest.getRechargeAmount());
|
283 |
rr.setAmount(createRechargeRequest.getRechargeAmount());
|
| 302 |
rr.setOperatorId((int) createRechargeRequest.getOperatorId());
|
284 |
rr.setOperatorId((int) createRechargeRequest.getOperatorId());
|
| 303 |
rr.setOperatorType(createRechargeRequest.getPlan());
|
285 |
rr.setOperatorType(createRechargeRequest.getPlan());
|
| 304 |
rr.setReferenceNumber(createRechargeRequest.getNumber());
|
286 |
rr.setReferenceNumber(createRechargeRequest.getNumber());
|
| 305 |
rr.setRechargeType(createRechargeRequest.getRechargeType());
|
287 |
rr.setRechargeType(createRechargeRequest.getRechargeType());
|
| 306 |
|
288 |
|
| 307 |
Set<CustomPaymentOption> pp = new LinkedHashSet<>();
|
289 |
Set<CustomPaymentOption> pp = new LinkedHashSet<>();
|
| 308 |
CustomPaymentOption cpo = new CustomPaymentOption();
|
290 |
CustomPaymentOption cpo = new CustomPaymentOption();
|
| 309 |
cpo.setPaymentOption("cash");
|
291 |
cpo.setPaymentOption("cash");
|
| 310 |
cpo.setPaymentOptionId(1);
|
292 |
cpo.setPaymentOptionId(1);
|
| 311 |
cpo.setAmount(createRechargeRequest.getRechargeAmount());
|
293 |
cpo.setAmount(createRechargeRequest.getRechargeAmount());
|
| 312 |
pp.add(cpo);
|
294 |
pp.add(cpo);
|
| 313 |
rr.setPaymentOptions(pp);
|
295 |
rr.setPaymentOptions(pp);
|
| 314 |
return rr;
|
296 |
return rr;
|
| 315 |
}
|
297 |
}
|
| 316 |
|
298 |
|
| 317 |
@PostConstruct
|
299 |
@PostConstruct
|
| 318 |
private void setRechargeCredentials() {
|
300 |
private void setRechargeCredentials() {
|
| 319 |
rechargeTransactionMobileCredential = new RechargeCredential();
|
301 |
rechargeTransactionMobileCredential = new RechargeCredential();
|
| 320 |
rechargeTransactionMobileCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionMobileUrl);
|
302 |
rechargeTransactionMobileCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionMobileUrl);
|
| 321 |
rechargeTransactionMobileCredential.setRechargeUserName(thinkWalnutDigitalRechargeTransactionMobileUserName);
|
303 |
rechargeTransactionMobileCredential.setRechargeUserName(thinkWalnutDigitalRechargeTransactionMobileUserName);
|
| 322 |
rechargeTransactionMobileCredential.setRechargePassword(thinkWalnutDigitalRechargeTransactionMobilePassword);
|
304 |
rechargeTransactionMobileCredential.setRechargePassword(thinkWalnutDigitalRechargeTransactionMobilePassword);
|
| 323 |
rechargeTransactionMobileCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
305 |
rechargeTransactionMobileCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 324 |
|
306 |
|
| 325 |
rechargeTransactionDthCredential = new RechargeCredential();
|
307 |
rechargeTransactionDthCredential = new RechargeCredential();
|
| 326 |
rechargeTransactionDthCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionDthUrl);
|
308 |
rechargeTransactionDthCredential.setRechargeUrl(thinkWalnutDigitalRechargeTransactionDthUrl);
|
| 327 |
rechargeTransactionDthCredential.setRechargeUserName(thinkWalnutDigitalRechargeTransactionDthUserName);
|
309 |
rechargeTransactionDthCredential.setRechargeUserName(thinkWalnutDigitalRechargeTransactionDthUserName);
|
| 328 |
rechargeTransactionDthCredential.setRechargePassword(thinkWalnutDigitalRechargeTransactionDthPassword);
|
310 |
rechargeTransactionDthCredential.setRechargePassword(thinkWalnutDigitalRechargeTransactionDthPassword);
|
| 329 |
rechargeTransactionDthCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
311 |
rechargeTransactionDthCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 330 |
}
|
312 |
}
|
| 331 |
|
313 |
|
| 332 |
@RequestMapping(value = ProfitMandiConstants.URL_CREATE_RECHARGE , method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
314 |
@RequestMapping(value = ProfitMandiConstants.URL_CREATE_RECHARGE, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 333 |
@ApiImplicitParams({
|
315 |
@ApiImplicitParams({
|
| 334 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
316 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 335 |
required = true, dataType = "string", paramType = "header")
|
- |
|
| 336 |
})
|
- |
|
| 337 |
|
317 |
|
| 338 |
public ResponseEntity<?> createRecharge(HttpServletRequest request, @RequestBody CreateRechargeRequest createRechargeRequest)
|
318 |
public ResponseEntity<?> createRechargeDown(HttpServletRequest request,
|
| 339 |
throws ProfitMandiBusinessException{
|
319 |
@RequestBody CreateRechargeRequest createRechargeRequest) throws ProfitMandiBusinessException {
|
| - |
|
320 |
|
| 340 |
int userId = (int)request.getAttribute(ProfitMandiConstants.USER_ID);
|
321 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
| 341 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
322 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
| - |
|
323 |
|
| - |
|
324 |
CreateRechargeResponse crr = new CreateRechargeResponse();
|
| 342 |
String ipAddress = remoteAddr(request);
|
325 |
String ipAddress = remoteAddr(request);
|
| - |
|
326 |
log.info("IP Address is {}", ipAddress);
|
| - |
|
327 |
|
| - |
|
328 |
crr.setResult(true);
|
| - |
|
329 |
crr.setRequestId("RECHARGE00050");
|
| - |
|
330 |
return responseSender.ok(crr);
|
| - |
|
331 |
|
| 343 |
|
332 |
}
|
| - |
|
333 |
|
| - |
|
334 |
public ResponseEntity<?> createRecharge(HttpServletRequest request,
|
| - |
|
335 |
@RequestBody CreateRechargeRequest createRechargeRequest) throws ProfitMandiBusinessException {
|
| - |
|
336 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
| - |
|
337 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
| - |
|
338 |
String ipAddress = remoteAddr(request);
|
| - |
|
339 |
|
| 344 |
CreateRechargeResponse crr = new CreateRechargeResponse();
|
340 |
CreateRechargeResponse crr = new CreateRechargeResponse();
|
| 345 |
|
341 |
|
| 346 |
UserAccount userAccount = null;
|
342 |
UserAccount userAccount = null;
|
| 347 |
UserWallet wallet = null;
|
343 |
UserWallet wallet = null;
|
| 348 |
wallet = userWalletRepository.selectByRetailerId(retailerId);
|
344 |
wallet = userWalletRepository.selectByRetailerId(retailerId);
|
| 349 |
|
345 |
|
| 350 |
if (createRechargeRequest.getRechargeAmount() <=0){
|
346 |
if (createRechargeRequest.getRechargeAmount() <= 0) {
|
| 351 |
crr.setReason("Illegal recharge amount");
|
347 |
crr.setReason("Illegal recharge amount");
|
| 352 |
crr.setResult(false);
|
348 |
crr.setResult(false);
|
| 353 |
return responseSender.badRequest(crr);
|
349 |
return responseSender.badRequest(crr);
|
| 354 |
}
|
350 |
}
|
| 355 |
|
351 |
|
| 356 |
if (wallet.getAmount() < createRechargeRequest.getRechargeAmount()){
|
352 |
if (wallet.getAmount() < createRechargeRequest.getRechargeAmount()) {
|
| 357 |
crr.setReason("You don't have sufficient wallet balance.");
|
353 |
crr.setReason("You don't have sufficient wallet balance.");
|
| 358 |
crr.setResult(false);
|
354 |
crr.setResult(false);
|
| 359 |
return responseSender.badRequest(crr);
|
355 |
return responseSender.badRequest(crr);
|
| 360 |
}
|
356 |
}
|
| 361 |
|
357 |
|
| 362 |
User user = null;
|
358 |
User user = null;
|
| 363 |
try {
|
359 |
try {
|
| 364 |
user = userRepository.selectById(userId);
|
360 |
user = userRepository.selectById(userId);
|
| 365 |
} catch (ProfitMandiBusinessException e) {
|
361 |
} catch (ProfitMandiBusinessException e) {
|
| 366 |
log.error("Unable to get user",e);
|
362 |
log.error("Unable to get user", e);
|
| 367 |
crr.setReason("We are experiencing some problem right now.");
|
363 |
crr.setReason("We are experiencing some problem right now.");
|
| 368 |
crr.setResult(false);
|
364 |
crr.setResult(false);
|
| 369 |
return responseSender.internalServerError(e);
|
365 |
return responseSender.internalServerError(e);
|
| 370 |
}
|
366 |
}
|
| 371 |
|
367 |
|
| 372 |
|
- |
|
| 373 |
RechargeRequest rechargeRequest = convertRechargeRequest(createRechargeRequest);
|
368 |
RechargeRequest rechargeRequest = convertRechargeRequest(createRechargeRequest);
|
| 374 |
if(blockedRecharge.contains(user.getEmailId())) {
|
369 |
if (blockedRecharge.contains(user.getEmailId())) {
|
| 375 |
throw new ProfitMandiBusinessException("Recharge Provider", createRechargeRequest.getOperatorId(), "We are experiencing some problem right now.");
|
370 |
throw new ProfitMandiBusinessException("Recharge Provider", createRechargeRequest.getOperatorId(),
|
| - |
|
371 |
"We are experiencing some problem right now.");
|
| 376 |
}
|
372 |
}
|
| 377 |
RechargeResponse rechargeResponse = rechargeService.doRecharge(oxigenRechargeTransactionUrl, oxigenRechargeAuthKey, oxigenRechargeValidationUrl,
|
373 |
RechargeResponse rechargeResponse = rechargeService.doRecharge(oxigenRechargeTransactionUrl,
|
| - |
|
374 |
oxigenRechargeAuthKey, oxigenRechargeValidationUrl, oxigenRechargeValidationAuthKey,
|
| 378 |
oxigenRechargeValidationAuthKey, rechargeTransactionMobileCredential, rechargeTransactionDthCredential, retailerId, rechargeRequest);
|
375 |
rechargeTransactionMobileCredential, rechargeTransactionDthCredential, retailerId, rechargeRequest);
|
| 379 |
|
376 |
|
| 380 |
crr.setResult(rechargeResponse.getStatus().equals(RechargeStatus.SUCCESS));
|
377 |
crr.setResult(rechargeResponse.getStatus().equals(RechargeStatus.SUCCESS));
|
| 381 |
crr.setRequestId(rechargeResponse.getRequestId());
|
378 |
crr.setRequestId(rechargeResponse.getRequestId());
|
| 382 |
|
379 |
|
| 383 |
if(RechargeType.valueOf(rechargeRequest.getRechargeType()) == RechargeType.MOBILE) {
|
380 |
if (RechargeType.valueOf(rechargeRequest.getRechargeType()) == RechargeType.MOBILE) {
|
| 384 |
return responseSender.ok(crr);
|
381 |
return responseSender.ok(crr);
|
| 385 |
}else {
|
382 |
} else {
|
| 386 |
return responseSender.ok(crr);
|
383 |
return responseSender.ok(crr);
|
| 387 |
}
|
384 |
}
|
| 388 |
}
|
385 |
}
|
| 389 |
|
386 |
|
| 390 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_SUMMARY , method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
387 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_SUMMARY, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 391 |
@ApiImplicitParams({
|
388 |
@ApiImplicitParams({
|
| 392 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
389 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 393 |
required = true, dataType = "string", paramType = "header")
|
390 |
public ResponseEntity<?> rechargeSummary(HttpServletRequest request,
|
| 394 |
})
|
- |
|
| 395 |
public ResponseEntity<?>rechargeSummary (HttpServletRequest request , @RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "10") int limit)
|
391 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 396 |
throws ProfitMandiBusinessException{
|
392 |
@RequestParam(name = "limit", defaultValue = "10") int limit) throws ProfitMandiBusinessException {
|
| 397 |
int userId = (int)request.getAttribute(ProfitMandiConstants.USER_ID);
|
393 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
| 398 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
394 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
| 399 |
//RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
395 |
// RechargeType rechargeType = RechargeType.valueOf(rechargeTypeString);
|
| 400 |
List<RechargeTransaction> rechargeTransactions =rechargeTransactionRepository.selectAllByRetailerId(retailerId, offset, limit);
|
396 |
List<RechargeTransaction> rechargeTransactions = rechargeTransactionRepository.selectAllByRetailerId(retailerId,
|
| - |
|
397 |
offset, limit);
|
| 401 |
for (RechargeTransaction rechargeTransaction : rechargeTransactions) {
|
398 |
for (RechargeTransaction rechargeTransaction : rechargeTransactions) {
|
| 402 |
String operatorName=rechargeOperatorRepository.selectById(rechargeTransaction.getOperatorId()).getName();
|
399 |
String operatorName = rechargeOperatorRepository.selectById(rechargeTransaction.getOperatorId()).getName();
|
| 403 |
rechargeTransaction.setOperatorName(operatorName);
|
400 |
rechargeTransaction.setOperatorName(operatorName);
|
| 404 |
}
|
401 |
}
|
| 405 |
|
402 |
|
| 406 |
return responseSender.ok(rechargeTransactions);
|
403 |
return responseSender.ok(rechargeTransactions);
|
| 407 |
|
404 |
|
| 408 |
|
- |
|
| 409 |
}
|
405 |
}
|
| 410 |
|
406 |
|
| 411 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_COMMISSIONS , method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
407 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_COMMISSIONS, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 412 |
@ApiImplicitParams({
|
408 |
@ApiImplicitParams({
|
| 413 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
409 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 414 |
required = true, dataType = "string", paramType = "header")
|
410 |
public ResponseEntity<?> rechargeCommissions(HttpServletRequest request,
|
| 415 |
})
|
- |
|
| 416 |
public ResponseEntity<?>rechargeCommissions (HttpServletRequest request,@RequestParam(name = "offset", defaultValue = "0") int offset, @RequestParam(name = "limit", defaultValue = "60") int limit)
|
411 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 417 |
throws ProfitMandiBusinessException{
|
412 |
@RequestParam(name = "limit", defaultValue = "60") int limit) throws ProfitMandiBusinessException {
|
| 418 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
413 |
List<RechargeCommission> rechargeCommissions = rechargeCommissionRepository.selectAllPaginated(offset, limit);
|
| 419 |
for (RechargeCommission rechargeCommission : rechargeCommissions) {
|
414 |
for (RechargeCommission rechargeCommission : rechargeCommissions) {
|
| 420 |
String operatorName=rechargeOperatorRepository.selectById(rechargeCommission.getOperatorId()).getName();
|
415 |
String operatorName = rechargeOperatorRepository.selectById(rechargeCommission.getOperatorId()).getName();
|
| 421 |
RechargeType rechargeType=rechargeOperatorRepository.selectById(rechargeCommission.getOperatorId()).getRechargeType();
|
416 |
RechargeType rechargeType = rechargeOperatorRepository.selectById(rechargeCommission.getOperatorId())
|
| - |
|
417 |
.getRechargeType();
|
| 422 |
OperatorType operatorType=rechargeOperatorRepository.selectById(rechargeCommission.getOperatorId()).getOperatorType();
|
418 |
OperatorType operatorType = rechargeOperatorRepository.selectById(rechargeCommission.getOperatorId())
|
| - |
|
419 |
.getOperatorType();
|
| 423 |
rechargeCommission.setOperatorName(operatorName);
|
420 |
rechargeCommission.setOperatorName(operatorName);
|
| 424 |
rechargeCommission.setRechargeType(rechargeType);
|
421 |
rechargeCommission.setRechargeType(rechargeType);
|
| 425 |
rechargeCommission.setOperatorType(operatorType);
|
422 |
rechargeCommission.setOperatorType(operatorType);
|
| 426 |
}
|
423 |
}
|
| 427 |
Map<Integer,RechargeCommission> commissionMap = rechargeCommissions.stream().collect(Collectors.groupingBy(RechargeCommission::getOperatorId, Collectors.collectingAndThen(
|
424 |
Map<Integer, RechargeCommission> commissionMap = rechargeCommissions.stream()
|
| - |
|
425 |
.collect(
|
| - |
|
426 |
Collectors
|
| - |
|
427 |
.groupingBy(RechargeCommission::getOperatorId,
|
| - |
|
428 |
Collectors
|
| - |
|
429 |
.collectingAndThen(
|
| - |
|
430 |
Collectors
|
| - |
|
431 |
.reducing((RechargeCommission d1,
|
| 428 |
Collectors.reducing((RechargeCommission d1,RechargeCommission d2) -> d1.getAmount() > d2.getAmount() ? d1 : d2),
|
432 |
RechargeCommission d2) -> d1.getAmount() > d2
|
| - |
|
433 |
.getAmount() ? d1 : d2),
|
| 429 |
Optional::get)));
|
434 |
Optional::get)));
|
| 430 |
|
435 |
|
| 431 |
return responseSender.ok(commissionMap.values());
|
436 |
return responseSender.ok(commissionMap.values());
|
| 432 |
}
|
437 |
}
|
| 433 |
|
438 |
|
| 434 |
@PostConstruct
|
439 |
@PostConstruct
|
| 435 |
private void setRechargeEnquiryCredentials() {
|
440 |
private void setRechargeEnquiryCredentials() {
|
| 436 |
thinkWalnutDigitalRechargeEnquiryCredential = new RechargeCredential();
|
441 |
thinkWalnutDigitalRechargeEnquiryCredential = new RechargeCredential();
|
| 437 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUrl(thinkWalnutDigitalRechargeEnquiryUrl);
|
442 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUrl(thinkWalnutDigitalRechargeEnquiryUrl);
|
| 438 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUserName(thinkWalnutDigitalRechargeEnquiryUserName);
|
443 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeUserName(thinkWalnutDigitalRechargeEnquiryUserName);
|
| 439 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargePassword(thinkWalnutDigitalRechargeEnquiryPassword);
|
444 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargePassword(thinkWalnutDigitalRechargeEnquiryPassword);
|
| 440 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
445 |
thinkWalnutDigitalRechargeEnquiryCredential.setRechargeAuthKey(thinkWalnutDigitalRechargeAuthKey);
|
| 441 |
}
|
446 |
}
|
| 442 |
|
447 |
|
| 443 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_RESULT , method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
448 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_RESULT, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 444 |
@ApiImplicitParams({
|
449 |
@ApiImplicitParams({
|
| 445 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
450 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 446 |
required = true, dataType = "string", paramType = "header")
|
- |
|
| 447 |
})
|
- |
|
| 448 |
|
- |
|
| 449 |
|
451 |
|
| - |
|
452 |
public ResponseEntity<?> rechargeResult(HttpServletRequest request,
|
| 450 |
public ResponseEntity<?> rechargeResult(HttpServletRequest request, @RequestParam(value="requestId") String requestId ) throws ProfitMandiBusinessException{
|
453 |
@RequestParam(value = "requestId") String requestId) throws ProfitMandiBusinessException {
|
| 451 |
RechargeOrder rechargeOrder = null;
|
454 |
RechargeOrder rechargeOrder = null;
|
| 452 |
RechargeResultPojo rrp = null;
|
455 |
RechargeResultPojo rrp = null;
|
| 453 |
|
- |
|
| 454 |
|
456 |
|
| 455 |
//RechargeResponse rr = new RechargeResponse();
|
457 |
// RechargeResponse rr = new RechargeResponse();
|
| 456 |
//String requestId = rr.getRequestId();
|
458 |
// String requestId = rr.getRequestId();
|
| 457 |
int userId = (int)request.getAttribute(ProfitMandiConstants.USER_ID);
|
459 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
| 458 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
460 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
| 459 |
|
461 |
|
| 460 |
RechargeResponse rechargeResponse = rechargeService.checkStatus(oxigenRechargeEnquiryUrl, oxigenRechargeAuthKey, thinkWalnutDigitalRechargeEnquiryCredential,retailerId , requestId);
|
462 |
RechargeResponse rechargeResponse = rechargeService.checkStatus(oxigenRechargeEnquiryUrl, oxigenRechargeAuthKey,
|
| - |
|
463 |
thinkWalnutDigitalRechargeEnquiryCredential, retailerId, requestId);
|
| 461 |
return responseSender.ok(rechargeResponse);
|
464 |
return responseSender.ok(rechargeResponse);
|
| 462 |
}
|
465 |
}
|
| 463 |
|
466 |
|
| 464 |
@RequestMapping(value = ProfitMandiConstants.URL_POLL_RECHARGE , method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
467 |
@RequestMapping(value = ProfitMandiConstants.URL_POLL_RECHARGE, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 465 |
@ApiImplicitParams({
|
468 |
@ApiImplicitParams({
|
| 466 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
469 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| - |
|
470 |
public ResponseEntity<?> pollRechargeResult(HttpServletRequest request,
|
| 467 |
required = true, dataType = "string", paramType = "header")
|
471 |
@RequestParam(value = "rechargeOrderId") long rechargeOrderId,
|
| 468 |
})
|
- |
|
| 469 |
public ResponseEntity<?> pollRechargeResult(HttpServletRequest request, @RequestParam(value="rechargeOrderId") long rechargeOrderId, @RequestParam(value="finalCall") boolean finalCall){
|
472 |
@RequestParam(value = "finalCall") boolean finalCall) {
|
| 470 |
TransactionClient transactionServiceClient = null;
|
473 |
TransactionClient transactionServiceClient = null;
|
| 471 |
RechargeOrder t_rechargeOrder = null;
|
474 |
RechargeOrder t_rechargeOrder = null;
|
| 472 |
RechargeResultPojo rrp = null;
|
475 |
RechargeResultPojo rrp = null;
|
| 473 |
try{
|
476 |
try {
|
| 474 |
transactionServiceClient = new TransactionClient();
|
477 |
transactionServiceClient = new TransactionClient();
|
| 475 |
t_rechargeOrder = transactionServiceClient.getClient().getRcgOrderStatus(rechargeOrderId, finalCall);
|
478 |
t_rechargeOrder = transactionServiceClient.getClient().getRcgOrderStatus(rechargeOrderId, finalCall);
|
| 476 |
}
|
- |
|
| 477 |
catch(Exception e){
|
479 |
} catch (Exception e) {
|
| 478 |
rrp = new RechargeResultPojo();
|
480 |
rrp = new RechargeResultPojo();
|
| 479 |
rrp.setRechargeStatus("");
|
481 |
rrp.setRechargeStatus("");
|
| 480 |
return responseSender.internalServerError(e);
|
482 |
return responseSender.internalServerError(e);
|
| 481 |
}
|
483 |
}
|
| 482 |
if (t_rechargeOrder == null){
|
484 |
if (t_rechargeOrder == null) {
|
| 483 |
rrp = new RechargeResultPojo();
|
485 |
rrp = new RechargeResultPojo();
|
| 484 |
rrp.setRechargeStatus("");
|
486 |
rrp.setRechargeStatus("");
|
| 485 |
return responseSender.badRequest(new RechargeResultPojo());
|
487 |
return responseSender.badRequest(new RechargeResultPojo());
|
| 486 |
}
|
488 |
}
|
| 487 |
rrp = new RechargeResultPojo();
|
489 |
rrp = new RechargeResultPojo();
|
| Line 489... |
Line 491... |
| 489 |
rrp.setIsError(Boolean.parseBoolean(os[0]));
|
491 |
rrp.setIsError(Boolean.parseBoolean(os[0]));
|
| 490 |
rrp.setRechargeStatus(os[1]);
|
492 |
rrp.setRechargeStatus(os[1]);
|
| 491 |
rrp.setDetailDisplayMessage(os[2]);
|
493 |
rrp.setDetailDisplayMessage(os[2]);
|
| 492 |
return responseSender.ok(rrp);
|
494 |
return responseSender.ok(rrp);
|
| 493 |
}
|
495 |
}
|
| 494 |
|
496 |
|
| 495 |
@RequestMapping(value = ProfitMandiConstants.URL_MY_RECHARGES , method=RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
497 |
@RequestMapping(value = ProfitMandiConstants.URL_MY_RECHARGES, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 496 |
@ApiImplicitParams({
|
498 |
@ApiImplicitParams({
|
| 497 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
499 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 498 |
required = true, dataType = "string", paramType = "header")
|
500 |
public ResponseEntity<?> myRecharges(HttpServletRequest request, @RequestParam(value = "offset") int offset,
|
| 499 |
})
|
- |
|
| 500 |
public ResponseEntity<?> myRecharges(HttpServletRequest request, @RequestParam(value="offset") int offset, @RequestParam(value="limit") int limit) throws ProfitMandiBusinessException{
|
501 |
@RequestParam(value = "limit") int limit) throws ProfitMandiBusinessException {
|
| 501 |
TransactionClient tc=null;
|
502 |
TransactionClient tc = null;
|
| 502 |
int userId = (int)request.getAttribute("userId");
|
503 |
int userId = (int) request.getAttribute("userId");
|
| 503 |
UserAccount userAccount;
|
504 |
UserAccount userAccount;
|
| 504 |
List<RechargeOrder> rechargeOrders = null;
|
505 |
List<RechargeOrder> rechargeOrders = null;
|
| 505 |
|
506 |
|
| 506 |
userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.saholic);
|
507 |
userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.saholic);
|
| 507 |
|
508 |
|
| 508 |
try {
|
509 |
try {
|
| 509 |
tc = new TransactionClient();
|
510 |
tc = new TransactionClient();
|
| 510 |
rechargeOrders = tc.getClient().getPaginatedRechargeOrders(Long.valueOf(userAccount.getAccountKey()), offset, limit);
|
511 |
rechargeOrders = tc.getClient().getPaginatedRechargeOrders(Long.valueOf(userAccount.getAccountKey()),
|
| - |
|
512 |
offset, limit);
|
| 511 |
} catch (Exception e) {
|
513 |
} catch (Exception e) {
|
| 512 |
log.error("Unable to get recharge order list",e);
|
514 |
log.error("Unable to get recharge order list", e);
|
| 513 |
return responseSender.internalServerError(e);
|
515 |
return responseSender.internalServerError(e);
|
| 514 |
}
|
516 |
}
|
| 515 |
List<MyRechargesResponse> myRechargesList = new ArrayList<MyRechargesResponse>();
|
517 |
List<MyRechargesResponse> myRechargesList = new ArrayList<MyRechargesResponse>();
|
| 516 |
for (RechargeOrder rechargeOrder : rechargeOrders){
|
518 |
for (RechargeOrder rechargeOrder : rechargeOrders) {
|
| 517 |
MyRechargesResponse rp = new MyRechargesResponse();
|
519 |
MyRechargesResponse rp = new MyRechargesResponse();
|
| - |
|
520 |
/*
|
| 518 |
/* if(rechargeOrder.getRechargeType() == RechargeType.MOBILE){
|
521 |
* if(rechargeOrder.getRechargeType() == RechargeType.MOBILE){
|
| 519 |
rp.setOperator(Utils.getProvider(rechargeOrder.getOperatorId()));
|
522 |
* rp.setOperator(Utils.getProvider(rechargeOrder.getOperatorId()));
|
| 520 |
rp.setOperatorType("MOBILE");
|
523 |
* rp.setOperatorType("MOBILE"); } if(rechargeOrder.getRechargeType() ==
|
| 521 |
}
|
- |
|
| 522 |
if(rechargeOrder.getRechargeType() == RechargeType.DTH){
|
524 |
* RechargeType.DTH){
|
| 523 |
rp.setOperator(Utils.getProvider(rechargeOrder.getOperatorId()));
|
525 |
* rp.setOperator(Utils.getProvider(rechargeOrder.getOperatorId()));
|
| 524 |
rp.setOperatorType("DTH");
|
526 |
* rp.setOperatorType("DTH"); }
|
| 525 |
}*/
|
527 |
*/
|
| 526 |
rp.setOrderId(rechargeOrder.getId());
|
528 |
rp.setOrderId(rechargeOrder.getId());
|
| 527 |
rp.setOperatorId(rechargeOrder.getOperatorId());
|
529 |
rp.setOperatorId(rechargeOrder.getOperatorId());
|
| 528 |
rp.setDate(rechargeOrder.getCreationTimestamp());
|
530 |
rp.setDate(rechargeOrder.getCreationTimestamp());
|
| 529 |
rp.setNumber(rechargeOrder.getDeviceNumber());
|
531 |
rp.setNumber(rechargeOrder.getDeviceNumber());
|
| 530 |
rp.setAmount(rechargeOrder.getTotalAmount());
|
532 |
rp.setAmount(rechargeOrder.getTotalAmount());
|
| 531 |
rp.setStatus(Utils.getRechargeDisplayStatus(rechargeOrder.getStatus()));
|
533 |
rp.setStatus(Utils.getRechargeDisplayStatus(rechargeOrder.getStatus()));
|
| 532 |
rp.setDisplayOrderId(rechargeOrder.getDisplayId());
|
534 |
rp.setDisplayOrderId(rechargeOrder.getDisplayId());
|
| 533 |
myRechargesList.add(rp);
|
535 |
myRechargesList.add(rp);
|
| 534 |
}
|
536 |
}
|
| 535 |
return responseSender.ok(myRechargesList);
|
537 |
return responseSender.ok(myRechargesList);
|
| 536 |
}
|
538 |
}
|
| 537 |
|
539 |
|
| 538 |
|
- |
|
| 539 |
private String remoteAddr(HttpServletRequest request) {
|
540 |
private String remoteAddr(HttpServletRequest request) {
|
| 540 |
String remoteAddr = "";
|
541 |
String remoteAddr = "";
|
| 541 |
String x;
|
542 |
String x;
|
| 542 |
x = request.getHeader(X_REAL_IP);
|
543 |
x = request.getHeader(X_REAL_IP);
|
| 543 |
log.info("Value of X_REAL_IP is [{}]", x);
|
544 |
log.info("Value of X_REAL_IP is [{}]", x);
|
| Line 552... |
Line 553... |
| 552 |
log.info("Value of remoteAddr is [{}]", remoteAddr);
|
553 |
log.info("Value of remoteAddr is [{}]", remoteAddr);
|
| 553 |
}
|
554 |
}
|
| 554 |
return remoteAddr;
|
555 |
return remoteAddr;
|
| 555 |
}
|
556 |
}
|
| 556 |
|
557 |
|
| - |
|
558 |
/*
|
| 557 |
/*private String validateRecharge(RechargeType rechargeType, String number, long operatorId, String ipAddress){
|
559 |
* private String validateRecharge(RechargeType rechargeType, String number,
|
| 558 |
TransactionClient tcl;
|
560 |
* long operatorId, String ipAddress){ TransactionClient tcl; try { tcl = new
|
| 559 |
try {
|
- |
|
| 560 |
tcl = new TransactionClient();
|
561 |
* TransactionClient(); // String result =
|
| 561 |
// String result = tcl.getClient().validateRecharge(rechargeType, number, operatorId, ipAddress);
|
562 |
* tcl.getClient().validateRecharge(rechargeType, number, operatorId,
|
| - |
|
563 |
* ipAddress); //log.info("validateRecharge Called" + number +
|
| 562 |
//log.info("validateRecharge Called" + number + " and rechargeType : " + rechargeType + ", IP:" + ipAddress + ", Operator:" + operatorId + ", Result:" + result);
|
564 |
* " and rechargeType : " + rechargeType + ", IP:" + ipAddress + ", Operator:" +
|
| 563 |
//return result;
|
- |
|
| 564 |
} catch (Exception e) {
|
565 |
* operatorId + ", Result:" + result); //return result; } catch (Exception e) {
|
| 565 |
log.error("Unable to get service provider for Device number " + number + " and rechargeType : " + rechargeType, e);
|
566 |
* log.error("Unable to get service provider for Device number " + number +
|
| 566 |
}
|
- |
|
| - |
|
567 |
* " and rechargeType : " + rechargeType, e); } return
|
| 567 |
return "Oops! There seems to be a problem. Please try after some time";
|
568 |
* "Oops! There seems to be a problem. Please try after some time"; }
|
| 568 |
}*/
|
569 |
*/
|
| 569 |
|
- |
|
| 570 |
|
570 |
|
| 571 |
}
|
571 |
}
|