| 428 |
ashish |
1 |
package in.shop2020.serving.controllers;
|
|
|
2 |
|
| 719 |
rajveer |
3 |
import java.io.IOException;
|
|
|
4 |
import java.util.HashMap;
|
|
|
5 |
import java.util.List;
|
|
|
6 |
import java.util.Map;
|
|
|
7 |
|
| 822 |
vikas |
8 |
import org.apache.struts2.convention.annotation.InterceptorRef;
|
|
|
9 |
import org.apache.struts2.convention.annotation.InterceptorRefs;
|
| 719 |
rajveer |
10 |
import org.apache.struts2.convention.annotation.Result;
|
|
|
11 |
import org.apache.struts2.convention.annotation.Results;
|
|
|
12 |
import org.apache.thrift.TException;
|
|
|
13 |
|
|
|
14 |
import in.shop2020.model.v1.order.Order;
|
|
|
15 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
|
|
16 |
import in.shop2020.payments.PaymentException;
|
| 428 |
ashish |
17 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
| 719 |
rajveer |
18 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
|
|
19 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
|
|
20 |
import in.shop2020.utils.Logger;
|
| 428 |
ashish |
21 |
|
| 822 |
vikas |
22 |
@InterceptorRefs({
|
|
|
23 |
@InterceptorRef("myDefault"),
|
|
|
24 |
@InterceptorRef("login")
|
| 719 |
rajveer |
25 |
})
|
| 428 |
ashish |
26 |
|
| 517 |
rajveer |
27 |
public class PayErrorController extends BaseController{
|
| 719 |
rajveer |
28 |
private static final long serialVersionUID = 1L;
|
|
|
29 |
PaymentServiceClient pclient = null;
|
|
|
30 |
TransactionServiceClient tsc = null;
|
|
|
31 |
UserContextServiceClient usc = null;
|
| 428 |
ashish |
32 |
|
| 719 |
rajveer |
33 |
long merchantPaymentId;
|
|
|
34 |
List<Order> orders = null;
|
|
|
35 |
String message = null;
|
| 428 |
ashish |
36 |
|
| 517 |
rajveer |
37 |
public PayErrorController(){
|
| 719 |
rajveer |
38 |
super();
|
| 428 |
ashish |
39 |
try {
|
|
|
40 |
pclient = new PaymentServiceClient();
|
| 719 |
rajveer |
41 |
tsc = new TransactionServiceClient();
|
|
|
42 |
usc = new UserContextServiceClient();
|
| 428 |
ashish |
43 |
} catch (Exception e) {
|
| 719 |
rajveer |
44 |
Logger.log("Could not initialize the paymentservice client", this);
|
| 428 |
ashish |
45 |
}
|
|
|
46 |
}
|
|
|
47 |
|
| 719 |
rajveer |
48 |
public String index() throws IOException, SecurityException, PaymentException, TException, TransactionServiceException{
|
|
|
49 |
this.message = "Payment failed at the payment gateway. Please pay again.";
|
| 428 |
ashish |
50 |
|
| 719 |
rajveer |
51 |
merchantPaymentId = Long.parseLong(this.request.getParameter("paymentId"));
|
|
|
52 |
return "index";
|
| 428 |
ashish |
53 |
}
|
|
|
54 |
|
| 719 |
rajveer |
55 |
|
|
|
56 |
public String getMessage(){
|
|
|
57 |
return this.message;
|
| 428 |
ashish |
58 |
}
|
| 719 |
rajveer |
59 |
|
| 428 |
ashish |
60 |
}
|