| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
|
2 |
|
| 3 |
import java.time.LocalDateTime;
|
- |
|
| 4 |
import java.util.ArrayList;
|
3 |
import java.util.ArrayList;
|
| 5 |
import java.util.List;
|
4 |
import java.util.List;
|
| 6 |
import java.util.Map;
|
5 |
import java.util.Map;
|
| 7 |
|
6 |
|
| 8 |
import javax.servlet.http.HttpServletRequest;
|
7 |
import javax.servlet.http.HttpServletRequest;
|
| Line 10... |
Line 9... |
| 10 |
import org.apache.thrift.TException;
|
9 |
import org.apache.thrift.TException;
|
| 11 |
import org.apache.thrift.transport.TTransportException;
|
10 |
import org.apache.thrift.transport.TTransportException;
|
| 12 |
import org.slf4j.Logger;
|
11 |
import org.slf4j.Logger;
|
| 13 |
import org.slf4j.LoggerFactory;
|
12 |
import org.slf4j.LoggerFactory;
|
| 14 |
import org.springframework.beans.factory.annotation.Autowired;
|
13 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 15 |
import org.springframework.http.HttpStatus;
|
- |
|
| 16 |
import org.springframework.http.MediaType;
|
14 |
import org.springframework.http.MediaType;
|
| 17 |
import org.springframework.http.ResponseEntity;
|
15 |
import org.springframework.http.ResponseEntity;
|
| 18 |
import org.springframework.stereotype.Controller;
|
16 |
import org.springframework.stereotype.Controller;
|
| 19 |
import org.springframework.transaction.annotation.Transactional;
|
17 |
import org.springframework.transaction.annotation.Transactional;
|
| 20 |
import org.springframework.web.bind.annotation.RequestBody;
|
18 |
import org.springframework.web.bind.annotation.RequestBody;
|
| Line 22... |
Line 20... |
| 22 |
import org.springframework.web.bind.annotation.RequestMethod;
|
20 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 23 |
import org.springframework.web.bind.annotation.RequestParam;
|
21 |
import org.springframework.web.bind.annotation.RequestParam;
|
| 24 |
|
22 |
|
| 25 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
23 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 26 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
24 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 27 |
import com.spice.profitmandi.common.model.ProfitMandiResponse;
|
- |
|
| 28 |
import com.spice.profitmandi.common.model.ResponseStatus;
|
- |
|
| 29 |
import com.spice.profitmandi.common.util.Utils;
|
25 |
import com.spice.profitmandi.common.util.Utils;
|
| 30 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
26 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 31 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
27 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 32 |
import com.spice.profitmandi.dao.entity.dtr.UserAccounts;
|
28 |
import com.spice.profitmandi.dao.entity.dtr.UserAccounts;
|
| 33 |
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
|
29 |
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
|
| Line 279... |
Line 275... |
| 279 |
log.error("Unable to mark the payment as authorized", e);
|
275 |
log.error("Unable to mark the payment as authorized", e);
|
| 280 |
crr.setReason("We are experiencing some problem right now.");
|
276 |
crr.setReason("We are experiencing some problem right now.");
|
| 281 |
crr.setResult(false);
|
277 |
crr.setResult(false);
|
| 282 |
return responseSender.internalServerError(e);
|
278 |
return responseSender.internalServerError(e);
|
| 283 |
}
|
279 |
}
|
| 284 |
final ProfitMandiResponse<?> profitMandiResponse=new ProfitMandiResponse<>(LocalDateTime.now(), request.getRequestURL().toString() , HttpStatus.OK.toString(), HttpStatus.OK, ResponseStatus.SUCCESS, crr);
|
- |
|
| 285 |
return new ResponseEntity<>(profitMandiResponse,HttpStatus.OK);
|
280 |
return responseSender.ok(crr);
|
| 286 |
}
|
281 |
}
|
| 287 |
|
282 |
|
| 288 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_RESULT , method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
283 |
@RequestMapping(value = ProfitMandiConstants.URL_RECHARGE_RESULT , method=RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
| 289 |
@ApiImplicitParams({
|
284 |
@ApiImplicitParams({
|
| 290 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|
285 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token",
|