dta25920 2010-02-22 12:59
浏览 66
已采纳

Paypal IPN脚本:在我的网站上创建一个php,它接收确认的支付消息并插入到wordpress db中

There are two parts to this question, so I'm going to pubish it as two separate questions. The first one deals with interfacing with IPN and is this:

I need to create a simple .php script that can interface with Paypal's IPN system everytime I receive a confirmed payment for a given product.

The script will then install the user into my wordpress user's database as a "member" (which is a custom role I've defined) using their email address as their username and the paypal transaction id as their password.

I'm doing it this way because I can easily enter all the people who have purchased prior to this, into the database without having to generate random passwords for everyone.

Any help with interfacing with IPN?

The second question will be much easier and that's how to use the IPN data (firstname, lastname, email address and transaction id) to enter the user into the wordpress member database.

  • 写回答

2条回答 默认 最新

  • dongwei2983 2010-02-23 01:09
    关注

    Just use Micah Carrick Paypal IPN Class. It have validate_ipn() method that can be used to protect a block of code where you want to put update script:

    if ( $paypal->validate_ipn() )
    {
      $ipn_data = $paypal->ipn_data;
      $invoice = $ipndata['invoice'];
      //do update here, based on invoice
      //...
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动