Wednesday, 18 January 2017

Calling Payment Gateway from OAF Page

For Any transactions we need to call Payment Gateway Link from OAF Page.
Make sure Your Application Link is whitelisted by PaymentGateway company,  before calling Payment Gateway url.

we need to call PaymentGateway Url from JSP Page by Passing required parameters to JSP Page from OAF Page using below statement.

pageContext.setForwardURL("/OA_HTML/PaymentGateway.jsp", null, (byte)0, null, localHashMap, true, "Y", (byte)99);



Here 'billDeskRequest.jsp' is custom JSP Page developed in webContent.
Below is the code in 'PaymentGateway.jsp':
--------------------------------------------------

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%
String UserName=" ";
%>
<HTML>

 <HEAD>

  <TITLE>Redirecting to Payment Gateway Page</TITLE>

  <script type="text/javascript">

  function submit(){
UserName = document.getElementById("userNameParam").value; //get the parameter value
 var formsub=document.PAYMENT_GATEWAY_FORM_NAME;
  formsub.submit(); //Submit Form
 
  }
  </script>
 </HEAD>


 <BODY onload="submit()"> //call submit function once we load jsp page

 <script type="text/javascript">


 </script>
 <input type="hidden" id="userNameParam" value="<%=request.getParameter("params")%>"/> //get the parameter value from OAF page controller which is sent using hashMap

<%  String str=request.getParameter("params");%>

 <% try {%>
<form name='PAYMENT_GATEWAY_FORM_NAME' method='GET' action='PAYMENT_GATEWAY_URL'>


<div>
  <input type='hidden' name='msg' value='<%=str%>'>

</div>
</form>

<% }
catch ( Throwable e)
{
out.println("Runtime error in JSP");
     
}
%>
 </BODY>
</HTML>


2 comments:

  1. Your music is amazing. You have some very talented artists. I wish you the best of success. White Label Merchant Services

    ReplyDelete
  2. Please continue this great work and I look forward to more of your awesome blog posts. North American Bancard Agent Program

    ReplyDelete