protected function waitForNotificationToBeProcessedBeforeContinuing(
        $identifier, 
        $notificationType
    ) {
        $fileName = $this->folderPath . $identifier . "_" . $notificationType . ".txt";
        // timeout after 1 minute
        $totalChecks = 0;
        while (!file_exists($fileName) && $totalChecks < 20) {
            sleep(5);
            $totalChecks += 1;
        }
        
        if ($totalChecks >= 20) {
            throw new ErrorException(
                "IPN has not been received within timeout period exiting sample"
            );
        }    
    }