Checkout Paypal - Discount problem

Carpcatcher

Joined: 2004-02-02
Posts: 92
Posted: Wed, 2011-02-23 16:16

Hi There,

in December I used it correctly without any problems.
but as this month we have problems.

when the user place a order without discount, It works fine.
when the user place a order and put in a discount-code and When you transfer to the paypal site you get the following error:
--
Error Detected
Error Message: The link you have used to enter the PayPal system contains an incorrectly formatted item amount.
--

I tried multiple numbers, don't use dots or other special characters. I think something’s chances on the paypal side.

Gallery versie = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Thema 2.6, Embed 1.5
PHP versie = 5.2.13 apache2handler
Web server = Apache/2
Database = mysqli 5.0.67-community, lock.system=flock
Toolkits = Gd, Exif, LinkItemToolkit, Thumbnail
Versnelling = none/259200, none/43200
Cart 1.0.12
Checkout 0.4.3
Checkout PDF Invoice 0.1.
Checkout by Email 0.4.
Checkout by Paypal 0.4.0

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2011-02-24 04:23

If you want to post or pm me a link, and a discount code (if one's needed) with details of how to reproduce the error, I'll take a look for you.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2011-02-24 13:26
Quote:
Cart 1.0.12

Oh - you should uninstall this. See http://codex.gallery2.org/Gallery2:Modules:checkout. However I doubt this is related to your problem.

 
Carpcatcher

Joined: 2004-02-02
Posts: 92
Posted: Thu, 2011-02-24 13:42

oke I'll do this evening.
if its correct you received this morning a PM with the discount details :)

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2011-02-24 13:51
Quote:
you received this morning a PM with the discount details

I did; and they don't work. And you have a PM in reply.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2011-02-24 17:46

So now I've tried with both discount codes, and they both work correctly. The discount amount is subtracted from the item prices in paypal so the order total is correct, and there are no error messages. (See attachment)

 
Carpcatcher

Joined: 2004-02-02
Posts: 92
Posted: Thu, 2011-02-24 18:01

I dont understand why it works with you.
with the same username and discount codes me and my users get errors. (see attachment)

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2011-02-24 19:03

send me or post the complete html of the page before the paypal page (the one with checkout.Confirm in the url.)

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2011-02-24 20:24

I think it's a locale problem. The discounted item amounts are being sent to paypal with a , instead of a . in them. I'll have to think about why. The reason I don't see it is because my language settings in the browser use a . for the decimal separator.

 
Carpcatcher

Joined: 2004-02-02
Posts: 92
Posted: Thu, 2011-02-24 21:31

also when I change the local settings to germany or UK or when I use Windows 7 or XP there is no diffrents.

thanks in advance

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2011-02-24 22:42

I can only fix problems that I can reproduce. So - seeing as I can see an issue when using German on your site, but not using English, I'm going to look at that first. If there are still problems after fixing that we can work on them then. OK?

 
Carpcatcher

Joined: 2004-02-02
Posts: 92
Posted: Fri, 2011-02-25 09:39

noo I was trying to say what i did test. change the local setting, but with no solution.

 
Carpcatcher

Joined: 2004-02-02
Posts: 92
Posted: Wed, 2011-03-16 10:08

Hi Alex, I know you're alway busy ;)
but just as a reminder. please don't forget me

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2011-03-16 12:13

Try changing line 33 of modules/checkoutpaypal/templates/Payment.tpl to

  <input type="hidden" name="{$item.ppamount}" value="{$item.amount|number_format:2:".":""}" />

Save the new file as modules/checkoutpaypal/templates/local/Payment.tpl
Clear template caches etc.

 
Carpcatcher

Joined: 2004-02-02
Posts: 92
Posted: Wed, 2011-03-16 13:09

yeah! you're te best :)

it works, thanks!

is it correct that the discount is also a object in paypal?
I did order 1 picture, and paypal gives me the the price of 2 objects..

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2011-03-16 13:15

Yes that's correct. Sometimes it's necessary to add a dummy "discount object" to the order to make the arithmetic work.