douren5490 2017-03-10 20:15
浏览 62
已采纳

PayPal IPN的工作方式与预期不符

I'm using an own written download software for paid downloads over paypal. This worked for the last years without any problems, but the last days there are some problems occurred with the IPN from PayPal. Each download has a own form, the for looks like this

<form action="https://www.paypal.com/cgi-bin/webscr" target="_top" method="post" target="_top" style="text-align: right">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="seller@example.com">
<input type="hidden" name="item_name" value="SOME PRODUCT Single License">
<input type="hidden" name="item_number" value="20001"> <input type="hidden" name="amount" value="69">
<input type="hidden" name="currency_code" value="EUR"><input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="notify_url" value="https://www.example.com/path1/path2/path3/?no_cache=1&tx_ppdownload_pi1%5Baction%5D=notify&tx_ppdownload_pi1%5Bcontroller%5D=Transaction">
<input type="hidden" name="image_url" value="http://www.example.com/files/logo.png">
<input type="hidden" name="return" value="https://www.example.com/path1/path2/path3/?no_cache=1&tx_ppdownload_pi1%5Baction%5D=return&tx_ppdownload_pi1%5Bcontroller%5D=Transaction">
<input type="hidden" name="cancel_return" value="https://www.example.com/path1/path2/path3/?no_cache=1&tx_ppdownload_pi1%5Baction%5D=cancel&tx_ppdownload_pi1%5Bcontroller%5D=Transaction">
<button class="btn btn-lg btn-success btn-block" style="border-radius: 0;">Purchase now <br /><small>secure via PayPal</small></button>

There a multiple forms on the page with different products. Since a few days, I have this problems:

Sandbox and live: After purchase, there is a new layout and a new link to return to the shop. A few days ago, that link called my return url, with some get/post data. Included in that data was the txn_id. On the notify url sends PayPal always the transaction, and with the return url and the txnid I was able to check the transaction and show some information.

The cancel url is ignored too. I can click the button and then I came to paypal. A few days ago I was able to click there on cancel, and came back to the cancel_return to show some information. The cancel_return is in most cases now:

https://www.example.com/path1/path2/path3/?no_cache=1

without the other parameters. In 7 of 10 cases, the additional parameters are not in the cancel link at paypal page.

And in 7 of 10 cases, the notify_url gets never called, maybe there are the parameters missed too.

in 10 of 10 cases the return_url does not include the txn_id and in 7 out of 10 cases the return url has missed parameters from my forms.

the first bad payment (got the money, no correct return_url and no call on the notify_url was a few days ago). In last month I had around 60 transactions from different pages with different products, all without error.

I have no idea what's wrong now.

  • 写回答

1条回答 默认 最新

  • dqrnsg6439 2017-03-11 19:01
    关注

    As of March 8, 2017, a problem began to occur with PayPal's IPN handling. When a transaction passes a url (return, cancel_return, and notify_url) that contains an '&' (such as when separating multiple values), PayPal is stripping the url of all content after the first '&'.

    This post was one of the first to report the issue and recommends using urlencode: QueryString values removed from the IPN endpoint by PayPal

    I have made some modifications to my own PayPal form replacing just the '&' with '&amp;' (the encoded version) and that seems to work too.

    This issue has been reported to PayPal (probably by many people by now); hopefully they will get it fixed. Note also that the issue appears to be intermittent and as the above linked post mentions, it may be dependent on the PayPal server you connect to.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。