微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

贝宝交易插入值\'0\'作为值

如何解决贝宝交易插入值\'0\'作为值

| 拥有此贝宝页面,仅当贝宝回发其未插入我的正确值时,它才能正常工作(因此,我的意思是其插入\'0 \'),请看一下...
<?PHP
require \'config.inc.PHP\';

$p = new Paypal();

if(isset($_GET[\'period\']))
{
  $allowedPeriods = array(\"1000\",\"5000\",\"10000\",\"20000\");

  if(!in_array($_GET[\'period\'],$allowedPeriods))
  {
    die(\"Allowed periods are \'1000\',\'5000\',\'10000\',\'20000\'\");
  }

  if(!$usersClass->checkLoggedIn())
  {
    die(\"You must be logged in\");
  }

  $prices = array( \"1000\" => 10,\"5000\" => 30,\"10000\" => 50,\"20000\" => 85 );

  $this_script = \"http://\".$_SERVER[\'HTTP_HOST\'].\"/paypal.PHP?act=\";

  $p->add_field(\'business\',PAYPAL_EMAIL_ADDRESS);
  $p->add_field(\'return\',$this_script.\'success\');
  $p->add_field(\'cancel_return\',$this_script.\'cancel\');
  $p->add_field(\'notify_url\',$this_script.\'ipn\');
  $p->add_field(\'item_name\',\'Credits\');
  $p->add_field(\'cmd\',\'_xclick\');
  $p->add_field(\'amount\',$prices[$_GET[\'period\']]);
  $p->add_field(\'custom\',$usersClass->userID().\"||\".$_POST[\'period\']);
  $p->add_field(\'rm\',\'2\'); 
  $p->add_field(\'currency_code\',\'GBP\');

  $p->submit_paypal_post();  
}
if(isset($_GET[\'act\'])) {
  switch ($_GET[\'act\']) {
    case \"cancel\": print \"Order was canceled!\";
    break;
    case \"success\":
    print \"If payment was successfully received you should be on the top!\"; 
    break;
    case \"ipn\": if ($p->validate_ipn()) {
      $custom = $_POST[\'custom\'];
      $explode = explode(\"||\",$custom); 
      $userid = (int) $explode[0];
      $days = $explode[1];
      $daysArray = array(10 => 1000,30 => 5000,50 => 10000,85 => 20000 );
      $days = $daysArray[$days];
      $tillDate = $days;
      MysqL_query(\"insert into `featured` values (null,\'$userid\',\'$tillDate\')\")
    }
    break;
  }
}
?>
    

解决方法

        我建议您设置
error_reporting(E_ALL)
并在ipn脚本上自己发布以进行测试。
0
也可能表示
FALSE
,然后在其前面使用
(int)
,因此至关重要的是您打开所有错误并自己查看响应。     

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。