【发布时间】:2014-08-02 21:53:14
【问题描述】:
目前,我成功拨打了第一个电话
https://api-3t.sandbox.paypal.com/nvp
这让我回到了TOKEN 和ACK,这当然是成功的......现在的问题是如何从这些变量中捕获值。我想不出办法。有人可以帮我在servlet 中获取这些值,以便我可以比较和操作在线支付的其他步骤!
提前致谢!
这是我发送给https://api-3t.sandbox.paypal.com/nvp的表格
<input type="text" name="USER" value="rspunk07-facilitator_api1.hotmail.com" /><br/>
<input type="text" name="PWD" value="1402570771" /><br/>
<input type="text" name="SIGNATURE" value="AOgUKQLphsryE4s2aIWzkssJyVf3ALKhcP5TZ2W4CnDz.bAbL.WoCv9q" /><br/>
<input type="text" name="METHOD" value="SetExpressCheckout" /><br/>
<input type="text" name="VERSION" value="98" /><br/>
<input type="text" name="PAYMENTREQUEST_0_AMT" value="10" /><br/>
<input type="text" name="PAYMENTREQUEST_0_CURRENCYCODE" value="USD" /><br/>
<input type="text" name="PAYMENTREQUEST_0_PAYMENTACTION" value="SALE" /><br/>
<input type="text" name="cancelUrl" value="http://localhost:8084/E-Drivers_Licensing_System/onlinepayment.jsp" /><br/>
<input type="text" name="returnUrl" value="http://localhost:8084/E-Drivers_Licensing_System/success.jsp" /><br/>
<input type="submit" name="h" value="Register"/>
<input type="reset" name="cancel" value="Cancel"/><br/>
对此,我在同一网址https://api-3t.sandbox.paypal.com/nvp 中得到TOKEN=EC%2d08371303KU3173044&TIMESTAMP=2014%2d06%2d17T10%3a32%3a09Z&CORRELATIONID=26d5a8792d431&ACK=Success&VERSION=98&BUILD=11457922
现在,我遇到的问题是,从我的 servlet 中捕获 url 中提供的详细信息
public class OnlinePaymentController extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
} finally {
out.close();
}
}
我该怎么做?
【问题讨论】: