- Posts: 9
- Thank you received: 0
error PagSeguro
10 years 11 months ago #216599
by adriel350
error PagSeguro was created by adriel350
-- 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?
-- 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.
10 years 11 months ago #216606
by nicolas
Replied by nicolas on topic error PagSeguro
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.
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.
10 years 11 months ago #216660
by adriel350
Replied by adriel350 on topic error PagSeguro
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.
[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.
10 years 11 months ago #216674
by nicolas
Replied by nicolas on topic error PagSeguro
Hi,
Try like that then:
Try like that then:
Code:
$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.
10 years 11 months ago #216767
by adriel350
Replied by adriel350 on topic error PagSeguro
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.
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.
10 years 11 months ago #216768
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic error PagSeguro
Hi,

Regards,
We always doI recommend updating the plugin so that in future it is not necessary to make this change.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.227 seconds