PayPal将

编程入门 行业动态 更新时间:2024-10-11 11:14:58
本文介绍了PayPal将_cart格式的空格转换为加号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

最近(从2017年3月开始),与PayPal付款标准的_cart表单集成已开始将所有项目信息(名称和选项)中的空格编码为加号(+).我确认这是在Chrome中发生的,并在表单中添加了enctype属性,这似乎为我解决了这个问题.在Chrome和Firefox中,我可以将数据发送到PayPal,并且可以正确保留空格.也许这是a幸?

Recently (starting March 2017), the _cart form integration with PayPal payments standard has started encoding spaces in all item info (names and options) to the plus sign (+). I verified this was happening in Chrome and added the enctype attribute to the form, which seemed to solve the issue for me. In Chrome and Firefox, I can send data to PayPal and spaces are preserved properly. Perhaps this is a fluke?

但是,几乎所有购买的客户的信息编码都不正确,这导致IPN请求无法验证他们购买的产品.

However, almost every customer that purchases is getting their info encoded improperly, which results in the IPN request not being able to verify the products they purchased.

表格:

<form action="www.paypal/cgi-bin/webscr" method="post" enctype="application/x-www-form-urlencoded"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="upload" value="1"> <input type="hidden" name="business" value="name@example"> <input type="hidden" name="charset" value="utf-8"> <input type="hidden" name="item_name_1" value="Product With Spaces"> <input type="hidden" name="quantity_1" value="1"> <input type="hidden" name="amount_1" value="30.00"> <input type="hidden" name="on0_1" value="Name"> <input type="hidden" name="os0_1" value="First Last"> <input type="hidden" name="on1_1" value="Email"> <input type="hidden" name="os1_1" value="customer@example"> <input type="image" src="www.paypal/en_US/i/btn/btn_xpressCheckout.gif" align="left" style="margin-right:7px; margin-top: 2px;"> <img alt="" border="0" src="www.paypalobjects/en_US/i/scr/pixel.gif" width="1" height="1"> </form>

提交给PayPal时,产品显示为Product+With+Spaces,名称显示为First+Last.因此,贝宝(PayPal)上的交易记录和IPN请求也具有错误编码的数据.

When submitted to PayPal, the product is shown as Product+With+Spaces and the name as First+Last. Thus the transaction record on PayPal and the IPN request have the incorrectly encoded data also.

我尝试将空格编码为%20或+(通常会导致双重编码,因此我不希望它提供帮助),但是这些文字字符已显示在PayPal上.

I tried encoding the spaces as %20 or + (which would normally result in double-encoding, so I didn't expect it to help), but those literal characters were shown on PayPal.

我已经阅读了PayPal开发人员文档,并且似乎在使用最新的字段和URL.而且,此代码已经成功运行了好多年没有麻烦.

I've read over the PayPal developer docs, and I seem to be using the most up-to-date fields and URLs. Also, this code has been running successfully for years without trouble.

推荐答案

已解决!在Paypal按钮表单中添加了enctype ="multipart/form-data"属性,将返回到ipn的变量返回到与提交状态相同的状态

Solved! added the enctype="multipart/form-data" attribute to the paypal button form, return variables to ipn come back in same state as submitted

更多推荐

PayPal将

本文发布于:2023-07-14 20:07:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1106717.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PayPal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!