PayWithAmazon\IpnHandler::toJson PHP Method

toJson() public method

Has child elements ['NotificationData'] [XML] - API call XML notification data
public toJson ( )
    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;
    }