public function toJson()
{
$response = $this->simpleXmlObject();
// Merging the remaining fields with the response
$remainingFields = $this->getRemainingIpnFields();
$responseArray = array_merge($remainingFields, (array) $response);
// Converting to JSON format
$response = json_encode($responseArray);
return $response;
}