+ Start a Discussion

paymentgate way https request

Billdesk people are asking our end point to send the responce . how can we generate end point for taking responce.


my code is following like this



the retrun responce body will come  and replcaing old url  that means the html body is placing on ulr position,.  so I am getting error


my object is to open that result in new window like an page


//page code


<apex:page Controller="paymentGateWay">
  <script type="text/javascript">
function mypopup()
    mywindow = window.open("http://www.javascript-coder.com", "mywindow", "location=1,status=1,scrollbars=1,  width=100,height=100");
    mywindow.moveTo(0, 0);
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >

<apex:inputText label="LoanApplication Number" value="{!LAN}"/>
<apex:inputText label="Amount" value="{!Amount}" />
<apex:commandButton value="Pay Now" immediate="true" action="{!goForPay}" onclick="window.open('mypopup');" />








// class code


 public class paymentGateWay {

 public string LAN{get;set;}
 public string Amount{get;set;}
 public string LAND{get;set;}
 public string typeOfCard ='creditcard';
  public string goForPay() {
 // paymentprocess1 pay =new paymentprocess1();
 // pay.paymentprocess1m(LAN,Amount);
   string sessionid = UserInfo.getSessionId();
   string body='?txtCustomerId='+LAN+'&txtTxnAmount='+Amount;
   string body2= EncodingUtil.urlEncode(body, 'UTF-8');  
   // create http object
    Http h = new Http();

  // creating https request
       HttpRequest req = new HttpRequest();
    HttpResponse res = h.send(req);
    return res.getBody();