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

查看:29
本文介绍了将自定义变量传递给 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. 广告编号

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

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中的数据库(状态为notpaid)并发送id.在 ipn.php 中捕获 id 并设置 status =paid/error/数据库中发生的任何事情.

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

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