简体   繁体   English

如何从Paypal取回数据,以便可以相应地更改MySQL数据库?

[英]How do I get data back from Paypal so I can alter my MySQL database accordingly?

I'm just starting out with Paypal, so this is a newbie question. 我刚开始使用Paypal,所以这是一个新手问题。

I've been going through the instructions for setting up Paypal subscription service , but I think I'm looking at the wrong thing. 我一直在遵循有关设置Paypal订阅服务的说明 ,但我认为我在找错东西。

What I want to acheive is to get back some kind of response from Paypal so that I can update the database on my web site to mark a registered user as having paid. 我要实现的目标是从Paypal那里获得某种答复,以便我可以更新网站上的数据库以将注册用户标记为已付款。 Basically I have a flag in the database that says if the user is subscribed or not. 基本上我在数据库中有一个标志,指示用户是否已订阅。 I want to ensure that the user is marked as paid so long as their Paypal subscription is maintained. 我想确保只要用户保持其Paypal订阅,就将其标记为已付款。

While the instructions linked above do say how to set up a button to receive a payment, there's nothing there about getting any data back from Paypal. 虽然上面链接的说明确实说明了如何设置一个按钮来接收付款,但是从Paypal取回任何数据都没有。

I know there are terms like IPN and sandbox that are related to what I'm trying to do, but I can't find clear instructions for how to get started on this process. 我知道有些术语与IPN沙箱相关,这些术语与我正在尝试做的事情有关,但是我找不到关于如何开始此过程的明确说明。 I'm just circling around and not getting anywhere. 我只是在转悠而已。

Where do I start on setting this up? 我从哪里开始设置? Where is there a clear beginner's tutorial? 哪里有清晰的初学者教程?

Also, I'm using PHP/Javascript/MySQL on my website. 另外,我在网站上使用PHP / Javascript / MySQL。

PayPal's IPN service is what you want to use. 贝宝(PayPal)的IPN服务就是您要使用的服务。 I've used it myself to do just what you're looking to do. 我自己用它来做您想做的事情。

Instant Payment Notification (IPN) is PayPal's message service that sends a notification when a transaction is affected. 即时付款通知(IPN)是PayPal的消息服务,当交易受到影响时会发送通知。 Once IPN is integrated, sellers can automate their back office so they don't have to wait for payments to come in to trigger order fulfillment. 集成IPN后,卖家可以使后台自动化,因此他们不必等待付款来触发订单履行。 IPN can send notifications for these transactions: IPN可以针对以下交易发送通知:

  • Instant payments, including Express Checkout and direct credit card payments 即时付款,包括Express Checkout和直接信用卡付款
  • eCheck payments and pending, completed, or denied status payments eCheck付款以及待处理,已完成或被拒绝的状态付款
  • Pending payments 待付款
  • Recurring payments and subscriptions 定期付款和订阅
  • Authorizations 授权书
  • Disputes, chargebacks, reversals, and refunds 争议,拒付,冲销和退款

You can also view notifications on PayPal's IPN History page and resend them if you need to. 您还可以在PayPal的IPN历史记录页面上查看通知,并在需要时重新发送通知。 As PayPal's interface for handling purchase confirmation and server-to-server communications, IPN can also be used to manage and customize a variety of APIs and communications, including: 作为PayPal的界面,用于处理购买确认和服务器到服务器的通信,IPN还可以用于管理和自定义各种API和通信,包括:

  • Customize your website's response to customer purchases in seconds 在几秒钟内自定义您的网站对客户购买的响应
  • Track customers via IPN "pass-through" variables 通过IPN“传递”变量跟踪客户
  • Notify sellers who deal mostly in software downloads and other digital, online goods 通知主要从事软件下载和其他数字在线商品交易的卖家
  • Track affiliate sales and commissions 跟踪会员销售和佣金
  • Store transaction information in your own database 将交易信息存储在您自己的数据库中

For more about IPN: 有关IPN的更多信息:

I'm not sure if its the same thing, but I just setup my friends website with Express Checkout , and I wanted to add all paid orders to an orders table in my database. 我不确定是否相同,但是我只是使用Express Checkout设置了我的朋友网站 ,并且想将所有已付款订单添加到数据库中的orders表中。

After I call SetExpressCheckout , and the user is returned to my site after going through the purchase flow on Paypal's side, I used the information from GetExpressCheckoutDetails . 在我调用SetExpressCheckout并在通过Paypal方面的购买流程使用户返回到我的网站之后,我使用了GetExpressCheckoutDetails中的信息。

Then, if DoExpressCheckoutPayment is successful (also called from the "callback" page) I then do the appropriate work in my database as far as logging the order details. 然后,如果DoExpressCheckoutPayment成功(也从“回调”页面调用),那么我将在数据库中进行适当的工作,以记录订单详细信息。 For you in this case, it could be updating a record for the user in the database. 在这种情况下,对于您来说,它可能正在更新数据库中用户的记录。

Hope that helps a little. 希望能有所帮助。

暂无
暂无

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

相关问题 如何使用从使用 PHP、MySQL、Bootstrap 的数据库获取的数据? - How can I use the data I get from my database using PHP, MySQL, Bootstrap? 如何从MySQL数据库插入/获取数据? - How can I insert/get data from the MySQL database? 如何使用Code Igniter从MySQL数据库获取数据? - How can I get data from a MySQL database with Code Igniter? 我如何从mysql获取数据以进行操作 - How do i get my data from mysql to behave 如何从我使用 select 选项的数据库中获取数据,以便它可以显示在输入框中 - How to get a data from database where i using select option so it can be shown in inputbox 如何从php数据库帖子中获取URL? - How do I get the URL back from a php database post? 如何使用PHP中的setInterval函数从数据库获取数据 - How do I get data back from database using setInterval function in php 如何从Web服务器到新安装的WAMP获取有效的MySQL数据库 - How do I get a working MySQL database from my web server to my newly installed WAMP 如何将TOTAL的结果存储在MySQL中,以便可以将其立即重新插入表中 - How do I store the result of a TOTAL in MySQL so that it can be immediately inserted back into the table 如果我要从数据库中查询,我如何将数组中的数据 foreach 到 xmls 标签以便将消息发送到多个数字 - How can i foreach data from my array to an xmls tags so as to send message to multiple numbers if i would query from database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM