A Paypal Refusal Message from HikaShop

  • Posts: 93
  • Thank you received: 5
11 years 4 months ago #3896

howdy

My client recently got this error message whilst a customer was trying to make a sale;

Hello,
 A Paypal notification was refused because the amount received (155.21NZD) is different from the order amount (155.2NZD)

perhaps there needs to be a rounding off somewhere. Also note that Nz has changed its currency in the sense that we no-longer have 1,2 or 5 cent peaces (some entrepreneurs idea of ripping off the public) so now NZ only deals with 10 cents + and the amounts are usually rounded either up or down relative to this minimum amount.

edit: ok I noticed that the amounts are different. perhaps this next section apply's

for example; a sale totaling between $1.01 - $1.05 would be $1.00
and a sale totaling between $1.06 - $1.15 would be rounded to $1.10

not sure if that is the problem but we sure known how to complicate things down here lol.


you Guys are Awesome and have excellent Support! Keep up the great Work!.
Last edit: 11 years 4 months ago by reace.

Please Log in or Create an account to join the conversation.

  • Posts: 75481
  • Thank you received: 11749
  • MODERATOR
11 years 4 months ago #3915

Hi,

The problem is that we don't give the total of the order to paypal but the price of each item and it is recalculated by paypal automatically. Apparently, Paypal rounds prices somewhat differently. Could you try to add the code

$vars["amount"] = round($order->cart->full_total->prices[0]->price_value_with_tax,(int)$currency->currency_locale['int_frac_digits']);
in the file plugins/paypal.php near the line 160, before the line
JHTML::_('behavior.mootools');
and see if that solves the problem ?

If you want to round prices to 1 decimal, you can just edit your currency and change the number of decimals to 1. The drawback is that prices will be displayed as $1.1 and not $1.10 but they will be rounded like you want them. Maybe that's something you already did ?

Please Log in or Create an account to join the conversation.

  • Posts: 93
  • Thank you received: 5
11 years 4 months ago #3925

ill try the fix , and no I haven't touched anything lol. just got the above error when my client emailed me and told me about it.

Great News is that he's had a couple of sales :D

pitty both had complications , The First one the customer was not aware that she had to sign up for a paypal account and failed to proceed through the entire process (sign up for a paypal account)

I will now append the relevant files and test it .. just thinking what the best way is to do this.. test .

create an item for .62 cents and order 2 of them or something lol.


you Guys are Awesome and have excellent Support! Keep up the great Work!.

Please Log in or Create an account to join the conversation.

  • Posts: 75481
  • Thank you received: 11749
  • MODERATOR
11 years 4 months ago #4266

Hi,

Did you had any problems with that change ?
We're thinking of adding it into HikaShop by default for next release and a feed back would be nice to make sure that it works on real cases.

Please Log in or Create an account to join the conversation.

  • Posts: 93
  • Thank you received: 5
11 years 4 months ago #4311

hmm dunno tbh ,

I added it here;

if(!empty($order->cart->coupon)){
			$vars["discount_amount_cart"]=round($order->cart->coupon->discount_value,(int)$currency->currency_locale['int_frac_digits']);
		}
		$vars["amount"] = round($order->cart->full_total->prices[0]->price_value_with_tax,(int)$currency->currency_locale['int_frac_digits']);
		JHTML::_('behavior.mootools');
		$app =& JFactory::getApplication();
		$name = $method->payment_type.'_end.php';
    	$path = JPATH_THEMES.DS.$app->getTemplate().DS.'hikashoppayment'.DS.$name;
    	if(!file_exists($path)){
    		$path = JPATH_PLUGINS .DS.'hikashoppayment'.DS.$name;
    		if(!file_exists($path)){
    			return true;
    		}

but am guessing that it needs to go up a line before the closing bracket... "}" . However I will leave it for now.

/plugins/hikashoppayment/paypal.php

not sure how to test this one...


you Guys are Awesome and have excellent Support! Keep up the great Work!.
Last edit: 11 years 4 months ago by reace.

Please Log in or Create an account to join the conversation.

  • Posts: 75481
  • Thank you received: 11749
  • MODERATOR
11 years 4 months ago #4313

You did well. Before the brackets that would only be active for orders with coupons applied.

We looked a bit more online about rounding issues with paypal and it seems that we're not the only one with such problems as I found posts about similar rounding issues on magento, VirtueMart, etc.

One solution I know of is to get the total amount without the details to paypal. This way it doesn't calculate anything. The downside is that the user doesn't have the details of the order on the paypal payment page which is nice. Not sure yet if we can have both or if there is something we can do on our end to avoid rounding issues but I fear that the only solution will be to have an option to toggle the details so that if users have such issues they can fallback on the amount pre calculated by HikaShop without the details on paypal.

Please Log in or Create an account to join the conversation.

  • Posts: 93
  • Thank you received: 5
11 years 4 months ago #4337

yes it is interesting , can see why not many sales actually get through the ole paypal system.

by sending the products with individual amounts and allowing paypal precidence over the amounts may work. Other issues in the past for myself personally were the Currency was incorrect or something.

looking now at just setting up a CC transaction hopefully theres a few options for this.I think Money Brookers is the one suited to NewZealand Stores.

I on holiday till next week so will see what eventuates then, have incorporated code so client should be ringing if there's any problems.


you Guys are Awesome and have excellent Support! Keep up the great Work!.

Please Log in or Create an account to join the conversation.

Time to create page: 0.040 seconds
Powered by Kunena Forum