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

eWAY Payment Processor fails when a naked ampersand is input

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.3
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      If the request sent to eWAY by the eWAY Payment Processor contains a naked '&' then eWAY responds with ...

      Payment Processor Error message
      : 9008:Error: XML not formated correctly to eWAY standards. Reason:Whitespace is not allowed at this location. Error Code:-1072896749

      The problem occurs because the request sent to eWAY is in XML format, and eWAY expects the '&' to be represented as '&'

      I've attached a patch to packages/eWAY/eWAY_GatewayRequest.php which fixes the problem.

      Gotchas:
      1. I notice that the character '<' is already converted to '>' by the time eWAY_GatewayRequest.php acts on it, so the final string sent to eWAY is '&gt;'. Not sure why '&' causes a problem but '<' is handled OK. Perhaps that points to a better solution.
      2. I think this is a safe change, as the 'hard' fields (CC number, CVN, Expiry Month, and Expiry Year) are all numbers and shouldn't contain ampersands.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              ken Ken West
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: