Rev 693 | Rev 822 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
package in.shop2020.serving.controllers;import java.io.IOException;import java.util.HashMap;import java.util.List;import java.util.Map;import org.apache.struts2.convention.annotation.Result;import org.apache.struts2.convention.annotation.Results;import org.apache.thrift.TException;import in.shop2020.model.v1.order.Order;import in.shop2020.model.v1.order.TransactionServiceException;import in.shop2020.payments.PaymentException;import in.shop2020.thrift.clients.PaymentServiceClient;import in.shop2020.thrift.clients.TransactionServiceClient;import in.shop2020.thrift.clients.UserContextServiceClient;import in.shop2020.utils.Logger;@Results({@Result(name="redirect", type="redirectAction",params = {"actionName" , "login"})})public class PayErrorController extends BaseController{private static final long serialVersionUID = 1L;PaymentServiceClient pclient = null;TransactionServiceClient tsc = null;UserContextServiceClient usc = null;long merchantPaymentId;List<Order> orders = null;String message = null;public PayErrorController(){super();try {pclient = new PaymentServiceClient();tsc = new TransactionServiceClient();usc = new UserContextServiceClient();} catch (Exception e) {Logger.log("Could not initialize the paymentservice client", this);}}public String index() throws IOException, SecurityException, PaymentException, TException, TransactionServiceException{this.message = "Payment failed at the payment gateway. Please pay again.";if(!userinfo.isLoggedIn()){System.out.println("Inside user is not logged in");setRedirectUrl();return "redirect";}merchantPaymentId = Long.parseLong(this.request.getParameter("paymentId"));return "index";}public String getMessage(){return this.message;}}