Jump to content

"Payment error" with PayPal Sandbox


booblebab

Recommended Posts

I have been trying out the PayPal Sandbox environment with my store (v1.2.3), everything works alright - until the point when the customer completes the order in the PayPal sandbox. It goes through, but the customer gets an email saying "Payment error", and that they must contact the store - and that the order won't be processed until the problem is solved.

The question is - what is the problem?!

I hope to hear from someone!

Link to comment
Share on other sites

I have similar problem. I am using version 1.2.3 too. After process the payment in PayPal Sandbox, you click the button going back to your prestashop page. The item still sits in the cart. it didn't actually process. I didn't see any order made by that process. Any clue by this?

I am going to try this on other old version and see if there is same issue.

If someone has found out what is it, that will be thankful.

Cheers

Link to comment
Share on other sites

Hi,
I have exactly the same problem. The order appears to go fine with PayPal, but the purchasers account on my shop shows there is a problem with the order, as does the email.
I have tried it with V1.2.1 and get the same problem. Sandbox mode is selected.
In my case when you return to the cart from PayPal, the cart is empty, it's just the message on the account and the email.
Does anyone know if this is just an issue with the sandbox mode or is the same with actual payments?

Link to comment
Share on other sites

Hi,
I have exactly the same problem. The order appears to go fine with PayPal, but the purchasers account on my shop shows there is a problem with the order, as does the email.
I have tried it with V1.2.1 and get the same problem. Sandbox mode is selected.
In my case when you return to the cart from PayPal, the cart is empty, it's just the message on the account and the email.
Does anyone know if this is just an issue with the sandbox mode or is the same with actual payments?


Thats where i was going with this was to work out if it was a problem with presta's sandbox mode, i havent had it happen before in the builds ive worked with (as yet).
Link to comment
Share on other sites

Are you using presta paypal module with sandbox mode on?


Yes, I did use the Prestashop Paypal module (fresh installation). Just setup and PayPal account setting as instructed. enable the sandbox. but in 1.2.3.0 verions, it doesnot seem to work. When it returned, the purchased items are still in the cart.
Link to comment
Share on other sites

Again same error. I am using Prestashop version 1.2.4.0. I didn't use PayPal with the Sandbox mode. I made a test purchase on my shop. Everything works great up to a point. I go through PayPal to make the purchase okay. I receive the payment okay. Problem arises when the customer (in this case myself) gets an email saying

"There is a problem with your payment for order #48. Please contact us at your earliest convenience. "
.
On the back end it says that there was an "payment error". I click on the payment error and theres a box that says
"Warning: $14.70 paid instead of $4.28 !"
.

The error for some reason is being thrown because the order is not calculating the shipping costs. Hense only the product is recognized but the shipping is ommitted.

Maybe this information will help anyone who is more knowledgable on how to fix this issue.
Link to comment
Share on other sites

I have the same problem ver 1.1.0.5 -0.118. Been running fine for several months now up until a couple of days ago. Now every order coming through is as the post above from Joenmass, except I have 'Warning, £0.0 paid instead of £x.x' and an email is sent to the customer.
I'd appreciate some help as I'm not programming savvy by a long way....

Link to comment
Share on other sites

Hi everybody !

I've discovered prestashop very recentely, and I'm not used to this system.
I'm trying to use paypal, in sandbox mode, and I get exactely the same problem (payment error, back to website and cart not empty).

prestashop 1.2.4
module paypal standard (not api)

anybody got a solution ?

Link to comment
Share on other sites

I have exactly the same problem, really gutted as i spent weeks setting my store up with languages etc.

Now i must wait for this fix grrrrr. Payment goes through fine, its jsut the customer gets and e-mail saying an error when it went though fine. Then i have to manually go to the back office and put the order to payment accepted.

But its scares the hell out of customers.



I am just waiting for my ssl cert from Rapid ssl, hope its easy to install lol then i can use paypal api :)

Link to comment
Share on other sites

Quick workaround..... untick the 'send email' associated with the error message in your admin panel. Then manually change the order to 'payment accepted'
At least your customers won't get the 'paypal payment error' message. (Orders/order status)
Can't help you more than that, sorry....

Link to comment
Share on other sites

Ha ha, Finally found out why there is Payment Error on the backend when successfully purchase via paypal.

1) Login to your paypal account
2) under : Profile > Payment Receiving Preferences...
Set :
"Block payments sent to me in a currency I do not hold:"
to
"No, accept them and convert them to U.S. Dollars"

if it is set as "Block" or "Ask me" then the process will seems to go thru from front end, but
back office will appear the dreaded "Payment Error" msg in the "Order" section! :)

Gee, almost pulled my hair out, figuring this little setting.

Cheers,
Vincent

Link to comment
Share on other sites

Fantastic- gonna make a lot of people happy with that. Not sure if it's applicable to me as I'm in UK with UK only customers and everything is in ££ , but I will check!
A thought..... because my problem magically fixed itself, is it possible that there was a programming glitch in the Paypal software, that they found and corrected without saying anything ??????
just a thought.

Link to comment
Share on other sites

Hmm I am getting this error in Sandbox mode. I found the option in my regular paypal account and made the change but there does not seem to be a way to do the same in Sandbox mode. Any idea what I can do?

I was concerned the price difference had something to do with the shipping amount but it's a different amount then shipping (though it's close). See the example below:

This is the error:

Warning: $47.11 paid instead of $32.46 !



Item Price: $29.99
Item + Tax: $32.46
Shipping: $13.53
Price Difference on Error: $14.36

Any ideas what I can do? This is my last hiccup before launch.

Link to comment
Share on other sites

  • 1 month later...

After doing more research, it seems the error is due to receiving a few cents more money than I should have. Prestashop expected $12.92 but received $12.95.

Paypal sandbox shows $12.95 transferred.

During Prestashop checkout, $12.92 is shown as being due. Once I get to paypal, before even logging in, $12.95 is shown as being due.

Below is the prestashop form that contains the data submitted to paypal

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="paypal_form" class="hidden">
   <input type="hidden" name="upload" value="1" />
   <input type="hidden" name="first_name" value="xxx" />
   <input type="hidden" name="last_name" value="xxx" />

   <input type="hidden" name="address1" value="123 woman fr" />
       <input type="hidden" name="city" value="xxx" />
   <input type="hidden" name="zip" value="xxx" />
   <input type="hidden" name="country" value="US" />
   <input type="hidden" name="amount" value="5.92" />
   <input type="hidden" name="email" value="[email protected]" />
   <input type="hidden" name="shipping_1" value="7.00" />

       <input type="hidden" name="item_name_1" value="4.7UF 10V Y5V" />
   <input type="hidden" name="amount_1" value="0.17" />

   <input type="hidden" name="quantity_1" value="35" />

       <input type="hidden" name="business" value="[email protected]" />
   <input type="hidden" name="receiver_email" value="[email protected]" />
   <input type="hidden" name="cmd" value="_cart" />
   <input type="hidden" name="charset" value="utf-8" />
   <input type="hidden" name="currency_code" value="USD" />
   <input type="hidden" name="payer_id" value="2" />
   <input type="hidden" name="payer_email" value="[email protected]" />
   <input type="hidden" name="custom" value="6" />

   <input type="hidden" name="return" value="http://xxxxxxxxxx.com/order-confirmation.php?key=a3e3f53695f1718bfbd14f981621d51b&id_cart=6&id_module=4" />
   <input type="hidden" name="cancel_return" value="http://xxxxxxxxxx.com/index.php" />
   <input type="hidden" name="notify_url" value="http://xxxxxxxxx.com/modules/paypal/validation.php" />
       <input type="hidden" name="rm" value="2" />
   <input type="hidden" name="bn" value="PRESTASHOP_WPS" />
   <input type="hidden" name="cbt" value="Return to xxxxxx" />
</form>



As you can see there is a BUG there!!!

The bug is that the "amount" + "shipping_1" = $12.92 but the "amount_1" * "quantity_1" + "shipping_1" = $12.95

The reason this occurs is that the items I'm selling are low cost high quantity parts, and many of these parts have fractions of a cent in their price. In this case, the part is priced at $0.169000 each in my shop, and the paypal module rounded the cost.

Thanks for fixing this!

Link to comment
Share on other sites

I HAVE FIXED THE ROUNDING PROBLEM!!!

Mostly, the problem stems from Paypal not accepting prices for parts that are finer than 1 cent, so trying to submit $0.036 for an item with 1000 quantity wouldn't work, I tried. Stupid PayPal. I submitted a problem report to PayPal.

The only fix, for now, is to send paypal the total amount only, and not any item details. Therefore your paypal invoices will NOT show what parts were ordered, only the total amount. But prestashop does, and this method WORKS.

1. Attached is the file you need. Download it.
2. Now edit the file on line 345 you will find the following:
$products=array(0=>array("name"=>" Purchase",
3. Where the previous line says , replace that (including the <>) with your company's name.
4. Now upload it to your server at shop/modules/paypal
5. Test with the Paypal sandbox.

KyferEz

paypal.php

Link to comment
Share on other sites

Didn't work how? Did you get an error or did the rounding error still occur or did you get a blank page?

No, you cannot. The way paypal works is that it expects an item name, quantity, and price for each item in the cart, so you cannot sum it before sending it to paypal as paypal expects the item price and calculates total price. The way I got around it is to create a single item with a quantity of 1 and price of the total prestashop cart cost (not including shipping).

KyferEz

Link to comment
Share on other sites

ThanX again KyferEz ;

I would need to have products and delivery amount on PayPal invoice. I hope PayPal or some other smart wizzard will find a solution. My work around for now will probably be changing the prices before taxes so that the rounding gets to be with 2 digits only. 8-/

Link to comment
Share on other sites

I don't think you understand the problem completely, because, unless I misunderstand what you meant, that will not fix the problem.

The only way you can fix the problem and keep products on the paypal invoice is for paypal to fix their site and allow resolutions finer than 1cent or for you to not use anything finer than 1 cent for your products.

To illustrate: assume I have the following products and quantities:
Item1 - Qty: 33 PrestashopPrice 0.013 PrestashopCalculatedLineTotal: 0.429
Item2 - Qty: 10 PrestashopPrice 0.011 PrestashopCalculatedLineTotal: 0.110
Prestashop Total Calculated Price: 0.539

To send it to Paypal, you Have to send them the Price and Qty. You also MUST send the item price already rounded to 2 decimal places, therefore you end up with:
Item1 - Qty: 33 PaypalFormatedPrice 0.01 PaypalCalculatedLineTotal: 0.33
Item2 - Qty: 10 PaypalFormatedPrice 0.01 PaypalCalculatedLineTotal: 0.10
Paypal Total Calculated Price: 0.43 <---Will cause Payment error on Prestashop!

This is how Paypal does the calculation, and is how you must send them the data. If you tried to send them an item price of 0.013 for item1, PayPal will return an error immediately. Therefore, the only way around the problem is to get PayPal to allow sending more than 2 decimal places for price (which I have asked them to do but doubt they will) or you have to remove the items from paypal and only send them the total price as prestashop has calculated, which is what my modification does.

KyferEz

Link to comment
Share on other sites

Guess I didn't explain myself well.

I don't have any articles that are priced with three decimal figures.

For example item price without tax is 0,57 tax rate is 25% so PS calculates price with tax as 0,7125. I guessed this was the problem

Attached screen shot

16528_bVNc4OYfNNP0hxC75cLo_t

16529_5iwNLWhw9C6MTWcZ7YrX_t

Link to comment
Share on other sites

Actually, the pricing is even finer than that. Often parts will be 0.00149 or such, because if they order 10000, that's $149 instead of just $100 if the price resolution was just to the hundredths place. Those kinds of orders are uncommon, but not unheard of.

Link to comment
Share on other sites

For example item price without tax is 0,57 tax rate is 25% so PS calculates price with tax as 0,7125. I guessed this was the problem
Ah, Ok. What I need to see now is, add at least 2 items to the cart in such a way that you know you're going to get the "Payment Error" in Prestashop if you checkout. Now, go to the checkout process, and stop on the page where you would select the Pay with Paypal banner.

On that page, right-click in the white space below the paypal banner and then click View Source. In the window that comes up, Search for "<form action="https://www.paypal.com" without the quotes. Copy from that to </form>. Paste that here. You may want to edit out personal information such as your paypal email address.

Also post the correct item price, and quantity, for each item and also the total price from prestashop's cart.

I can then see what's really causing the problem.
Link to comment
Share on other sites

I can see there's an error there, but to be honest, surely the simplest solution would be to just rethink your pricing strategy. Like the previous poster suggested, selling in packs of 10 to avoid having a third decimal place in the price might be a good idea.

Link to comment
Share on other sites

I can see there's an error there, but to be honest, surely the simplest solution would be to just rethink your pricing strategy. Like the previous poster suggested, selling in packs of 10 to avoid having a third decimal place in the price might be a good idea.
Like I said earlier, I already fixed it., I'm just now trying to help someone else. Also like I said, pricing at 10-count doesn't help with parts priced into the thousandths of cents, and I don't want to force customers to buy 100 of a part just to deal with a stupid paypal restriction (a 10 minimum would be Ok, but not for thousands of a cent), and I don't want to loose money or overcharge the customer either. I'm simply using the fix I already made. The continuing reason for this thread is to try to help bambi with his/her related but different problem...
Link to comment
Share on other sites

Hi KyferEz

First of all would like to thank you very much for your efforts to help me out.

I have PM to you the source code you asked for.

As for selling in groups of 10. when ever a customer has to make calculations even simple ones he/she may drop the order So I think it is best to have price per unit (and not per 10) even though it is a very low price.

Cheers :-)

Dan

Link to comment
Share on other sites

Edit: If you read my message previously in this post, it was largely wrong. New info below.

Bambi, while the cause of the error for your site is different, the result is the same, and the solution is the same, and unfortunately unless Paypal will allow the ability to receive fractions of a cent, you have to either live with the Payment Error or live with no items showing in the Paypal invoice.

That said, for your specific case, prestashop could be modified to round item prices before calculating Line Totals, but that's not a hack that will work for me, nor do I think I know prestashop well enough to make those changes.

Link to comment
Share on other sites

  • 5 months later...
  • 5 years later...
Guest locen

Hi, i use prestashop 1.6.0.9 and paypal 3.10.8

In sandbox mode i see "awaiting paypal payment."

I maie thia test because after 17june paypal will update all security policies. If in sandbox modeni receive this status all will work fine?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...