There's a bug with paypal payments when the payment amount is containing a decimal mark and you're using OJS in a country / locale setting, where the decimal mark is represented by a comma instead of a period. The payment form page, as created by the template "paymentForm.tpl" will contain a locale-specific form of the amount to be paid, e.g. "amount=2,90" instead of "amount=2.90". Paypal reacts to the POST-message containing this number with an error message, saying that the number is not formatted correctly and thus the payment could not be processed.
I'm not sure where exactly the locale aware formatting of the payment amount takes place. However, a possible workaround is this:
In line 120 of "PayPalPlugin.inc.php" format the amount with the non-locale aware version of sprintf, i.e. %.2F:
- Code: Select all
'amount' => sprintf('%.2F', $queuedPayment->getAmount()),
I've tested this workaround on a German system and it worked that way. Any better ideas for achieving this goal?