将自定义变量传递给Paypal IPN [英] Passing custom variables to paypal IPN

查看:69
本文介绍了将自定义变量传递给Paypal IPN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将自定义变量传递给Paypal IPN.我可以设法传递一个变量.但是我不知道如何传递多个变量.

I am trying to pass custom variables to paypal IPN. I can manage to pass one variable. But i don't know how to pass multiple variables.

我的过程就是这样

  1. 用户填写表格
  2. 他们单击按钮,然后转到贝宝
  3. 他们付了款,IPN寄回了我的信息,并且ipn.php添加了传递到数据库的变量.

我的自定义变量是

  1. 总行数(无论他们写什么,我都会数行数)
  2. 消息(他们写的消息)
  3. 广告ID

但是现在,我只能像这样传递一个变量

But for now, I can only pass one variable like this

form.php

<input name="custom" type="hidden" id="custom" value="{$line_count}">

$_SESSION['line_count'] = $_POST['lines_txt'];

ipn.php

$sql="INSERT INTO `form`(`totalline`) VALUES ('" .$_POST['custom']. "');";

推荐答案

我不确定,如果使用Paypal甚至可以发送和接收多个变量.如果由于贝宝(Paypal)的限制而无法实现,则可以使用以下方法之一:

I am not sure, if it is even possible with Paypal to send and receive multiple variables. If it is not possible due to Paypal's restrictions, you could use one of the following approaches:

  • 发送序列化的数据,并在返回时反序列化.
  • 将数据写入form.php中的数据库中(状态未付款)并发送ID.在ipn.php中,获取ID并设置状态=支付/错误/数据库中发生的一切.

这篇关于将自定义变量传递给Paypal IPN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆