| Line 8... |
Line 8... |
| 8 |
import in.shop2020.model.v1.user.Cart;
|
8 |
import in.shop2020.model.v1.user.Cart;
|
| 9 |
import in.shop2020.model.v1.user.Line;
|
9 |
import in.shop2020.model.v1.user.Line;
|
| 10 |
import in.shop2020.model.v1.user.PromotionException;
|
10 |
import in.shop2020.model.v1.user.PromotionException;
|
| 11 |
import in.shop2020.model.v1.user.ShoppingCartException;
|
11 |
import in.shop2020.model.v1.user.ShoppingCartException;
|
| 12 |
import in.shop2020.model.v1.user.UserContextService;
|
12 |
import in.shop2020.model.v1.user.UserContextService;
|
| - |
|
13 |
import in.shop2020.payments.Payment;
|
| 13 |
import in.shop2020.payments.PaymentException;
|
14 |
import in.shop2020.payments.PaymentException;
|
| 14 |
import in.shop2020.payments.PaymentService.Client;
|
15 |
import in.shop2020.payments.PaymentService.Client;
|
| 15 |
import in.shop2020.serving.utils.Utils;
|
16 |
import in.shop2020.serving.utils.Utils;
|
| 16 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
17 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
| 17 |
import in.shop2020.thrift.clients.PromotionServiceClient;
|
18 |
import in.shop2020.thrift.clients.PromotionServiceClient;
|
| Line 86... |
Line 87... |
| 86 |
log.error("Not able to fetch payment amount." + e1.getMessage());
|
87 |
log.error("Not able to fetch payment amount." + e1.getMessage());
|
| 87 |
e1.printStackTrace();
|
88 |
e1.printStackTrace();
|
| 88 |
return PAYMENT_NOT_CREATED;
|
89 |
return PAYMENT_NOT_CREATED;
|
| 89 |
}
|
90 |
}
|
| 90 |
|
91 |
|
| 91 |
Client paymentClient = paymentServiceClient.getClient();
|
- |
|
| 92 |
try {
|
92 |
try {
|
| 93 |
paymentId = paymentClient.createPayment(userId, amount, gatewayId, txnId);
|
93 |
paymentId = paymentServiceClient.getClient().createPayment(userId, amount, gatewayId, txnId);
|
| - |
|
94 |
// This is being done to ensure that the amount which we pass on to
|
| - |
|
95 |
// the PGs is same as what we have in the database.
|
| - |
|
96 |
Payment payment = paymentServiceClient.getClient().getPayment(paymentId);
|
| - |
|
97 |
amount = payment.getAmount();
|
| 94 |
} catch (PaymentException e1) {
|
98 |
} catch (PaymentException e1) {
|
| 95 |
log.error("Not able to create payment object." + e1.getError_code() + e1.getMessage());
|
99 |
log.error("Not able to create payment object." + e1.getError_code() + e1.getMessage());
|
| 96 |
e1.printStackTrace();
|
100 |
e1.printStackTrace();
|
| 97 |
return PAYMENT_NOT_CREATED;
|
101 |
return PAYMENT_NOT_CREATED;
|
| 98 |
} catch (TException e) {
|
102 |
} catch (TException e) {
|