PayPal Item Name/Description on separate lines using forms

萝らか妹 提交于 2020-01-04 09:08:29

问题


I am processing a simple form to PayPal's Express Checkout using the basic standard free account and the standard form "_xclick" option.

When passing through the item name or description, I understand you are limited to 144 characters but I want to have the information inside the title or the description on different lines to separate the information when on PayPals checkout area so the user can clearly see what they are paying for.

I have tried to use "\r" and "\n" to seperate the lines, as seen below in the "item_name" input using "This is line 1\r\nThis is line 2\r\nThis is line 3", but it just ignores the "\r" and the "\n" when passed through to the PayPal payment page and when sent in the receipt email.

Current Example Code:

<form name="TheForm" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">    
  <input type="hidden" name="cmd" value="_xclick">
  <input type="hidden" name="currency_code" value="GBP">
  <input type="hidden" name="item_name" value="This is line 1\r\nThis is line 2\r\nThis is line 3">
  <input type="hidden" name="price" id="price" value="" />
  <input type="hidden" name="business" value="test@test.com">
  <input type="hidden" name="amount" value="">
  <input type="hidden" name="no_shipping" value="1">
  <input type="submit" name="Submit" id="Submit" value="Process Payment" />
</form>

I have also tried using &#10;, &#13;, <br> and <br /> and none of these work either and are passed through as text.

How can I achieve separating the item information on seperate lines using the form option INPUT value, as shown above, for the item description or title please as the way I have tried does not work and I cannot find any solution?

Thanks.


回答1:


Currently there is not a way to do this. The standard buy now buttons do not support this. The closest you can come to putting things on a different line would be using a cart upload method. Instead of passing over 1 item, with 3 values in the item name that you want displayed on 3 different lines you would pass over 3 individual items which would cause them to be on 3 different lines.



来源:https://stackoverflow.com/questions/16213040/paypal-item-name-description-on-separate-lines-using-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!