简体   繁体   English

Java中的Paypal集成

[英]Paypal integration in java

I've generated some expresscheckout and paypalfunctions classes via wizard, tried to integrate it to my spring mvc app and make it to communicate with sandbox account. 我已经通过向导生成了一些expresscheckoutpaypalfunctions类,试图将其集成到我的spring mvc应用程序中并使其与沙箱帐户进行通信。 I get a success respond and then the generated function wants to redirect to paypal with this piece of code in expresscheckout class: 我得到一个成功的响应,然后生成的函数希望使用expresscheckout类中的这段代码重定向到paypal:

  //' Redirect to paypal.com            
response.sendRedirect(response.encodeRedirectURL(nvp.get("TOKEN").toString()));

Neveretheless it redirects to something like http://localhost:8080/EC-48480369JN366854F 尽管如此,它仍重定向到类似http:// localhost:8080 / EC-48480369JN366854F

I'm confused if this is really how it should work or do I have to adjust the code? 如果这真的是应该如何工作还是我必须调整代码,我感到困惑。 Is there any decent tutorial, how to integrate it to java projects? 有没有不错的教程,如何将其集成到Java项目中? All what I've found was out of date or for PHP only. 我发现的所有内容已过时或仅用于PHP。

You probably need to be doing this instead: 您可能需要这样做:

//' Redirect to paypal.com
response.sendRedirect(response.encodeRedirectURL("https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=" + nvp.get("TOKEN").toString()));

(Change www.paypal.com to www.sandbox.paypal.com if you're testing on the Sandbox.) (如果要在沙盒上进行测试,请将www.paypal.com更改为www.sandbox.paypal.com。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM