error PagSeguro

  • Posts: 9
  • Thank you received: 0
9 years 1 month ago #216599

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.1
-- Error-message(debug-mod must be tuned on) -- : [HTTP 400] - BAD_REQUEST [11029] - Item amount invalid pattern: 1,490.00. Must fit the patern: \d+.\d{2}

Hi,
I use PagSeguro payment method on my site, provided by hikashop , already took place a purchase using this plugin , so I know that it works , but apparently has a problem when dealing with larger numbers than 1000, the following error appears on the screen:

[HTTP 400] - BAD_REQUEST [11029] - Item amount invalid pattern: 1,490.00. Must fit the patern: \d+.\d{2}

someone could help me solve it , is a misconfiguration on my site or the plugin has some php error?

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 1 month ago #216606

Hi,

Change the line:
$pagSeguroItem->setAmount(number_format($product->order_product_price, 2));
to:
$pagSeguroItem->setAmount(PagSeguroHelper::decimalFormat($product->order_product_price, 2));

in the file plugins/hikashoppayment/pageseguro/pageseguro.php and try again.

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

  • Posts: 9
  • Thank you received: 0
9 years 1 month ago #216660

hi , the following error happens now :

[HTTP 400] - BAD_REQUEST [11029] - Item amount invalid pattern: 1490.00000. Must fit the patern: \d+.\d{2}

Read some articles from people who had the same problem , they say the PagSeguro must receive the price thus : 1490.00 , not so 1490.00000 or so 1,490.00.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
9 years 1 month ago #216674

Hi,

Try like that then:

$pagSeguroItem->setAmount(round(PagSeguroHelper::decimalFormat($product->order_product_price), 2));

The following user(s) said Thank You: adriel350

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

  • Posts: 9
  • Thank you received: 0
9 years 1 month ago #216767

hi , it worked perfectly.

I recommend updating the plugin so that in future it is not necessary to make this change.

Thanks for the quick response and solution , bye.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 1 month ago #216768

Hi,

I recommend updating the plugin so that in future it is not necessary to make this change.

We always do :)

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum