| Line 10... |
Line 10... |
| 10 |
import org.springframework.stereotype.Service;
|
10 |
import org.springframework.stereotype.Service;
|
| 11 |
import org.springframework.transaction.annotation.Transactional;
|
11 |
import org.springframework.transaction.annotation.Transactional;
|
| 12 |
|
12 |
|
| 13 |
import in.shop2020.payment.domain.Payment;
|
13 |
import in.shop2020.payment.domain.Payment;
|
| 14 |
import in.shop2020.payment.persistence.PaymentMapper;
|
14 |
import in.shop2020.payment.persistence.PaymentMapper;
|
| - |
|
15 |
import in.shop2020.payments.PaymentStatus;
|
| 15 |
|
16 |
|
| 16 |
@Service
|
17 |
@Service
|
| 17 |
public class PaymentHandler{
|
18 |
public class PaymentHandler{
|
| 18 |
|
19 |
|
| 19 |
@Autowired
|
20 |
@Autowired
|
| Line 41... |
Line 42... |
| 41 |
SimpleDateFormat mysqlDateFormatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
|
42 |
SimpleDateFormat mysqlDateFormatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
|
| 42 |
String fromTime = mysqlDateFormatter.format(new Date(tFromTime));
|
43 |
String fromTime = mysqlDateFormatter.format(new Date(tFromTime));
|
| 43 |
String toTime = mysqlDateFormatter.format(new Date(tToTime));
|
44 |
String toTime = mysqlDateFormatter.format(new Date(tToTime));
|
| 44 |
return paymentMapper.getPayments(fromTime, toTime, status, gatewayId);
|
45 |
return paymentMapper.getPayments(fromTime, toTime, status, gatewayId);
|
| 45 |
}
|
46 |
}
|
| - |
|
47 |
|
| - |
|
48 |
public List<Payment> getPaymentsByCapturedDate(long tFromTime, long tToTime, long gatewayId){
|
| - |
|
49 |
SimpleDateFormat mysqlDateFormatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
|
| - |
|
50 |
String fromTime = mysqlDateFormatter.format(new Date(tFromTime));
|
| - |
|
51 |
String toTime = mysqlDateFormatter.format(new Date(tToTime));
|
| - |
|
52 |
return paymentMapper.getPaymentsByCapturedDate(fromTime, toTime, PaymentStatus.SUCCESS.getValue(), gatewayId);
|
| - |
|
53 |
}
|
| 46 |
|
54 |
|
| 47 |
public List<Payment> getPaymentsForUser(long userId, long tFromTime, long tToTime, int status, long gatewayId){
|
55 |
public List<Payment> getPaymentsForUser(long userId, long tFromTime, long tToTime, int status, long gatewayId){
|
| 48 |
SimpleDateFormat mysqlDateFormatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
|
56 |
SimpleDateFormat mysqlDateFormatter = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
|
| 49 |
String fromTime = mysqlDateFormatter.format(new Date(tFromTime));
|
57 |
String fromTime = mysqlDateFormatter.format(new Date(tFromTime));
|
| 50 |
String toTime = mysqlDateFormatter.format(new Date(tToTime));
|
58 |
String toTime = mysqlDateFormatter.format(new Date(tToTime));
|