Paypal non-hosted buy now form creation - paypal

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.

Related

PayPal sandbox UK Payments Pro Hosted payment page does not process card

We are trying to integrate PayPal’s UK Payments Pro with the hosted payment page.
We have created a new sandbox UK business account and a UK customer account.
Each time we attempt to make a payment, we get this error:
This transaction can't be processed. Please pay with another card.
Here is the HTML for our POST:
<iframe name="hss_iframe" width="570px" height="540px"></iframe>
<form style="display:none" target="hss_iframe" name="form_iframe" id="form_iframe" method="post" action="https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess">
<input type="hidden" name="buyer_email" value="nata#print-science.com">
<input type="hidden" name="last_name" value="dulger">
<input type="hidden" name="first_name" value="nata">
<input type="hidden" name="notify_url" value="http://xyzprinting.he18.printscience.net/paypalprohostedipn">
<input type="hidden" name="subtotal" value="21.03">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="cancel_return" value="http://xyzprinting.he18.printscience.net/paypal_cancel_2014?order=325558RL">
<input type="hidden" name="return" value="http://xyzprinting.he18.printscience.net/paypal_successful">
<input type="hidden" name="paymentaction" value="sale" />
<input type="hidden" name="template" value="templateD" />
<input type="hidden" name="business" value="ps-uk#printscience.com" />
<input type="hidden" name="cmd" value="_hosted-payment" />
<input type="hidden" name="address1" value="123 Cheapside">
<input type="hidden" name="city" value="London">
<input type="hidden" name="state" value="London">
<input type="hidden" name="zip" value="EC2 R 8AH">
<input type="hidden" name="custom" value="325558RL">
</form>
<script type="text/javascript">
document.form_iframe.submit();
</script>
Try changing the business value to the Secure Merchant ID value that is specified at the top of the Profile page of the Sandbox Test Site. The field should contain something like:
name="business" value="HNZ3QZMCPBAAA"
See the developer guide, p.64: https://www.paypalobjects.com/webstatic/en_GB/developer/docs/pdf/hostedsolution_uk.pdf

Business integration does not work

being a PP developer newbie, I used the PayPal documentation to set up this Business Starter integration:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="business" value="info#mybusiness.com" />
<input type="hidden" name="item_name_1" value="My product 1" />
<input type="hidden" name="amount_1" value="10" />
<input type="hidden" name="quantity_1" value="2" />
<input type="hidden" name="display" value="1" />
<input type="hidden" name="return" value="http://www.mybusiness.com/cgi-bin/gk.cgi?ppstatus=ppy" />
<input type="hidden" name="cancel_return" value="http://www.mybusiness.com//cgi-bin/gk.cgi?ppstatus=ppn" />
<input type="hidden" name="cbt" value="Back to MyBusiness" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="custom" value="MyID" />
<input name="submit" type="image" id="submit" src="../pics/b-pp_01.gif" width="200" height="30" border="0">
</form>
All I get after sending this form away is a blank page with the URL https://www.paypal.com/cgi-bin/webscr
Where did I go wrong?
Thanks for any help,
Emil
There are a few issues with your button (e.g. you don't specify a total amount; I don't think you are doing what you think you are doing with the custom field; etc.) but to start with: you are giving PayPal two different commands (cmd=_cart, cmd=_s_xclick), and likely neither of them is what you want. _cart is for using the PayPal cart, which is a little-used PayPal product where the cart is maintained by PayPal, not on your site. And _s-xclick is for secure, ie encrypted buttons, which you are not doing (your cart fields being plaintext in the form html).
Here's one overview of the button docs:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
... that I hope can help, but ultimately get the reference guide for the particular product you are trying to use, specify only that cmd, and use only the field supported by that product. I also recommend using one of PayPal's (non-javascript) button generators to generate your first few buttons, thus guaranteeing that you are getting valid button html, and then modifying from there rather than trying to write from scratch. Helps get you on the right path.

No confirmation e-mail after Paypal payment

I'm trying to integrate Paypal payments on website and I got this form:
<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" id="paypal_form">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="mail#mail.com" />
<input type="hidden" name="item_name" value="Test payment" />
<input type="hidden" name="item_number" value="777" />
<input type="hidden" name="amount" value="1.99" />
<input type="hidden" name="return" value="http://myhost.com//successpaypal.php" />
<input type="hidden" name="cancel_return" value="http://myhost.com/cancelpaypal.php" />
<input type="hidden" name="no_shipping" value="0" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="currency_code" value="USD" />
<input type="submit" value="Go to PayPal" />
</form>
And payments goes fine until users needs to confirm payment. There is no e-mail sending. I was trying in the sandbox with couple e-mail from couple computers and a couple of days. Is there any way to remove confirmation of payment by e-mail or what can be wrong with my that form?
The sandbox environment doesn't send emails externally. Since anyone can open (and confirm) any email address on any account in sandbox, it would be total chaos.
Instead, you can find all relevant messages that otherwise would've been sent as emails under 'Dashboard' > 'Sandbox notifications' on https://developer.paypal.com/

Paypal shopping cart with multiple items

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.

Passing Address details via the Buy Now button

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