class libVerify
Here are two brief examples on how to use this class.
To use this class and make it persistant use the following example:
- /**
- * Sample instantiation of this class
- *
- * This example stores the class in a SESSION variable which will allow you
- * to perform multiple lookups/verifications without resubmitting all of the data to this class.
- *
- * file: testid.php
- */
- require_once("libVerify.php");
- session_start();
- $vId = libVerify::getClass();
- $vId::setData("sid","SIDASSIGNEDFROMVERIFYME");
- $vId::setData("first","FirstName");
- $vId::setData("initial","M");
- $vId::setData("last","LastName");
- $vId::setData("gender","M");
- $vId::setData("address","Address");
- $vId::setData("state","OH");
- $vId::setData("country","US");
- $vId::setData("zip","43123");
- $vId::setData("dob","10/01/1960");
- if ( $vId::isVerified() == true ) {
- echo "<h1>You have been verified</h1>\n";
- echo "transaction id is: " . $vId::getTransactionID() . "<br>\n";
- echo "match code is: " . $vId::getMatchCode() . "<br>\n";
- echo "matched with: " . $vId::getMatchCodeText() . "<br>\n";
- echo "return code: " . $vId::getErrorCode() . " (" . $vId::getErrorCodeText() . ")<br>\n";
- echo "<a href=\"testid.php?op=getDataXML\">Get the Data in XML</a>\n";
- echo "<br>\n";
- echo "<a href=\"testid.php?op=getResultXML\">Get the Result in XML</a>\n";
- echo "<br>\n";
- echo "<a href=\"testid.php?op=getRawResult\">Get the Raw Result</a>\n";
- } else {
- echo "<h1>Verification unsuccessful</h1>\n";
- echo "error code: " . $vId::getErrorCode() . " (" . $vId::getErrorCodeText() . ")<br>\n";
- echo "<a href=\"testid.php?op=getDataXML\">Get the Data in XML</a>\n";
- echo "<br>\n";
- echo "<a href=\"testid.php?op=getResultXML\">Get the Result in XML</a>\n";
- echo "<br>\n";
- echo "<a href=\"testid.php?op=getRawResult\">Get the Raw Result</a>\n";
- }
Using this class as standalone (no data will transfer between pages):
- /**
- * Sample instantiation of this class as standalone
- *
- * This example is only for a simple one time verification. It does not allow for
- * multiple submissions/verifications, so you'd have to instantiate this class and
- * set the data for every submission.
- *
- */
- require_once("libVerify.php");
- $vId = new libVerify();
- $vId::setData("sid","SIDASSIGNEDFROMVERIFYME");
- $vId::setData("first","FirstName");
- $vId::setData("initial","M");
- $vId::setData("last","LastName");
- $vId::setData("gender","M");
- $vId::setData("address","Address");
- $vId::setData("state","OH");
- $vId::setData("country","US");
- $vId::setData("zip","43123");
- $vId::setData("dob","10/01/1960");
- if ( $vId::isVerified() == true ) {
- echo "<h1>You have been verified</h1>\n";
- echo "transaction id is: " . $vId::getTransactionID() . "<br>\n";
- echo "match code is: " . $vId::getMatchCode() . "<br>\n";
- echo "matched with: " . $vId::getMatchCodeText() . "<br>\n";
- echo "return code: " . $vId::getErrorCode() . " (" . $vId::getErrorCodeText() . ")<br>\n";
- } else {
- echo "<h1>Verification unsuccessful</h1>\n";
- echo "error code: " . $vId::getErrorCode() . " (" . $vId::getErrorCodeText() . ")<br>\n";
- }
Located in /libVerify.php (line 138)
Array of all the supported countries.
kidsherriff.com supports varies countries. This array contains all of the supported countries. This array contains the country code (as the key) and the text (as the value).
All countries support the passport as the id_type, however, if the country supports other types of id, then the value will be an array in the form of:
array ( 0 => "country_name", 1 => "##", 2 => "##", ... )
For all supported id_types.
Array of all the possible error codes returned by the id query.
kidsherriff.com returns an error code with every verification request. This array contains the error code (as the key) and the text (as the value).
Array of all the types of Identification supported.
kidsherriff.com requires an id_type as well as the id number. This is an array that contains all of the supported id types (as the key) and the text of that type (as the value).
NOTE: ALL COUNTRIES SUPPORT ( 0 => PASSPORT ), THEREFORE IT IS NOT IN THIS LIST.
Pointer to the current instance of this class.
Array of all the counties in Ireland.
Ireland is an exception for required information. In addition to the country, Ireland requires the country of residence to be set. This array contains all of the supported counties. This array contains the county code (as the key) and the county name (as the value).
Array of all the possible match codes returned by the id query.
kidsherriff.com returns a match code with every id request. This match code enables the verifier to check what level and method the person was verified with. This array contains the match code (as the key) and the text (as the value).
Contains the parsed result from a query.
Contains the parsed data to be submitted
Array of all the states in the United States.
The USA is an exception for required information. In addition to the country, kidsherrif requires the state of residence to be set. This array contains all of the supported states. This array contains the state code (as the key) and the state name (as the value).
This is a default constructor work around for PHP5, we don't want to recreate this class.
Construct a new class or load an existing instance if one exists.
Returns the class instance itself.
Gets the countries as an array (without the id_types)
Gets the countries as an HTML drop down selector box (without the id_types)
Gets the countries as an HTML table (without the id_types)
Gets the id_types supported by the country specified by 2 character country code
Gets the id_types supported by the country specified by 2 character country code and returns an HTML dropdown selector box
Gets the id_types supported by the country specified by 2 character country code and returns an HTML table
Gets the country name by country code
Gets the value for a field; returns null if field doesn't exist.
Gets the value for all fields and returns it as an array; returns null if field doesn't exist.
Returns all of the data submitted as a string in XML format for processing
Returns the error code of the request (only AFTER submitRequest() has been run) If the result hasn't been recieved, IE no query made, returns null.
Returns all of the error codes as a string in XML format for processing
Returns the error code text of the request (only AFTER submitRequest() has been run) If the result hasn't been recieved, IE no query made, returns null.
Gets the Ireland Counties as an array.
Gets the Ireland Counties as an HTML dropdown selector box.
Gets the Ireland Counties as an HTML table.
Returns the match code of the request (only AFTER submitRequest() has been run) If the result hasn't been recieved, IE no query made, returns null.
Returns all of the match codes as a string in XML format for processing
Returns the match code text of the request (only AFTER submitRequest() has been run) If the result hasn't been recieved, IE no query made, returns null.
Returns the result from submitRequest() without any modification.
Returns all of the data returned from submitRequest() as a string in XML format for processing
Returns the transaction id of the request (only AFTER submitRequest() has been run) If the result hasn't been recieved, IE no query made, returns null.
Gets the US states as an array
Gets the US states as an HTML dropdown selector box.
Gets the US states as an HTML table.
The heart and soul. Populate data, then run this, it will do everything else for you.
This function will either:
Return the verification status of the the request if it has already been made.
OR
It will attempt to submit the data and verify it (pending at least the "sid" field is set).
This returns true if the person was successfully verified, otherwise they weren't verified for some reason, you'd have to check the error_code and/or match_code
Create and parse the URL for verification based on all data collected thus far.
This requires the field "sid" to be set, if it isn't it returns null.
Forceably construct a new class instance, irregardless of current state.
Returns the new class instance self.
This function is only handy if you are using it in a stateless/persistant environment.
Parses the result from the HTTP query and puts all the proper fields into an array.
Sets the country to $string
Sets the any data to value; this is the preferred method to add any data to be submitted.
Sets the any data to value; this is the preferred method to add any data to be submitted.
An example of this in action is:
- require_once("libVerify.php");
- $vId = libVerify::getClass();
- $data = array (
- "sid" => "SIDASSIGNEDBYVERIFYME",
- "first" => "FirstName",
- "last" => "LastName",
- "country" => "US",
- "zip" => "43123",
- "dob" => "10/01/1960"
- )
- $vId::setDataFromArray($data);
Sets the Ireland Country by 2 character Ireland county code
Sets the US State by 2 character state code
Submits the request based on all current data.
Documentation generated on Wed, 9 Feb 2005 23:00:53 -0500 by phpDocumentor 1.3.0RC3