<?php
/**
 * WHMCS Callback Redirect Script
 *
 * This file can be used to redirect payment gateway callback requests from
 * an old location to a new one preserving POST data.
 *
 * @author     WHMCS Limited <development@whmcs.com>
 * @copyright  Copyright (c) WHMCS Limited 2005-2017
 */

// Enter the new url the callback file is located at
$url = 'https://www.yourdomain.com/new/path/to/paypal.php';

// --- Do not edit below this line. ---

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
if (curl_errno($ch)) {
    $response = 'Could not connect to new callback file: ' . curl_errno($ch) . ' - ' . curl_error($ch);
}
curl_close($ch);

echo $response;