-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/issues/72 fix payflow bug for amount #12019
Conversation
@yashodha Confirming that this is the correct fix. Do any of the other core processors need the same fix? |
Every payment processor should be validating the "amount" is in the right format to be sent upstream as different processor API have different requirements. The "standard" validator is CRM_Core_Payment::getAmount() which @eileenmcnaughton created a few versions back and indicated that payment processors should be updated to use it. This PR does that for the payflow processor in core. Checking other processors is out of scope for this PR, but any chance of creating a basic unit test for this? Could use one of the existing CRM/Core/Payment tests as a template. |
ouch - this wasn't linked from the gitlab so I assumed no work had been done & did #12042 - just comparing now |
OK so thoughts
Re unit tests the way forwards here would be to get the guzzle mock handler in play so we can start to test what is sent to paypal. I won't delay merging this until we have a path on that though. |
@eileenmcnaughton Yep, sorry you are right. See my comments on #12042 |
I've been confused all this time! I thought we were dealing with Paypal here - but it's Payflow Pro - that's a pretty obscure gateway & one that has been deprecated by Paypal for a very long time so I don't believe anyone else will be able to test this (or likely is using this). I'm still a little worried about the euro-thousands separator issue but my risk assessment has changed now I realise we are just dealing with PayFlow - if there are any issues on Euro sites at least with this it will hard-fail quickly, rather than occassionally fail. Probably would have been better in 5.1 but needed to have had a lot more discussion over the last 7 days for that to make sense - ie. @yashodha has not been around since submitting this - so merging to master now |
Overview
PayflowPro throws error due to more than 4 decimal places
This was introduced in
#11016
where database changes supported decimal upto 9 places.
Before
After