Verotel IP protection

Discussion in 'Payments processing' started by erald, Jan 2, 2010.

  1. erald

    erald aMember Pro Customer

    Joined:
    Jul 23, 2009
    Messages:
    20
    Had last week someone who seems to know the Verotel system trying to gain access to my server. He did not succeed but it got my attention that the IP protection which is standard in their script was not build into Amember.

    I solved this by making a class to check for an ip address range.

    The class file IPAddressChecking.php
    Code:
    <?php
    class IPAddressChecking
    
    {
    	var $ip_address;
    	function IPAddressChecking($address='')
    	{
    		$this->ip_address=$address;
    	}
    
    
    	function checkIPorRange () 
    	{
        if (ereg("-",$this->ip_address)) {  
            $ar = explode("-",$this->ip_address);
    		
            $your_long_ip = ip2long($_SERVER["REMOTE_ADDR"]);
            if ( ($your_long_ip >= ip2long($ar[0])) && ($your_long_ip <= ip2long($ar[1])) ) {
                return TRUE;
            }
        } else {
            if ($_SERVER["REMOTE_ADDR"] == $this->ip_address) {
                return TRUE;
            }
        }
        return FALSE;
    }
    
    }
    
    ?>
    Where is says in the ipn.php // Add IP protection

    Code:
     require_once('IPAddressChecking.php');
    
    // If your IP address is not in this range then it gives a verotel error
     $Obj=new IPAddressChecking("195.20.32.128-195.20.32.254");
    
    	if ($Obj->checkIPorRange()) {
    		// do nothing this is right
    	}
    	else{
    		verotel_error("IP Address is not in range!");
    	}
    
    Hope this helps some people.
  2. michelle2010

    michelle2010 New Member

    Joined:
    Jan 2, 2010
    Messages:
    1
    Your Verotel IP protection is right. Here I include some tips that also need to know:-
    Verotel processes the following payment methods:
    Credit Card (Visa, MasterCard)
    Online Check (US Checking Accounts only)
    1-900 (US) Telephone Billing (One-time payments only - not recurring)
    Direct Debit (German Bank Accounts only) - coming soon; Netherlands bank accounts.
    1-900 Telephone Billing Europe in 7 European countries (billed per minute)
    Verotel provides three types of subscription types:
    One-time Billing (subscriptions is valid for a specified length of time - related info)
    Recurring Billing (subscriptions are automatically rebilled at the end of each subscription period until the customer cancels.)
    Smart Recurring Billing (customer receives an e-mail a few days before his subscription is to expire with a link to follow to extend their subscription - customer must re-enter their credit card or bank account number as consent for the rebilling).
  3. gregb

    gregb New Member

    Joined:
    Jul 13, 2011
    Messages:
    1

    Thanks for that.

Share This Page