payfast
payfast copied to clipboard
Encoding of decimal for Amount field- hashing issue
Edit: it appears the below may be related to a culture info issue- %2C is encoding for a comma, not a decimal point. #19
I've picked up an issue re url encoding of the decimal point for the amount property resulting in an incorrect signature hash. It appears that PayFast don't want it encoded (i.e. it must be a . instead of %2C). From their sandbox after encoding ...&amount=399.1&... From the PayFastRequest after encoding ...&amount=399%2C1&...
Suggestions on working around this? Rounding to the nearest rand isn't an option :)
Hi,
sorry for the delay. I will be working on this library over the next day or so and will see how issues hold up
No hassle. I did a quick fix and a pull request and that you might want to panel beat.
A quick fix that works in the meantime:
Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
Added to the start of the method that redirects to Payfast. Can obviously have some unintended side-effects so use with caution.