Recently I was testing a site I maintain, based in Canada.
I found that when arriving at the PayPal payment, the country field was set to United States, despite the fact that I have set billing_country set to CA.
How can I get PayPal to respect the billing_country I have set?
I have reproduced the same behaviour on the paypal sandbox.
Here is the relevant PayPal form with all variables:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" accept-charset="UTF-8" method="post">
<input name="item_name_1" value="Test Item" type="hidden">
<input name="business" value="test-business#example.com" type="hidden">
<input name="email" value="test-customer#example.com" type="hidden">
<input name="cmd" value="_cart" type="hidden">
<input name="charset" value="utf-8" type="hidden">
<input name="upload" value="1" type="hidden">
<input name="amount_1" value="10.00" type="hidden">
<input name="quantity_1" value="1" type="hidden">
<input name="tax_cart" value="0.00" type="hidden">
<input name="currency_code" value="CAD" type="hidden">
<input name="lc" value="CA" type="hidden">
<input name="no_shipping" value="1" type="hidden">
<input name="no_note" value="1" type="hidden">
<input name="address_override" value="1" type="hidden">
<input name="country" value="CA" type="hidden">
<input name="address1" value="123 Broadway" type="hidden">
<input name="city" value="Winnipeg" type="hidden">
<input name="state" value="MB" type="hidden">
<input name="zip" value="R3G 1N1" type="hidden">
<input name="night_phone_a" value="555" type="hidden">
<input name="night_phone_b" value="555" type="hidden">
<input name="night_phone_c" value="5555" type="hidden">
<input style="vertical-align: middle" name="continue" value="Continue" type="submit">
</form>
Through testing and comparing code against a different site where this issue does not occur, I have determined this is a PayPal bug.
The workaround I found is to set:
<input name="landing_page" value="billing" type="hidden">
After setting this variable, PayPal started to respect the billing_country field I set.
Related
I am working on a site that is trying pass a japanese item name to paypal through
this form
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input name="cmd" value="_xclick" type="hidden">
<input name="item_name" value="フォトグラフィー基礎コース" type="hidden">
<input name="amount" value="59000" type="hidden">
<input name="currency_code" value="JPY" type="hidden">
<input type="hidden" name="item_number" value="PHP001">
<input name="no_note" value="0" type="hidden">
<input type="hidden" name="lc" value="ja_JP">
<input name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest" type="hidden">
<input class="coursepayment" name="submit" value="今すぐ購入" alt="PayPal - The safer, easier way to pay online!" border="0" type="submit">
</form>
But the Item name comes out reading:
フォトグラフィー基礎コース
Is there a way to fix this?
See the documentation for the form method:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/#setting-the-character-set--charset
Setting the Character Set — charset
Use the charset HTML variable to specify the character set and
character encoding for the billing information/log-in page on the
PayPal website. In addition, this variable sets the same values for
information that you send to PayPal in your HTML button code.
For example, the following INPUT tag sets the encoding to UTF-8:
<INPUT TYPE="hidden" name="charset" value="utf-8">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input name="cmd" value="_xclick" type="hidden">
<input type="hidden" name="charset" value="utf-8">
<input name="item_name" value="フォトグラフィー基礎コース" type="hidden">
<input name="amount" value="59000" type="hidden">
<input name="currency_code" value="JPY" type="hidden">
<input type="hidden" name="item_number" value="PHP001">
<input name="no_note" value="0" type="hidden">
<input type="hidden" name="lc" value="ja_JP">
<input name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest" type="hidden">
<input class="coursepayment" name="submit" value="今すぐ購入" alt="PayPal - The safer, easier way to pay online!" border="0" type="submit">
</form>
Another alternative is to set the default encoding accepted by the PayPal account (which as of today is still not utf-8 until you set it that way).
Check "More Options" under https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-language-encoding
I have been struggling with this issue for quite a while now. I am trying to test a PayPal button implementation with their Sandbox, and have the following code:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="email#example.com">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="Item Name">
<input type="hidden" name="no_note" value="1">
<input type="hidden" value="http://XX.XX.XX.XX" name="return">
<input type="hidden" name="src" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribe_LG.gif:NonHostedGuest">
<table>
<tr><td><input type="hidden" name="on1" value="First">First Name</td></tr><tr><td><input type="text" name="os1" maxlength="200"></td></tr>
<tr><td><input type="hidden" name="on2" value="Last">Last Name</td></tr><tr><td><input type="password" name="os2" maxlength="200"></td></tr>
<tr><td><input type="hidden" name="on0" value="Frequency">Frequency</td></tr><tr><td><select name="os0">
<option value="Weekly">Weekly : £10.00 GBP - weekly</option>
<option value="Monthly">Monthly : £25.00 GBP - monthly</option>
<option value="Yearly">Yearly : £250.00 GBP - yearly</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="option_select0" value="Weekly">
<input type="hidden" name="option_amount0" value="10.00">
<input type="hidden" name="option_period0" value="W">
<input type="hidden" name="option_frequency0" value="1">
<input type="hidden" name="option_select1" value="Monthly">
<input type="hidden" name="option_amount1" value="25.00">
<input type="hidden" name="option_period1" value="M">
<input type="hidden" name="option_frequency1" value="1">
<input type="hidden" name="option_select2" value="Yearly">
<input type="hidden" name="option_amount2" value="250.00">
<input type="hidden" name="option_period2" value="Y">
<input type="hidden" name="option_frequency2" value="1">
<input type="hidden" name="option_index" value="0">
<span id='signupButton'></span>
</form>
This successfully redirects me to the PayPal checkout, but once logged in with my Sandbox buyer account, it produces the following problem consistently:
I've done everything suggested in the error page, but still no luck. Am I missing something?
This is a generic (and ancient) PayPal "our process died attempting to produce a web page" error. Presumably you have some incorrect input or unusual circumstance that causes the crash, but you would be doing everyone a favor if you report this bug to PayPal so that they can fix it (to give a useful error back rather than crashing).
That said, to diagnose I would recommend stripping down to a super-simple button and if that works, try re-introducing the complexity of your button to see what triggers the crash.
However, since the crash happens after login it may also be a bad buyer account (or even a bad seller/buyer account combination) or some such that triggers the edge condition. So I would also try with a different buyer account.
I have different products in my site to sell.
The problem is that each time for new product i have to manually create a new form using paypal and implement it in site which takes a lot time.While purchase i need two information from customers their email and phone no. .So is there any way to do this by creating a non-hosted paypal form.Can we add text-fields in non-hosted paypal forms?
For Example:(below is non-hosted paypal form how can i add two text fields to it and get them show up in customers purchase detail in paypal)
<div style="width:300px;background-color: #FFFFFF">
<h2 style="text-align:center">
Type in title here</h2>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="paypal_form">
<h3 style="text-align:center">
Yummy Logo for $90</h3>
<p align="center">
<input type="submit" value="Buy" /></p>
<input name="cmd" type="hidden" value="_xclick" />
<input name="business" type="hidden" value="my_paypal_email#example.com" />
<input name="item_name" type="hidden" value="logo type x2" />
<input name="amount" type="hidden" value="2" />
<input name="no_shipping" type="hidden" value="1" />
<input name="no_note" type="hidden" value="0" />
<input name="cn" type="hidden" value="Client Comments:" />
<input name="return" type="hidden" value="http://example.com" />
<input name="cancel_return" type="hidden" value="http://example.com" />
<input name="rm" type="hidden" value="1" />
<input name="currency_code" type="hidden" value="USD" />
</form>
</div>
<p>
</p>
Check out HTML Variables for Filling Out PayPal Checkout Pages Automatically.
I have developed a shopping cart and now I am stuck with paypal shopping cart form. I am trying to send multiple items with one single shipping, handling and tax fees. I have created following form but paypal gives me error "Your shopping cart is empty."
Here is my code
<form name="paypal" action="https://www.paypal.com/cgi-bin/webscr" ethod="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="business" value="xxxx#xxxxx.com">
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="tax_cart" value="5">
<input type="hidden" name="handling_cart" value="30">
<input type="hidden" name="shipping" value="20">
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="item_name_1" value="Product 1">
<input type="hidden" name="item_number_1" value="1">
<input type="hidden" name="item_amount_1" value="60">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="item_name_2" value="Product 2">
<input type="hidden" name="item_number_2" value="4">
<input type="hidden" name="item_amount_2" value="10">
<input type="hidden" name="quantity_2" value="1">
<input type="submit" name="submit" value="Pay with Paypal" />
</form>
The name provided for the amount is incorrect. Instead of
<input type="hidden" name="item_amount_2" value="10">
use
<input type="hidden" name="amount_2" value="10">
The variable "handling_cart" should work. It wouldn't work if you have your account set up not to allow transaction based shipping to override your profile shipping. Double checking your shipping profile in your PayPal account and make sure you have it set to allow transaction based shipping to override your profile.
I am trying to pass my users details to Paypal screen using the appropriate html variables but only some are getting passed!?!?!? This is driving me mad! The order details are fine.
My code is:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
#*Order Details*#
<input type="hidden" name="business" value="sales#xxxxxx.co.uk">
<input type="hidden" name="item_name" value="Order Number 123">
<input type="hidden" name="amount" value="200.00">
<input type="hidden" name="currency_code" value="GBP">
#*Address Stuff *#
<input type="hidden" name="first_name" value="Barry">
<input type="hidden" name="last_name" value="White">
<input type="hidden" name="address1" value="1 Big Street">
<input type="hidden" name="address2" value="Big Mountain">
<input type="hidden" name="city" value="Big City">
<input type="hidden" name="country" value="GB">
<input type="hidden" name="email" value="Bob#bob.com">
<input type="hidden" name="lc" value="UK">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif"
border="0" name="submit" alt="PayPal — The safer, easier way to pay online." />
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1" />
</form>
The paypal screen shows some of the fields (name, email country!) but not all
Why are some of the fields populating and some not!!!!!!!!!
Thanks
It seems that if you don't supply all the address details then it will not display any!
If I add the zip field then it displays the address.
Paypal integration should be so simple but their documentation is so bad - shows what monopolies do for you.
all the address fields are optional according to the documentation ffs