def verify_customer_profile(user)
    
      if user.authnet_customer_profile_id
        resp = self.gateway.get_customer_profile({ :customer_profile_id => user.authnet_customer_profile_id })
        if resp.success? # The profile id is valid
          return true
        else
          user.authnet_customer_profile_id = nil
          user.save
        end
      end
    
      # No customer profile, so create it 
      resp = self.gateway.create_customer_profile({ :profile => { :merchant_customer_id => user.id, :email => user.email }})
      Caboose.log(resp.inspect)
      if resp.success?
        user.authnet_customer_profile_id = resp.params['customer_profile_id']
        user.save
      elsif resp.message.starts_with?("A duplicate record with ID ")
        user.authnet_customer_profile_id = resp.message.gsub("A duplicate record with ID ", '').gsub(" already exists.", '')
        user.save
      else
        Caboose.log("Error creating authnet customer profile for user #{user.id}")
        return false                
      end
      return true         
    end
def verify_customer_profile(user)
    
      if user.authnet_customer_profile_id
        resp = self.gateway.get_customer_profile({ :customer_profile_id => user.authnet_customer_profile_id })
        if resp.success? # The profile id is valid
          return true
        else
          user.authnet_customer_profile_id = nil
          user.save
        end
      end
    
      # No customer profile, so create it 
      resp = self.gateway.create_customer_profile({ :profile => { :merchant_customer_id => user.id, :email => user.email }})
      Caboose.log(resp.inspect)
      if resp.success?
        user.authnet_customer_profile_id = resp.params['customer_profile_id']
        user.save
      elsif resp.message.starts_with?("A duplicate record with ID ")
        user.authnet_customer_profile_id = resp.message.gsub("A duplicate record with ID ", '').gsub(" already exists.", '')
        user.save
      else
        Caboose.log("Error creating authnet customer profile for user #{user.id}")
        return false                
      end
      return true         
    end
=============================================================================
 Verifies that the given user has a CIM record.