ppollock Posted September 11, 2004 Share Posted September 11, 2004 HI, I just switched on the Nochex payment module in but when I did a test purchase of ?1340.83, the nochex site gave the error: Syntax error: 1,340.83 is not a valid number. Use the format xx.xx It only seems to happen with values over ?999.99 so it must be the thousands separator. I don't use a thousands separator on my site though. Does anyone know what the problem could be? Thanks Peter Quote Link to comment Share on other sites More sharing options...
imfinlay Posted September 14, 2004 Share Posted September 14, 2004 Hi. This is my first post, so I hope I get this right! (All the following is assuming the nochex APC contrib, latest version) I had the same problem trying to get a "Declined" message to test that functionality... It seems to be the number format in the Nochex form submission, not the currency format in the Admin form. In checkout_nochex.php, around line 242, you'll find: tep_draw_hidden_field('amount', number_format($order->info['total'] * $currencies->currencies['GBP']['value'], $currencies->currencies['GBP']['decimal_places'])) Replace that with tep_draw_hidden_field('amount', number_format($order->info['total'] * $currencies->currencies['GBP']['value'], $currencies->currencies['GBP']['decimal_places'], '.', '')) This changes the result of the PHP "number_format" function to use "." as the decimal and nothing as the thousands separator. For others with the same issue on other payment systems, check the PHP doc at this page As always, backup and test and don't blame me! Best of luck, Ian Quote Link to comment Share on other sites More sharing options...
ppollock Posted September 14, 2004 Author Share Posted September 14, 2004 The man's a genius, give that hero a medal!!! Thank you, Peter Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.