Subversion Repositories SmartDukaan

Rev

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

Rev 29834 Rev 29928
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
 
-
 
5
import javax.servlet.http.HttpServletRequest;
-
 
6
 
-
 
7
import org.apache.logging.log4j.LogManager;
-
 
8
import org.apache.logging.log4j.Logger;
-
 
9
import org.springframework.beans.factory.annotation.Autowired;
-
 
10
import org.springframework.beans.factory.annotation.Qualifier;
-
 
11
import org.springframework.http.MediaType;
-
 
12
import org.springframework.http.ResponseEntity;
-
 
13
import org.springframework.mail.javamail.JavaMailSender;
-
 
14
import org.springframework.stereotype.Controller;
-
 
15
import org.springframework.transaction.annotation.Transactional;
-
 
16
import org.springframework.web.bind.annotation.PathVariable;
-
 
17
import org.springframework.web.bind.annotation.RequestMapping;
-
 
18
import org.springframework.web.bind.annotation.RequestMethod;
-
 
19
 
-
 
20
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
21
import com.spice.profitmandi.common.model.ProfitMandiConstants;
4
import com.spice.profitmandi.common.model.ProfitMandiConstants;
22
import com.spice.profitmandi.common.services.mandii.AccountStatusResponseOut;
5
import com.spice.profitmandi.common.services.mandii.AccountStatusResponseOut;
23
import com.spice.profitmandi.common.services.mandii.EligibilityStatusEnum;
6
import com.spice.profitmandi.common.services.mandii.EligibilityStatusEnum;
24
import com.spice.profitmandi.common.services.mandii.MandiiService;
7
import com.spice.profitmandi.common.services.mandii.MandiiService;
Line 33... Line 16...
33
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
16
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
34
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
17
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
35
import com.spice.profitmandi.dao.repository.transaction.PaymentRepository;
18
import com.spice.profitmandi.dao.repository.transaction.PaymentRepository;
36
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
19
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
37
import com.spice.profitmandi.service.wallet.WalletService;
20
import com.spice.profitmandi.service.wallet.WalletService;
-
 
21
import org.apache.logging.log4j.LogManager;
-
 
22
import org.apache.logging.log4j.Logger;
-
 
23
import org.springframework.beans.factory.annotation.Autowired;
-
 
24
import org.springframework.beans.factory.annotation.Qualifier;
-
 
25
import org.springframework.http.MediaType;
-
 
26
import org.springframework.http.ResponseEntity;
-
 
27
import org.springframework.mail.javamail.JavaMailSender;
-
 
28
import org.springframework.stereotype.Controller;
-
 
29
import org.springframework.transaction.annotation.Transactional;
-
 
30
import org.springframework.web.bind.annotation.PathVariable;
-
 
31
import org.springframework.web.bind.annotation.RequestMapping;
-
 
32
import org.springframework.web.bind.annotation.RequestMethod;
-
 
33
 
-
 
34
import javax.servlet.http.HttpServletRequest;
-
 
35
import java.time.LocalDateTime;
38
 
36
 
39
@Controller
37
@Controller
40
@Transactional(rollbackFor = Throwable.class)
38
@Transactional(rollbackFor = Throwable.class)
41
public class GatewayController {
39
public class GatewayController {
42
 
40
 
Line 121... Line 119...
121
				creditAccount.setUpdatedOn(LocalDateTime.now());
119
				creditAccount.setUpdatedOn(LocalDateTime.now());
122
 
120
 
123
				creditAccountRepository.persist(creditAccount);
121
				creditAccountRepository.persist(creditAccount);
124
				return responseSender.ok(accountStatusResponseOut);
122
				return responseSender.ok(accountStatusResponseOut);
125
			} catch (Exception e) {
123
			} catch (Exception e) {
-
 
124
				log.info("Trace {}\n{}", e.getMessage(), e);
126
				throw new ProfitMandiBusinessException("Loan Provider", gateway, "Cant fetch details for provider");
125
				throw new ProfitMandiBusinessException("Loan Provider", gateway, "Cant fetch details for provider");
127
			}
126
			}
128
		} else {
127
		} else {
129
			throw new ProfitMandiBusinessException("Provider", "Empty", "Provider cant be empty");
128
			throw new ProfitMandiBusinessException("Provider", "Empty", "Provider cant be empty");
130
		}
129
		}