使用PHP在数据库中插入Paypal付款日期

时间:2021-04-29 13:05:08

I'm not sure how to go about doing this.. I want to add a Paypal "buy now" button on my website and when a user pays I want to save the date they paid into the database using mysql.

我不知道该怎么做...我想在我的网站上添加一个Paypal“立即购买”按钮,当用户支付时我想用mysql将他们支付的日期保存到数据库中。

How would this be possible?

这怎么可能?

1 个解决方案

#1


3  

What you'll need to do is create a PayPal IPN script, which will cause PayPal to call upon a PHP script on your server every time you receive a payment. The full details are available on PayPal's website, but here's an overview of how it works:

您需要做的是创建一个PayPal IPN脚本,这将导致PayPal每次收到付款时都会调用服务器上的PHP脚本。有关详细信息,请访问PayPal的网站,但这里概述了它的工作原理:

Instant Payment Notification (IPN) is a message service that notifies you of events related to PayPal transactions. You can use it to automate back-office and administrative functions, such as fulfilling orders, tracking customers, and providing status and other information related to a transaction

即时付款通知(IPN)是一种消息服务,可通知您与PayPal交易相关的事件。您可以使用它来自动执行后台和管理功能,例如履行订单,跟踪客户以及提供与交易相关的状态和其他信息

You detect and process IPN messages with a listener, sometimes called a handler, which is a script or program that you write. It waits for messages and passes them to various back-end or administrative processes that respond the messages. PayPal provides sample code that you can modify to implement a listener that detects IPN messages.

您使用侦听器(有时称为处理程序)检测并处理IPN消息,该侦听程序是您编写的脚本或程序。它等待消息并将它们传递给响应消息的各种后端或管理进程。 PayPal提供了可以修改的示例代码,以实现检测IPN消息的侦听器。

The actions to take when your listener is notified of an event are specific to your needs. Examples of the kinds of actions you might take when your listener receives an IPN message include the following:

当听众收到事件通知时要采取的操作特定于您的需求。侦听器收到IPN消息时可能采取的操作类型示例包括:

Trigger order fulfillment or enable media downloads when a check clears or a payment is made Update your list of customers Update accounting records Create specialized “to do” lists based on the kind of event You are typically notified of events by email as well, but the IPN message service enables you to automate your response to events. The following diagram shows how events can occur and how PayPal responds with IPN messages that it sends to your listener:

在支票清除或付款时触发订单履行或启用媒体下载更新您的客户列表更新会计记录根据事件类型创建专门的“待办事项”列表您通常也会通过电子邮件通知事件,但是IPN消息服务使您可以自动响应事件。下图显示了事件如何发生以及PayPal如何响应它发送给您的侦听器的IPN消息:

使用PHP在数据库中插入Paypal付款日期

#1


3  

What you'll need to do is create a PayPal IPN script, which will cause PayPal to call upon a PHP script on your server every time you receive a payment. The full details are available on PayPal's website, but here's an overview of how it works:

您需要做的是创建一个PayPal IPN脚本,这将导致PayPal每次收到付款时都会调用服务器上的PHP脚本。有关详细信息,请访问PayPal的网站,但这里概述了它的工作原理:

Instant Payment Notification (IPN) is a message service that notifies you of events related to PayPal transactions. You can use it to automate back-office and administrative functions, such as fulfilling orders, tracking customers, and providing status and other information related to a transaction

即时付款通知(IPN)是一种消息服务,可通知您与PayPal交易相关的事件。您可以使用它来自动执行后台和管理功能,例如履行订单,跟踪客户以及提供与交易相关的状态和其他信息

You detect and process IPN messages with a listener, sometimes called a handler, which is a script or program that you write. It waits for messages and passes them to various back-end or administrative processes that respond the messages. PayPal provides sample code that you can modify to implement a listener that detects IPN messages.

您使用侦听器(有时称为处理程序)检测并处理IPN消息,该侦听程序是您编写的脚本或程序。它等待消息并将它们传递给响应消息的各种后端或管理进程。 PayPal提供了可以修改的示例代码,以实现检测IPN消息的侦听器。

The actions to take when your listener is notified of an event are specific to your needs. Examples of the kinds of actions you might take when your listener receives an IPN message include the following:

当听众收到事件通知时要采取的操作特定于您的需求。侦听器收到IPN消息时可能采取的操作类型示例包括:

Trigger order fulfillment or enable media downloads when a check clears or a payment is made Update your list of customers Update accounting records Create specialized “to do” lists based on the kind of event You are typically notified of events by email as well, but the IPN message service enables you to automate your response to events. The following diagram shows how events can occur and how PayPal responds with IPN messages that it sends to your listener:

在支票清除或付款时触发订单履行或启用媒体下载更新您的客户列表更新会计记录根据事件类型创建专门的“待办事项”列表您通常也会通过电子邮件通知事件,但是IPN消息服务使您可以自动响应事件。下图显示了事件如何发生以及PayPal如何响应它发送给您的侦听器的IPN消息:

使用PHP在数据库中插入Paypal付款日期