| Line 15... |
Line 15... |
| 15 |
import in.shop2020.payments.PaymentStatus;
|
15 |
import in.shop2020.payments.PaymentStatus;
|
| 16 |
import in.shop2020.thrift.clients.TransactionClient;
|
16 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 17 |
|
17 |
|
| 18 |
import java.text.SimpleDateFormat;
|
18 |
import java.text.SimpleDateFormat;
|
| 19 |
import java.util.ArrayList;
|
19 |
import java.util.ArrayList;
|
| - |
|
20 |
import java.util.Arrays;
|
| 20 |
import java.util.Date;
|
21 |
import java.util.Date;
|
| 21 |
import java.util.HashMap;
|
22 |
import java.util.HashMap;
|
| 22 |
import java.util.List;
|
23 |
import java.util.List;
|
| 23 |
import java.util.Map;
|
24 |
import java.util.Map;
|
| 24 |
|
25 |
|
| Line 57... |
Line 58... |
| 57 |
|
58 |
|
| 58 |
public static final long PAYMENT_NOT_CREATED = -1;
|
59 |
public static final long PAYMENT_NOT_CREATED = -1;
|
| 59 |
|
60 |
|
| 60 |
private static final long HDFC_GATEWAY_ID = 1;
|
61 |
private static final long HDFC_GATEWAY_ID = 1;
|
| 61 |
private static final long EBS_GATEWAY_ID = 2;
|
62 |
private static final long EBS_GATEWAY_ID = 2;
|
| 62 |
private static final long HDFC_EMI_GATEWAY_ID = 5;
|
63 |
private static final long[] HDFC_EMI_GATEWAY_IDS = {5,10,11,12};
|
| 63 |
|
64 |
|
| 64 |
ApplicationContext context = new ClassPathXmlApplicationContext("context.xml");
|
65 |
ApplicationContext context = new ClassPathXmlApplicationContext("context.xml");
|
| 65 |
PaymentHandler paymentHandler = (PaymentHandler) context.getBean("paymentHandler");
|
66 |
PaymentHandler paymentHandler = (PaymentHandler) context.getBean("paymentHandler");
|
| 66 |
PaymentRequiringExtraProcessingHandler paymentRequiringExtraProcessingHandler =
|
67 |
PaymentRequiringExtraProcessingHandler paymentRequiringExtraProcessingHandler =
|
| 67 |
(PaymentRequiringExtraProcessingHandler) context.getBean("paymentRequiringExtraProcessingHandler");
|
68 |
(PaymentRequiringExtraProcessingHandler) context.getBean("paymentRequiringExtraProcessingHandler");
|
| Line 326... |
Line 327... |
| 326 |
//Capture and update the HDFC payment
|
327 |
//Capture and update the HDFC payment
|
| 327 |
return captureAndUpdateHdfcPayment(payment);
|
328 |
return captureAndUpdateHdfcPayment(payment);
|
| 328 |
} else if (gatewayId == EBS_GATEWAY_ID){
|
329 |
} else if (gatewayId == EBS_GATEWAY_ID){
|
| 329 |
//Capture and update the EBS payment
|
330 |
//Capture and update the EBS payment
|
| 330 |
return captureAndUpdateEbsPayment(payment);
|
331 |
return captureAndUpdateEbsPayment(payment);
|
| 331 |
} else if (gatewayId == HDFC_EMI_GATEWAY_ID){
|
332 |
} else if (Arrays.asList(HDFC_EMI_GATEWAY_IDS).contains(gatewayId)){
|
| 332 |
//Capture and update the HDFC EMI payment
|
333 |
//Capture and update the HDFC EMI payment
|
| 333 |
return captureAndUpdateHdfcEmiPayment(payment);
|
334 |
return captureAndUpdateHdfcEmiPayment(payment);
|
| 334 |
}
|
335 |
}
|
| 335 |
|
336 |
|
| 336 |
logger.error("We have an authorized payment from unknown gateway: " + gatewayId);
|
337 |
logger.error("We have an authorized payment from unknown gateway: " + gatewayId);
|