简体   繁体   English

Paypal API-是否需要cURL和IPN?

[英]Paypal api - is cURL and IPN needed?

Can someone tell me if it possible to make use of the Paypal NVP API in PHP without the use of cURL. 有人可以告诉我是否可以在不使用cURL的情况下使用PHP中的Paypal NVP API。 eg. 例如。 when you request the paykey. 当您请求支付密钥时。

also is the Paypal IPN feature (I'm using localhost) necessary, and what is it's function? Paypal IPN功能(我正在使用localhost)也是必需的,它的功能是什么?

Sorry, but the Paypal documentation didn't answer any of these questions. 抱歉,但是Paypal文档没有回答这些问题。

The paypal API uses the HTTP protocol to send and receive data. paypal API使用HTTP协议发送和接收数据。 Thus, if you wanted, you can use any HTTP library or even write your own based on PHP sockets and use that. 因此,如果需要,您可以使用任何HTTP库,甚至可以基于PHP套接字编写自己的库并使用它。 cURL seems like the best way to get it done though. cURL似乎是完成它的最好方法。

The IPN is a way to be notified of any transaction on your account. IPN是一种通知您帐户上任何交易的方法。 It sends an HTTP POST to the URL you specify, allowing you to automate your sales tracking, shipping, download link generation, etc. If you want to handle this manually, you need not use IPN. 它将HTTP POST发送到您指定的URL,从而使您可以自动进行销售跟踪,运输,下载链接生成等。如果您想手动处理,则无需使用IPN。

The Paypal documentation does answer all your questions. 贝宝文档确实回答了您所有的问题。 https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro

if you need to check if a transaction was successfull and you need to write this to a database (for example) then there is no way around IPN (with fsock or curl) 如果您需要检查事务是否成功,并且需要将其写入数据库(例如),则无法解决IPN(使用fsock或curl的问题)

I once wrote a class that handle the IPN, based on the very good code examples also provided by paypal: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_code 我曾经根据贝宝提供的很好的代码示例编写了一个处理IPN的类: https ://cms.paypal.com/us/cgi-bin/ ? cmd = _render-content & content_ID = developer/ library_code

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

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