$session_token = Cart66Session::get('PayPalProToken');
// Look for the Express Checkout token
$token = Cart66Common::postVal('token');
if (empty($token)) {
    $token = Cart66Common::getVal('token');
}
if ($session_token == $token) {
    $username = Cart66Setting::getValue('paypalpro_api_username');
    $password = Cart66Setting::getValue('paypalpro_api_password');
    $signature = Cart66Setting::getValue('paypalpro_api_signature');
    // Get details about the buyer
    $pp = new Cart66PayPalExpressCheckout();
    if (CART66_PRO) {
        $pp = new Cart66PayPalPro();
    }
    $details = $pp->GetExpressCheckoutDetails($token);
    $account = false;
    if (Cart66Session::get('Cart66Cart')->hasSubscriptionProducts() || Cart66Session::get('Cart66Cart')->hasMembershipProducts()) {
        // Set up a new Cart66Account and start by pre-populating the data or load the logged in account
        if ($accountId = Cart66Common::isLoggedIn()) {
            $account = new Cart66Account($accountId);
        } else {
            $account = new Cart66Account();
            $account->firstName = $details['FIRSTNAME'];
            $account->lastName = $details['LASTNAME'];
            $account->email = $details['EMAIL'];
            if (isset($_POST['account'])) {
                $acctData = $_POST['account'];
                Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] New Account Data: " . print_r($acctData, true));
                $account->firstName = $acctData['first_name'];
                $account->lastName = $acctData['last_name'];