PHP Paypal 集成并提供即时反馈

发布于 2024-08-10 07:33:24 字数 281 浏览 13 评论 0原文

是否可以从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情话墙 2024-08-17 07:33:24

我的应用程序 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.

醉生梦死 2024-08-17 07:33:24

为了确保您的付款安全,有必要将用户转移到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?

小草泠泠 2024-08-17 07:33:24

首先,对这一切持保留态度:我至少有一年没有积极使用 Paypal...

您可以(或可以)使用 Paypal,而无需用户离开您的网站:它被称为“商家服务” Pro”并有与之相关的月费。

实际上,这个问题的时机不错,Paypal 昨天宣布了他们的 Open API(请参阅 http ://www.pcworld.com/businesscenter/article/181382/paypal_introduces_open_api_to_put_ payments_into_apps.html)。

无论如何,就“即时”通知而言:技术上它不会发生。当用户被推送到 Paypal 并进行付款时,会发生两件事:

  1. 用户最终会被推送回您的网站,并
  2. 在交易清算时带有交易 ID(尽管这通常是“立即”发生的,但可能需要几分钟时间)天),Paypal 异步地访问您的网站,与用户完全分离,到另一个具有不同 ID 的预定 URL(我很确定它是不同的)

无论如何,在这两者之间您通常都可以。通常我的编码工作流程是这样的:

  1. 当用户完成付款时,将用户发送到带有唯一 ID 'my_defined_transaction_id' 的 Paypal
  2. ,让他们返回到 user_finished.php (Paypal给我一个 ID)
  3. 设置我的 Paypal 设置,以便在交易清算时,Paypal 将点击 transaction_cleared.php 并使用 GET 参数指示“my_define_transaction_id”(Paypal 再次给出我的身份证)。
  4. Paypal 通常会在用户访问 user_finished.php 之前先访问 transaction_cleared.php:当 Paypal 访问该 URL 时,我会将 'my_define_transaction_id' 标记为“好的”(交叉引用回 Paypal 以确保有效性后)。
  5. 当用户最终回到 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:

  1. the user is eventually pushed back to your site, with a transaction ID
  2. when the transaction is cleared (although this normally occurs 'instantly', it can take a couple of days), Paypal hits your site, asynchronously, totally separated from the user, to another predetermined URL with a different ID (I'm pretty sure it's different)

Anyway, between the two you normally are OK. Normally my coding workflow would be something like:

  1. send user off to Paypal with unique ID 'my_defined_transaction_id'
  2. when the user finishes payment, have them come back to user_finished.php (Paypal with give me an ID)
  3. have my Paypal settings set so that on transaction clearance, Paypal will hit transaction_cleared.php with a GET parameter indicating 'my_defined_transaction_id' (again Paypal will give me an ID).
  4. Paypal generally hits transaction_cleared.php well before the user gets to user_finished.php: when Paypal hits that URL, I mark 'my_defined_transaction_id' as "OK" (after cross referencing back to Paypal to ensure validity).
  5. When the user ends up back at 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文