Using a ChargeBee object as string will return errors since it doesn't support it at the moment. By utilizing PHP's magic method: toString, it will try to convert it to string using this method. Also added toArray and __toJSON standard methods to make room for further customization to return.
Thanks for this. A simple return $this->_values function has been needed for so long. Anyone using this as part of their restAPI would largely benefit from this. Please consider adding it to the master version.
Using a ChargeBee object as string will return errors since it doesn't support it at the moment. By utilizing PHP's magic method: toString, it will try to convert it to string using this method. Also added toArray and __toJSON standard methods to make room for further customization to return.