Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14011

Payment processors not coping with locale for thousands

    Details

    • Type: Bug
    • Status: Won't Do
    • Priority: Trivial
    • Resolution: Won't Do
    • Affects Version/s: 4.4.3
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)

      Description

      On investigating this issue https://github.com/drastik/civicrm_stripe/issues/18 I looked & saw that the bug described would affect 2 payment processors that ship with core (RealEx & EWay). I think that relying on payment processor extensions to translate the amount from a string to a number is not good for stability & I think the conversion should be done on the amount field before it is passed to the payment processors ie.

      $params['amount'] = CRM_Utils_Rule::cleanMoney($params['amount']) * 100;

      Note that there is some funni-ness going on with the BAO::add expecting to have to do the formatting - I think that may be out of date or otherwise belongs in the form / api layer (with the form potentially calling the add action via the api so it only needs to happen in one place) - the translation would only be required if the value was not numeric so this should be avoidable (from contribution::add)

      //if priceset is used, no need to cleanup money
      if (CRM_Utils_Array::value('skipCleanMoney', $params))

      { unset($moneyFields[0]); }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                eileen Eileen McNaughton
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: