PayPal自适应付款付款操作完成后,如何获得成功回复? [英] How to receive a success response once the PayPal Adaptive Payments pay operation is completed?

查看:81
本文介绍了PayPal自适应付款付款操作完成后,如何获得成功回复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 PayPal自适应付款集成到我的localhost项目中。到目前为止,我已设法执行付款流程。但是,我需要在付款完成后收到成功回复才能更新我的数据库。



我遇到了 returnURL 属性,但这对我的实现来说并不安全,因为用户可以在重定向returnURL之前终止会话,因此数据库不会更新。



我也遇到了 ipnNotificationUrl 但是我没有设法让它工作。如果这是实现此目标的正确方法,则需要在编码本身,Web.config,PayPal沙箱帐户或任何其他配置中配置。



实现这一目标的最佳做法是什么?

I am trying to integrate PayPal Adaptive Payments into my localhost project. Until now I have managed to perform the paying process. However I need to receive a success response once the payment has been completed in order to update my database.

I have come across the returnURL property, however this is not secure for my implementation since the user can just terminate the session before redirecting the the returnURL and thus the database woould not get updated.

I have also come across the ipnNotificationUrl however I did not manage to make it work. If this is the right way to achieve this goal what needs to be configured in the coding itself, the Web.config, the PayPal sandbox account, or any other configuration.

What is the best practice to achieve this goal?

推荐答案

永远不要接受来自不安全网站的代码来处理任何与真钱有关的事情。

你不知道谁给你代码,你不知道它做了什么,你不知道它将钱正确地放入适当的帐户,而不将细节传递给任何第三方。 />


只从Paypal获取此类代码 - 否则欺诈的范围太大。请记住,如果您的行为被视为疏忽,您本人可能要对任何损失承担责任 - 从公共论坛获取您的代码肯定会是!
Never, ever, accept code from a insecure website to handle anything to do with real money.
You do not know who is giving you the code, you do not know what it does, you do not know that it places the monies correctly into the appropriate account, without passing the details to any third parties.

Only get such code from Paypal - the scope for fraud otherwise is far too large. And remember, you personally could be liable for any monies lost if your action is seen to be negligent - which getting your code from a public forum would most certainly be!


IPN是正确的方法去。一旦付款处理完毕,Paypal将生成IPN,无论是成功还是失败。您可以为您的Web应用程序指定一个URL(而不是localhost,因为paypal无法访问您的localhost URL。您需要在某处托管您的应用程序来测试它)。并且Paypal将在处理完付款后拨打该网址。开发人员沙箱中有一个IPN测试工具。你可以生成任意数量的IPN,直到一切正常。但您需要托管您的应用程序或为您的计算机实施某种动态DNS提供程序(以便网络外的人可以访问您的网址)。



接收IPN的几点建议。




- 在开始处理之前检查请求主机是否为Paypal.com(这很容易从服务器变量检查请求)。



- IPN会有很多关于您的付款的信息,将数据存储在您的数据库中总是一个好主意(这将很方便有争议的情况。



- 在收到IPN后标记处理的订单,直到将其标记为待处理。



- 接收IPN并不意味着支付成功,检查响应中的状态。
IPN is the correct way to go. Once the payment is processed Paypal will generate IPN whether it is success or fail. You can specify a url to your web application (not localhost, because paypal cannot access your localhost url. you need to host your application somewhere to test this). and paypal will call that url once the payment is processed. There is a IPN testing tools in the developer sandbox. you can generate as many IPNs you want until everything is working fine. but you need to host your application or implement some kind of dynamic DNS provider to your machine (so that people outside your network can access your url).

Few tips on receiving IPN.


- Check if the request host is Paypal.com before even start processing (this is very easy to check from server variables of the request).

- IPN will have a lot of information regarding your payment, it always a good idea to store everything in your database (this will come handy in case of dispute).

- Mark the order processed only after receiving IPN, until then mark it ''Pending''.

- Receiving IPN doesn''t mean that the payment is successful, check the status in the response.


Rutvik Dave还有另一种不使用IPN的方式,因为我现在必须在当地工作?
Rutvik Dave is there another way without using IPN since I have to work locally for the moment?


这篇关于PayPal自适应付款付款操作完成后,如何获得成功回复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆