我正在使用此代码将我的值传递给 paypal。 现在我的问题是,在付款完成后,我应该在我的页面上,以便我可以操作一些东西,比如我应该保存 Token 以供将来引用等。当用户隐式点击 paypal 页面中形成的链接时,我再次回到我的页面支付完成。但这里的问题是我不能仅仅依靠用户点击或这样做。我希望它应该是隐式的,没有任何用户干预。 提前致谢,请说明一下......
<%
String apiusername="USERNAME";
String apipassword="PASSWORD";
String truePath="http://localhost:8080/Befundo/xtraFiles/paypal/paypalResponse.jsp";
String falsePath="http://localhost:8080/PaypalGS/paypalResponseCancel.jsp";
String itemName="Computer Laptop";
String quantity="2";
String amount="100";
%>
<body >
<form name="paypalForm" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="text" name="cmd" value="_xclick" />
<input type="text" name="business" value="<%=apiusername %>" />
<input type="text" name="password" value="<%=apipassword %>" />
<input type="text" name="custom" value="1123" />
<input type="text" name="item_name" value="<%=itemName%>" />
<input type="text" name="amount" value="<%=amount%>"/>
<input type="hidden" name="quantity" value="<%=quantity %>" />
<input type="text" name="rm" value="1" />
<input type="text" name="return" value="<%=truePath %>" />
<input type="text" name="cancel_return" value="<%=falsePath %>" />
<input type="text" name="cert_id" value="API Singature" />
<input type='submit' value='Pay'>
</form>
</body>
最佳答案
是的,您可以通过在 paypal 配置文件中配置自动返回 url 来做到这一点。
设置自动返回:
1. Log in and click the Profile subtab under My Account.
2. Click the Website Payment Preferences link under Selling Preferences.
3. Click the On radio button to enable Auto Return.
4. Enter the Return URL.
当您登录商家资料时,您会看到:
点击网站支付偏好链接后,您将看到:
在这里你可以给出自动返回的 url。
这将启用自动返回,这意味着付款成功后,paypal 将自动重定向到您的网站,无需用户干预。
这是启用自动返回的 Paypal 指南:https://www.paypal.com/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside
希望这对您有所帮助。
关于jsp - 付款完成后 Paypal 返回我的网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10410188/