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

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

Related

PayPal instant payment notification (IPN) sandbox

I am trying to enable PayPal IPN on my website. I am now facing some issues with the tests environment - PayPal sandbox.
I am trying to integrate with PHP, so I am using the code of the file paypal_ipn.php from https://github.com/paypal/ipn-code-samples.
I have a test HTML page with which I send the POST actions to paypal_ipn.php:
<form target="_new" method="post" action="http://example.com/paypal_integration/paypal_ipn.php">
<input type="hidden" name="business" value="your#paypal_email.com">
<input type="hidden" name="item_name" value="product name">
<input type="hidden" name="amount" value="1" >
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="custom" value="CUSTOM_CODE_#...">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://example.com/paypal_integration/return.php">
<input type="hidden" name="cancel_return" value="http://example.com/paypal_integration/cancel_return.php">
<input type="hidden" name="cbt" value="description">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="notify_url" value="http://example.com/paypal_integration/paypal_ipn.php">
<input type="submit" value="submit!" />
</form>
The result is "INVALID". How do I go through this problem, in the sandbox environment and after that in live environment? I.e. how to get "VERIFIED" actions in sandbox?
I have solved this:
in paypal account go to https://developer.paypal.com/developer/ipnsimulator/ ;
after that, fill the form: in "transaction type" choose for instance "cart checkout";
in "IPN handler URL" put the link of the IPN receiver page: http://example.com/paypal_integration/paypal_ipn.php
or:
in paypal account, create test accounts: https://developer.paypal.com/developer/accounts ;
log-in with the facilitator account, and then create a test button as indicated here: https://developer.paypal.com/docs/classic/paypal-payments-standard/ht_test-pps-buttons/ (go to: https://www.sandbox.paypal.com/pt/cgi-bin/webscr?cmd=_button-designer );
use the button code, eg.: <input type="hidden" name="hosted_button_id" value="6RNT8A4HBBJRE">, in the button of the website and then simulate a purchase.

Collecting user information

I need to collect information about our high school reunion attendees and allow them to pay via a PayPal button. I've created the PayPal Pay Now button, but not sure what if any information will be collected and sent back to me. Do I need a separate form to collect information or is there a way to make the PayPal button work as the submit button for the data I collect using a form?
You should use a IPN (Instant Payment Notification) for this. There are lots of good templates for this available on GitHub. Your form might look like this:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="business" value="YOUR PAYPAL ID">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="item_name" value="ITEM_NAME">
<input type="hidden" name="item_number" value="ITEM_NUMBER>
<input type="hidden" name="amount" value="TOTAL_AMOUNT">
<input type="hidden" name="custom" value="<?php echo $attendee_id ?>">
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="rm" value="2">
<input type="hidden" name="cbt" value="Return to website">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="return" value="http://domain.com/success.php"/>
<input type="hidden" name="notify_url" value="http://domain.com/ipn.php"/>
<input type="hidden" name="cancel_return" value="http://domain.com/canceled.php"/>
<button type="submit">Pay using PayPal</button>
</form>

first_name last_name paypal ipn

I am trying to send POST vars to paypal ipn like that:
<form class="form-horizontal paypal-button" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" target="_top" style="opacity: 1;">
<input type="hidden" name="button" value="buynow">
<input type="hidden" name="business" value="vendedor#estadosbinarios.com">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="shipping" value="0">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="notify_url" value="http://www.estadosbinarios.com/pagos/paypal_ipn.php">
<input type="hidden" name="return" value="http://www.estadosbinarios.com/pagos/success.php">
<input type="hidden" name="env" value="www.sandbox">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="bn" value="JavaScriptButton_buynow">
<!-- Enable override of buyers’s address stored with PayPal . -->
<input type="hidden" name="address_override" value="1">
<input id="nombre" name="first_name" type="text" placeholder="" class="form-control input-md">
<input id="nombre" name="last_name" type="text" placeholder="" class="form-control input-md">
</form>
But Paypal doesn´t care my vars first_name or last_name, paypal is always getting the vars from user account of paypal and overwriting that var.
Is there any way to choose my vars?
When people pay with PayPal through it is indeed going to use the info provided from the shipping address of their account. You can't get around this with Payments Standard like you're using.
You could switch to the Express Checkout API which would give you the option of collecting the buyers name, address, etc. and then passing that over to PayPal in a way that cannot be overridden. This way you'd get whatever they typed into your site instead of relying on PayPal to provide those details.

How to display only order total in paypal checkout page as like ebay do

have a weird problem.As I have a shopping cart on my website I decided to integrate this to paypal. Its working like charm
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="seller#test.com">
<input type="hidden" name="item_name_1" value="Item Name 1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="shipping_1" value="1.75">
<input type="hidden" name="item_name_2" value="Item Name 2">
<input type="hidden" name="amount_2" value="2.00">
<input type="hidden" name="shipping_2" value="2.50">
<input type="submit" value="PayPal">
</form>
What happens was I decided to not to show item wise descriptions except order total in paypal cehckout page(just like ebay do).
So i change my code as follows
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="seller#test.com">
<input type="hidden" name="amount" value="5.40">
<input type="submit" value="PayPal">
</form>
But when i use this,on the checkout page it appears like this
Please help what I have done wrong? Thanks in Advance.
I dont't know how they do that but i know that, Owner of paypal is eBay Inc.
You can display your company logo by just putting one more hidden field
value="http://fedoraproject.org/w/uploads/e/e2/Fedora-infinity-logo-64-64.png">

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.