PHP Paypal 集成并提供即时反馈
是否可以从 Paypal 交易中获得即时响应,并且他们是否必须离开您的网站才能通过 Paypal 付款?
我正在一个网站上工作,用户需要一次性付款,所以我一直在寻找捐赠脚本,但大多数都是付费的,我发现的唯一一个没有给出即时响应 http://www.ibdhost.com/donation/。如果您有以前使用过的任何相关脚本,如果您能发布它们,我们将不胜感激。
谢谢
Is it possible to get an instant response from a paypal transaction and do they have to leave your site to pay by paypal?
I am working on a site where the user needs to make a one off payment so I have been looking for donation scripts, but most of them are pay for and the only one I found does not give an instant response http://www.ibdhost.com/donation/. If you have any related scripts that you have used before It would be greatly appreciated if you could post them.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的应用程序 www.perqworks.com 使用 Paypal Website Payment Pro。 API 中有一个即时付款通知 (IPN) 的概念。 https://cms.paypal .com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/library_code_ipn_code_samples
其工作原理是人们用信用卡付款。 Paypal 向我的服务器上的“侦听器”发送 https 响应。使用侦听器,您可以根据 Paypal 的响应代码决定继续该过程或引发错误。
文档和沙箱有所帮助,但 Paypal API 可能有点难以让您头脑清醒。
My application, www.perqworks.com, uses Paypal Website Payment Pro. In the API is a notion of Instant Payment Notification (IPN). https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/library_code_ipn_code_samples
How it works is that a person pays with a credit card. Paypal sends an https response to a 'listener' on my server. With the listener, you can decide to continue the process or throw an error based on the response codes from Paypal.
The documentation and sandbox helped, but the Paypal API can be a little tricky to get your head wrapped around.
为了确保您的付款安全,有必要将用户转移到paypal的网站,否则网络钓鱼类型的攻击会更容易!
我不确定你所说的即时响应是什么意思,我的印象是PayPal商家帐户可以实时通知商家,以便生成和发送注册密钥等信息?
In order to be certain you're paying securely, it is necessary for the user to be transferred to paypal's site, otherwise phishing-type attacks would be much easier!
I'm not sure what you mean by instant response, I was under the impression that PayPal merchant accounts can inform the merchant in real time in order for things like registration keys and such to be generated and sent?
首先,对这一切持保留态度:我至少有一年没有积极使用 Paypal...
您可以(或可以)使用 Paypal,而无需用户离开您的网站:它被称为“商家服务” Pro”并有与之相关的月费。
实际上,这个问题的时机不错,Paypal 昨天宣布了他们的 Open API(请参阅 http ://www.pcworld.com/businesscenter/article/181382/paypal_introduces_open_api_to_put_ payments_into_apps.html)。
无论如何,就“即时”通知而言:技术上它不会发生。当用户被推送到 Paypal 并进行付款时,会发生两件事:
无论如何,在这两者之间您通常都可以。通常我的编码工作流程是这样的:
my_defined_transaction_id
' 的 Paypaluser_finished.php
(Paypal给我一个 ID)transaction_cleared.php
并使用 GET 参数指示“my_define_transaction_id
”(Paypal 再次给出我的身份证)。user_finished.php
之前先访问transaction_cleared.php
:当 Paypal 访问该 URL 时,我会将 'my_define_transaction_id
' 标记为“好的”(交叉引用回 Paypal 以确保有效性后)。user_finished.php
时,我可以将交易 ID 交叉引用回 Paypal,确保有效性,然后将“my_defined_transaction_id
”标记为“OK”。通过两步完成这一切,用户可以关闭浏览器,而无需返回我的网站,并且事务仍标记为“确定”。
抱歉...还没开始喝咖啡,但我希望这是有道理的。
Firstly, take this all with a grain of salt: I haven't actively used Paypal for at least a year...
You can (or could) use Paypal without having the user leave your site: it was called something like "Merchant Services Pro" and had a monthly fee associated with it.
Not bad timing to ask, actually, with Paypal announcing their Open API yesterday (see http://www.pcworld.com/businesscenter/article/181382/paypal_introduces_open_api_to_put_payments_into_apps.html ).
Anyway, as far as 'instant' notification is concerned: it doesn't technically happen. When the user is pushed off to Paypal and make their payment, two things happen:
Anyway, between the two you normally are OK. Normally my coding workflow would be something like:
my_defined_transaction_id
'user_finished.php
(Paypal with give me an ID)transaction_cleared.php
with a GET parameter indicating 'my_defined_transaction_id
' (again Paypal will give me an ID).transaction_cleared.php
well before the user gets touser_finished.php
: when Paypal hits that URL, I mark 'my_defined_transaction_id
' as "OK" (after cross referencing back to Paypal to ensure validity).user_finished.php
, I can cross reference the transaction ID back to Paypal, ensure validity and then mark 'my_defined_transaction_id
' as "OK".Doing this all in two steps allows the user to close the browser without going back to my site and still having the transaction marked as "OK".
Sorry... haven't started my coffee yet, but I hope that makes some sense.