简体   繁体   English

在沙盒中测试Paypal IPN

[英]Test Paypal IPN in the Sandbox

I am writing a script to handle the paypal IPN, so when someone buys something via paypal it will send them an email and write some info into a database. 我正在编写一个脚本来处理Paypal IPN,因此当有人通过Paypal购买商品时,它将向他们发送电子邮件并将一些信息写入数据库。

I am using the Instant Payment Notification simulator, and it is sending my email ok but i would like it to actually re-direct to my php page, so i can test my error checking etc. When you submit it does call the page but i would like to actually be re-directed to it. 我正在使用即时付款通知模拟器,它正在发送我的电子邮件,但我希望它实际上可以重定向到我的php页面,因此我可以测试我的错误检查等。当您提交时它确实会调用该页面,但是我想要实际重定向到它。

Anyone know if this is possible, or if there is anything i can do to 'fake' this process 任何人都知道这是否可能,或者我有什么办法可以“伪造”这个过程

Cheers Luke 干杯卢克

I usually use micahcarrick Paypal IPN class for Paypal IPN.In this class you can see success case in switch case statement, There you can redirect to your success page. 我通常将micahcarrick Paypal IPN类用于Paypal IPN。在此类中,您可以在switch case语句中看到成功案例,您可以在其中重定向到成功页面。

Actually, Paypal IPN will return response to us. 实际上,贝宝IPN会回复我们。 you can see the action parameter in return url. 您可以在返回网址中看到action参数。 using this you can find is payment is success or cancel or any error during payment. 使用此工具,您可以发现付款成功或取消或付款过程中出现任何错误。

Hope it helps,Thanks 希望能有所帮助,谢谢

Well, you can just test your IPN by using a temporary Payment Data Transfer page. 好了,您可以使用临时的“ Payment Data Transfer页面来测试 IPN。 Read this page for more information about this. 阅读页面以获取更多信息。

So basically after your payment has been done it redirects you to that success page and does everything. 因此,基本上,付款完成后,它会将您重定向到该成功页面并执行所有操作。 So you can use the success page as a test version of your future IPN page. 因此,您可以将成功页面用作将来IPN页面的测试版本 After your script is working exactly the way you want, you can use the code on that page by simply copy-pasting it into your IPN page and deleting that test PDT page. 脚本完全按照您想要的方式运行后,您可以通过简单地将其复制粘贴到IPN page并删除该测试 PDT页面来使用该页面上的代码。

Another way is to catch the entire output of your IPN page and mail it to you. 另一种方法是捕获IPN页面的全部输出并将其邮寄给您。 Or store it somewhere. 或将其存储在某个地方。 To do this, make use of PHP's output buffering . 为此,请使用PHP的输出缓冲

I hope that makes sense to you... 我希望这对你有意义...

Paypal IPN messages are Server to Server Messages for asynchronously receiving messages from Paypal regarding transactions. Paypal IPN消息是服务器到服务器消息,用于异步接收来自Paypal的有关交易的消息。 The HTTP Client used by Paypal to deliver IPN message to your server may not support redirect requests. Paypal用于将IPN消息传递到您的服务器的HTTP客户端可能不支持重定向请求。 As these HTTP requests are not coming from users browsers' output from your Php script is irrelevant. 由于这些HTTP请求不是来自用户的,因此您的Php脚本的浏览器输出无关紧要。 If you want to do any extended processing you have to incorporate that into your IPN Handler. 如果要进行任何扩展处理,则必须将其合并到IPN处理程序中。

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

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