cybersource-sdk-php icon indicating copy to clipboard operation
cybersource-sdk-php copied to clipboard

empty XML field causes PHP Catchable fatal error

Open justindossey opened this issue 4 years ago • 0 comments

Observed behavior: with a billTo block in an XML request like this:

  <billTo>
    <firstName>Friday</firstName>
    <lastName>Test</lastName>
    <street1>123 Test St</street1>
    <street2></street2>
    <city>My City</city>
    <state>CA</state>
    <postalCode>12345</postalCode>
    <country>US</country>
    <email>[email protected]</email>
    <customerID>56</customerID>
  </billTo>

I get PHP Catchable fatal error: Object of class stdClass could not be converted to string in lib/CybsSoapClient.php on line 89 This is because the street2 field has no data. Removing that field causes the request to succeed.

Expected behavior: the request will succeed even with an empty field.

justindossey avatar Mar 27 '20 18:03 justindossey