| Line 8... |
Line 8... |
| 8 |
import in.shop2020.payments.Constants;
|
8 |
import in.shop2020.payments.Constants;
|
| 9 |
import in.shop2020.payments.Payment;
|
9 |
import in.shop2020.payments.Payment;
|
| 10 |
import in.shop2020.payments.PaymentException;
|
10 |
import in.shop2020.payments.PaymentException;
|
| 11 |
import in.shop2020.payments.PaymentGateway;
|
11 |
import in.shop2020.payments.PaymentGateway;
|
| 12 |
import in.shop2020.payments.PaymentStatus;
|
12 |
import in.shop2020.payments.PaymentStatus;
|
| 13 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
13 |
import in.shop2020.thrift.clients.PaymentClient;
|
| 14 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
14 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 15 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
15 |
import in.shop2020.thrift.clients.UserClient;
|
| 16 |
|
16 |
|
| 17 |
import java.io.ByteArrayOutputStream;
|
17 |
import java.io.ByteArrayOutputStream;
|
| 18 |
import java.io.FileNotFoundException;
|
18 |
import java.io.FileNotFoundException;
|
| 19 |
import java.io.FileOutputStream;
|
19 |
import java.io.FileOutputStream;
|
| 20 |
import java.io.IOException;
|
20 |
import java.io.IOException;
|
| Line 47... |
Line 47... |
| 47 |
private static final int S_NO = 0, PAYMENT_ID = 1, GATEWAY = 2, PAYMENT_METHOD = 3, TXN_ID = 4, AMOUNT = 5, PAY_STATUS = 6,
|
47 |
private static final int S_NO = 0, PAYMENT_ID = 1, GATEWAY = 2, PAYMENT_METHOD = 3, TXN_ID = 4, AMOUNT = 5, PAY_STATUS = 6,
|
| 48 |
PAY_STATUS_DESC = 7, TXN_STATUS = 8, REF_CODE = 9, TXN_TIME = 10, CUST_ID = 11, NAME = 12,
|
48 |
PAY_STATUS_DESC = 7, TXN_STATUS = 8, REF_CODE = 9, TXN_TIME = 10, CUST_ID = 11, NAME = 12,
|
| 49 |
MOB_NO = 13, ADDR = 14, PINCODE = 15, CITY = 16, STATE = 17, EMAIL = 18, ORDER_ID = 19, ORDER_STATUS = 20,
|
49 |
MOB_NO = 13, ADDR = 14, PINCODE = 15, CITY = 16, STATE = 17, EMAIL = 18, ORDER_ID = 19, ORDER_STATUS = 20,
|
| 50 |
ORDER_STATUS_DESC = 21, ITEM_ID = 22, PROD_GRP = 23, BRAND = 24, MOD_NAME = 25, MOD_NUM = 26, QTY = 27;
|
50 |
ORDER_STATUS_DESC = 21, ITEM_ID = 22, PROD_GRP = 23, BRAND = 24, MOD_NAME = 25, MOD_NUM = 26, QTY = 27;
|
| 51 |
|
51 |
|
| 52 |
TransactionServiceClient tsc;
|
52 |
TransactionClient tsc;
|
| 53 |
in.shop2020.model.v1.order.TransactionService.Client tClient;
|
53 |
in.shop2020.model.v1.order.TransactionService.Client tClient;
|
| 54 |
|
54 |
|
| 55 |
PaymentServiceClient psc;
|
55 |
PaymentClient psc;
|
| 56 |
in.shop2020.payments.PaymentService.Client pClient;
|
56 |
in.shop2020.payments.PaymentService.Client pClient;
|
| 57 |
|
57 |
|
| 58 |
UserContextServiceClient usc;
|
58 |
UserClient usc;
|
| 59 |
in.shop2020.model.v1.user.UserContextService.Client uClient;
|
59 |
in.shop2020.model.v1.user.UserContextService.Client uClient;
|
| 60 |
|
60 |
|
| 61 |
Map<Long, PaymentGateway> gateWays = new HashMap<Long, PaymentGateway>(4);
|
61 |
Map<Long, PaymentGateway> gateWays = new HashMap<Long, PaymentGateway>(4);
|
| 62 |
|
62 |
|
| 63 |
public PaymentDetailsGenerator() {
|
63 |
public PaymentDetailsGenerator() {
|
| 64 |
try {
|
64 |
try {
|
| 65 |
tsc = new TransactionServiceClient();
|
65 |
tsc = new TransactionClient();
|
| 66 |
tClient = tsc.getClient();
|
66 |
tClient = tsc.getClient();
|
| 67 |
|
67 |
|
| 68 |
psc = new PaymentServiceClient();
|
68 |
psc = new PaymentClient();
|
| 69 |
pClient = psc.getClient();
|
69 |
pClient = psc.getClient();
|
| 70 |
|
70 |
|
| 71 |
usc = new UserContextServiceClient();
|
71 |
usc = new UserClient();
|
| 72 |
uClient = usc.getClient();
|
72 |
uClient = usc.getClient();
|
| 73 |
} catch (Exception e) {
|
73 |
} catch (Exception e) {
|
| 74 |
logger.error("Error establishing connection to one of txn, payment or user service", e);
|
74 |
logger.error("Error establishing connection to one of txn, payment or user service", e);
|
| 75 |
}
|
75 |
}
|
| 76 |
}
|
76 |
}
|