dongzi3434 2017-03-21 17:06
浏览 53


I have payments set up (using php) so that when a customer returns to the success.php file (after payment process on Paypal using an IPN listener) they are added to the db with a new membership number, which is also generated in the success.php file. The process works fine if the customer pays as a guest, they are returned to the success.php page as they should be. However, if the customer logs in to paypal rather than paying as a guest they are redirected to the Paypal user account page instead of back to the success.php page on my site. This means the payment has been taken but their membership number is not created or added to the db.

Is there a way to force ALL customers back to my success page or should the code to create the new member be added to the ipn listener (ipn.php) file so it wouldn't matter if they didn't come back to the success page?

This is the code I use in the checkout page to set the return url.

<form action="<?php echo $paypalURL; ?>" method="post">
           <!-- Identify your business so that you can collect the payments. -->
           <input type="hidden" name="business" value="<?php echo $paypalID; ?>">

           <!-- Specify a Buy Now button. -->
           <input type="hidden" name="cmd" value="_xclick">

           <!-- Specify details about the item that buyers will purchase. -->
           <input type="hidden" name="item_name" value="<?php echo $item_name; ?>">
           <input type="hidden" name="item_number" value="<?php echo $item_number; ?>">
           <input type="hidden" name="amount" value="<?php echo $price; ?>">
           <input type="hidden" name="currency_code" value="GBP">

           <!-- Specify URLs -->
           <input type='hidden' name='cancel_return' value=''>
                 <input type='hidden' name='return' value=''>

           <!-- Display the payment button. -->
           <input type="submit" name="submit" class="button" value="Pay Now">

I should add that I have only tested this in sandbox mode so far, so if anyone knows if this is a sandbox only issue, please let me know.

UPDATE: Further testing shows that the return url no longer works with a guest check out either. This has only started happening since sandbox payments are going through the new payment pages (screenshot attached).

Has paypal changed the method of requesting a return url?

Paypal payment screen shot

  • 写回答

1条回答 默认 最新


      相关推荐 更多相似问题


      • ¥20 python跨服务器实现复制 ,剪切的功能需求
      • ¥15 R语言,单因素cox检验,时间分层后,使用coz.zph()函数再次ph假设检验时报错,如何解决?
      • ¥15 关于#C语言冒泡排序型#的问题,如何解决?
      • ¥15 如何预处理存在负值的样本数据,使其能够全都成为正的
      • ¥15 SW画图拖影,平滑处理如何关闭
      • ¥15 请问怎么通过css改变图片颜色
      • ¥15 Blender: auto rig pro骨骼动画导出后变形穿模
      • ¥15 C51单片机的设计思路哈
      • ¥15 Linux脏牛提权漏洞
      • ¥15 为何我用uni-data-checkbox 标签在APP里调试无法显示?