php - Paypal 与 PHP 集成

标签 php paypal

我希望实现一个非常简单的 Paypal 集成,通过它我可以输入有效的 Paypal 电子邮件地址(收件人)和金额,然后单击“付款”。理想情况下,它会通过我的 API key 自动从我的 Paypal 账户汇款。

我目前使用 PHP 设置了 Mass Pay,它工作正常,只是每次付款都会向我收取 2% 的费用,并且不会传回交易 ID。这似乎也没有必要,因为我不需要同时付钱给多人。

由于我一次只需要进行一笔交易,我想知道是否有人知道一个更简单的 Paypal API,用于从我的帐户中进行单笔交易。

我一整天都在阅读文档,但我还没有找到我要找的东西。

非常感谢任何建议!

最佳答案

PayPal 有样本 codes for integrating various PayPal features在它的网站上。这包括 PHP 查看功能列表,我确定您正在寻找的内容就在那里。

同样来自 Paypal 网站:

PayPal receives the MassPay request and returns a response indicating success or failure. If PayPal returns a successful response, then PayPal processes the payments and, if you have Instant Payment Notifications (IPN) enabled, PayPal sends a notification to the Notify URL specified in your account profile. If you do not have IPN enabled, you can view the details of the MassPay transaction in your PayPal account.

这意味着在批量支付的情况下,您需要提供一个 URL,paypal 会在该 URL 中发送支付通知。您的程序可能会检查此 url 以确定是否已付款,我怀疑所有付款集成都是这种情况。话虽这么说,我会 print_r 来自 paypal 的响应,但我确信其中可能会包含交易 ID 之类的内容。 In the case of DoAuthorization it does return the transaction id

In the case of mass pay it does return the transaction id if IPN is enabled

关于php - Paypal 与 PHP 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7003001/

相关文章:

php - ajax 发布但无法阻止刷新

PHP处理2列数据输入

php - 重写 URL 以删除扩展名 .htaccess 时出现内部服务器错误

paypal - 如何在 PayPal 测试账户中获取信用卡 CVV?

paypal - PayPal 中的定期付款

php - Magento 如何更改 Paypal 中的默认订单状态

php - 为每个电子邮件 ID :Yii 生成一个唯一链接

php - 使用tcpdf时如何写html格式的条码

android - 有什么办法可以在 Intent 中传递蒙版信用卡?

PayPal - 无人值守收费