CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute »
  • Community Contributed Payment Processors »
  • eWAY Payment Processor fails when field contains a naked ampersand
Pages: [1]

Author Topic: eWAY Payment Processor fails when field contains a naked ampersand  (Read 2910 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
eWAY Payment Processor fails when field contains a naked ampersand
February 16, 2010, 04:23:38 am
If the request sent to eWAY by the eWAY Payment Processor contains a naked '&' then eWAY responds with ...

Quote
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 created issue CRM-5843 and provided a patch to packages/eWAY/eWAY_GatewayRequest.php which fixes the problem.

Gotchas:
1. I notice that the character '<' is already converted to '&gt;' by the time eWAY_GatewayRequest.php acts on it, so the final string sent to eWAY is '&amp;gt;'. Not sure why '&' causes a problem but '<' is handled OK. Perhaps that points to a better solution than mine.
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.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: eWAY Payment Processor fails when field contains a naked ampersand
February 16, 2010, 01:18:33 pm
Yeah, I've been getting around to logging an issue for ages on this and I finally logged on yesterday too :-)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: eWAY Payment Processor fails when field contains a naked ampersand
February 16, 2010, 09:24:36 pm
Great minds ...

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute »
  • Community Contributed Payment Processors »
  • eWAY Payment Processor fails when field contains a naked ampersand

This forum was archived on 2017-11-26.