You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by xiaofeng dou <xi...@gmail.com> on 2005/07/19 08:53:53 UTC
newbie question: Could I load a page which recieve the external app postted parameter?
Hello, everyone
I am new to the tapestry. In my webapp, the user will pay money
through external bank gateway(user will be navigated from my webapp to
bank pages), after the pay , the external page will return to my
webapp's page and send some parameters using post method. I want to
know how the tapestry page to realize the function? thanks a lot. the
example jsp page maybe:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html" %>
<%@ page import="java.io.*,java.lang.*,java.util.*,chinapay.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<link TYPE="text/css" HREF="mystyle.css" REL="stylesheet" TITLE="mystyle">
</head>
<%
String TransDate = null ;
String MerId = null ;
String OrdId = null ;
String TransType = null ;
String TransAmt = null ;
String CuryId = null ;
String ChkValue = null ;
String OrderStatus= null ;
String GateId = null ;
try
{
TransDate = request.getParameter("transdate") ;
MerId = request.getParameter("merid") ;
OrdId = request.getParameter("orderno");
TransType = request.getParameter("transtype") ;
TransAmt = request.getParameter("amount") ;
CuryId = request.getParameter("currencycode") ;
OrderStatus = request.getParameter("status") ;
ChkValue = request.getParameter("checkvalue") ;
chinapay.PrivateKey key=new chinapay.PrivateKey();
chinapay.SecureLink t;
boolean flag;
boolean flag1;
String msg="";
flag=key.buildKey(MerId,0,"/...");
if (flag==false)
{
msg="build key error!";
return;
}
t=new chinapay.SecureLink (key);
flag1=t.verifyTransResponse( MerId,OrdId, TransAmt, CuryId, TransDate,
TransType,
OrderStatus, ChkValue);
if (flag1==false)
{
//
}
else
{
//
}
}
catch(Exception e)
{
out.println(e.getMessage());
return;
}
%>
xiaofeng.dou
douxiaofeng@longshine.com
2005-07-19
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: newbie question: Could I load a page which recieve the external
app postted parameter?
Posted by "t.n.a." <tn...@sharanet.org>.
xiaofeng dou wrote:
>Hello, everyone
> I am new to the tapestry. In my webapp, the user will pay money
>through external bank gateway(user will be navigated from my webapp to
>bank pages), after the pay , the external page will return to my
>webapp's page and send some parameters using post method. I want to
>know how the tapestry page to realize the function?
>
>
It depends on the way you communicate with the payment gateway (PG):
let's suppose you send the request via POST and receive an answer via GET.
If you need it, you'll have a form to gather information about your
customer.
On form submit, you can save the data, and show a page with a simple
HTML form containing hidden data and an onLoad() redirect to the PG. The
best way to generate such a form is by designing a simple "send-request"
component. The browser autosubmits the data in the form to the PG, where
the user enters his card number and other relevant data.
If the server returns via GET, you can set up an address pointing to an
external page of your application. You access the returned values like so:
public void activateExternalPage(Object[] parameters, IRequestCycle cycle) {
...
RequestContext rc = cycle.getRequestContext();
String returnStatus = rc.getParameter("returnStatus");
String transactionID = rc.getParameter("transactionID");
...
doStuff(returnStatus, transactionID);
...
}
Things are really a lot more complicated (), but that's the general idea.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org