digitickets / omnipay-realex

Realex payment gateway driver for the Omnipay library
7 stars 24 forks source link

simplexml property returns object instead of value #4

Closed cfreear closed 9 years ago

cfreear commented 9 years ago
public function getTransactionReference()
{
    return ($this->xml->pasref) ? $this->xml->pasref : null;
}

returns SimpleXMLElement Object ( [0] => 1234567890) instead of string(10) "1234567890"

I'm getting round this by doing $reference = (string)$response->getTransactionRef() but shouldn't we be returning the value directly?:

public function getTransactionReference()
{
    return ($this->xml->pasref) ? (string)$this->xml->pasref : null;
}
coatesap commented 9 years ago

Thanks - good call. I expect I'm probably casting it in my own code too, but it makes much more sense in the response object.