The new ECHO-PHP Class is now available. ECHO-PHP Class drives all types of real-time credit card and check transactions using ECHO merchant processing’s free secure payment gateway and open-source real-time software. Supports system check, address verification, authorization and deposit, deposit, credit, commercial card, electronic check debit, and more. The new ECHO-PHP Class makes it easier than ever to connect to ECHO using this popular server-side, cross-platform, HTML embedded scripting language. Ideal for all commerce applications. Perfect for ISP/IPPs to use for billing their clients, since this supports electronic checks as well.
By : openecho
<?php
/*==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-*/ // // // Name: ECHOPHP v1.5.3 03-12-2002 // // Description: PHP Class used to interface with // // ECHO (http://www.echo-inc.com). // // Requirements: cURL - http://curl.haxx.se/ // // OpenSSL - http://www.openssl.org // // Refer to ECHO's documentation for more info // // https://wwws.echo-inc.com // // 03-12-2002 - added ec_transaction_dt // // 01-16-2002 - fixed ec_account_type (typo) // // 01-10-2002 - Added ec_account_type and ec_payment_type // // for Alex ;-) // // New to this version are the CyberSource return values: // // cs_factors, cs_flags, cs_host_score, cs_reference_number, // // cs_response, cs_score, cs_status. // // The ECHO gateway now support CyberSource transaction // // types: CI, CE, CB. // // // /*==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-*/
class EchoPHP { var $order_type; var $transaction_type; var $merchant_echo_id; var $merchant_pin; var $isp_echo_id; var $isp_pin; var $authorization; var $billing_ip_address; var $billing_prefix; // as of v1.5 billing_name is no longer being // used by ECHO use billing_first_name, // billing_last_name, and billing_company_name instead var $billing_name; var $billing_first_name; var $billing_last_name; var $billing_company_name; var $billing_address1; var $billing_address2; var $billing_city; var $billing_state; var $billing_zip; var $billing_country; var $billing_phone; var $billing_fax; var $billing_email; var $cc_number; var $ccexp_month; var $ccexp_year; var $counter; var $debug; var $ec_account; var $ec_account_type; var $ec_payment_type; var $ec_address1; var $ec_address2; var $ec_bank_name; var $ec_business_acct; var $ec_city; var $ec_email; var $ec_first_name; var $ec_id_country; var $ec_id_exp_mm; var $ec_id_exp_dd; var $ec_id_exp_yy; var $ec_id_number; var $ec_id_state; var $ec_id_type; var $ec_last_name; var $ec_merchant_ref; var $ec_nbds_code; var $ec_other_name; var $ec_payee; var $ec_rt; var $ec_serial_number; var $ec_state; var $ec_transaction_dt; var $ec_zip; var $grand_total; var $merchant_email; var $merchant_trace_nbr; var $original_amount; var $original_trandate_mm; var $original_trandate_dd; var $original_trandate_yyyy; var $original_reference; var $order_number; var $shipping_flag; var $status; var $shipping_prefix; var $shipping_name; var $shipping_address1; var $shipping_address2; var $shipping_city; var $shipping_state; var $shipping_zip; var $shipping_comments; var $shipping_country; var $shipping_phone; var $shipping_fax; var $shipper; var $shipper_tracking_nbr; var $track1; var $track2; var $EchoResponse; var $echotype1; var $echotype2; var $echotype3; var $openecho; var $avs_result; var $athorization; var $reference; var $EchoSuccess; var $cnp_recurring; var $cnp_security; var $security_result; var $mac; var $cs_factors; var $cs_flag; var $cs_host_score; var $cs_reference_number; var $cs_response; var $cs_score; var $cs_status;
/********************************************** All the get/set methods for the echo properties ***********************************************/ function set_order_type($value) { $this->order_type = $value; }
function get_order_type() { return $this->order_type; }
function set_transaction_type($value) { $this->transaction_type = $value; }
function get_transaction_type() { return $this->transaction_type; }
function set_merchant_echo_id($value) { $this->merchant_echo_id = urlencode($value); }
function get_merchant_echo_id() { return $this->merchant_echo_id; }
function set_merchant_pin($value) { $this->merchant_pin = urlencode($value); }
function get_merchant_pin() { return $this->merchant_pin; }
function set_isp_echo_id($value) { $this->isp_echo_id = urlencode($value); }
function get_isp_echo_id() { return $this->isp_echo_id; }
function set_isp_pin($value) { $this->isp_pin = urlencode($value); }
function get_isp_pin() { return $this->isp_pin; }
function set_authorization($value) { $this->authorization = $value; }
function get_authorization() { return $this->authorization; }
function set_billing_ip_address($value) { $this->billing_ip_address = $value; }
function get_billing_ip_address() { return $this->billing_ip_address; }
function set_billing_prefix($value) { $this->billing_prefix = urlencode($value); }
function get_billing_prefix() { return $this->billing_prefix; }
function set_billing_name($value) { $this->billing_name = urlencode($value); }
function get_billing_name() { return $this->billing_name; }
function set_billing_first_name($value) { $this->billing_first_name = urlencode($value); }
function get_billing_first_name() { return $this->billing_first_name; } function set_billing_last_name($value) { $this->billing_last_name = urlencode($value); }
function get_billing_last_name() { return $this->billing_last_name; } function set_billing_company_name($value) { $this->billing_company_name = urlencode($value); }
function get_billing_company_name() { return $this->billing_company_name; }
function set_billing_address1($value) { $this->billing_address1 = urlencode($value); }
function get_billing_address1() { return $this->billing_address1; }
function set_billing_address2($value) { $this->billing_address2 = urlencode($value); }
function get_billing_address2() { return $this->billing_address2; }
function set_billing_city($value) { $this->billing_city = urlencode($value); }
function get_billing_city() { return $this->billing_city; }
function set_billing_state($value) { $this->billing_state = urlencode($value); }
function get_billing_state() { return $this->billing_state; }
function set_billing_zip($value) { $this->billing_zip = urlencode($value); }
function get_billing_zip() { return $this->billing_zip; }
function set_billing_country($value) { $this->billing_country = urlencode($value); }
function get_billing_country() { return $this->billing_country; }
function set_billing_phone($value) { $this->billing_phone = urlencode($value); }
function get_billing_phone() { return $this->billing_phone; }
function set_billing_fax($value) { $this->billing_fax = urlencode($value); }
function get_billing_fax() { return $this->billing_fax; }
function set_billing_email($value) { $this->billing_email = urlencode($value); }
function get_billing_email() { return $this->billing_email; }
function set_cc_number($value) { $this->cc_number = urlencode($value); }
function get_cc_number() { return $this->cc_number; }
function set_ccexp_month($value) { $this->ccexp_month = $value; }
function get_ccexp_month() { return $this->ccexp_month; }
function set_ccexp_year($value) { $this->ccexp_year = $value; }
function get_ccexp_year() { return $this->ccexp_year; }
function set_counter($value) { $this->counter = $value; }
function get_counter() { return $this->counter; }
function set_debug($value) { $this->debug = $value; }
function get_debug() { return $this->debug; }
function set_ec_account($value) { $this->ec_account = urlencode($value); }
function get_ec_account() { return $this->ec_account; }
function set_ec_account_type($value) { $this->ec_account_type = urlencode($value); }
function get_ec_account_type() { return $this->ec_account_type; }
function set_ec_payment_type($value) { $this->ec_payment_type = urlencode($value); }
function get_ec_payment_type() { return $this->ec_payment_type; }
function set_ec_address1($value) { $this->ec_address1 = urlencode($value); }
function set_ec_address1($value) { $this->ec_address1 = urlencode($value); }
function set_ec_address1($value) { $this->ec_address1 = urlencode($value); }
function get_ec_address1() { return $this->ec_address1; }
function set_ec_address2($value) { $this->ec_address2 = urlencode($value); }
function get_ec_address2() { return $this->ec_address2; }
function set_ec_bank_name($value) { $this->ec_bank_name = urlencode($value); }
function get_ec_bank_name() { return $this->ec_bank_name; }
function set_ec_business_acct($value) { $this->ec_business_acct = urlencode($value); }
function get_ec_business_acct() { return $this->ec_business_acct; }
function set_ec_city($value) { $this->ec_city = $value; }
function get_ec_city() { return $this->ec_city; }
function set_ec_email($value) { $this->ec_email = urlencode($value); }
function get_ec_email() { return $this->ec_email; }
function set_ec_first_name($value) { $this->ec_first_name = urlencode($value); }
function get_ec_first_name() { return $this->ec_first_name; }
function set_ec_id_country($value) { $this->ec_id_country = urlencode($value); }
function get_ec_id_country() { return $this->ec_id_country; }
function set_ec_id_exp_mm($value) { $this->ec_id_exp_mm = $value; }
function get_ec_id_exp_mm() { return $this->ec_id_exp_mm; }
function set_ec_id_exp_dd($value) { $this->ec_id_exp_dd = $value; }
function get_ec_id_exp_dd() { return $this->ec_id_exp_dd; }
function set_ec_id_exp_yy($value) { $this->ec_id_exp_yy = $value; }
function get_ec_id_exp_yy() { return $this->ec_id_exp_yy; }
function set_ec_id_number($value) { $this->ec_id_number = urlencode($value); }
function get_ec_id_number() { return $this->ec_id_number; }
function set_ec_id_state($value) { $this->ec_id_state = urlencode($value); }
function get_ec_id_state() { return $this->ec_id_state; }
function set_ec_id_type($value) { $this->ec_id_type = $value; }
function get_ec_id_type() { return $this->ec_id_type; }
function set_ec_last_name($value) { $this->ec_last_name = urlencode($value); }
function get_ec_last_name() { return $this->ec_last_name; }
function set_ec_merchant_ref($value) { $this->ec_merchant_ref = $value; }
function get_ec_merchant_ref() { return $this->ec_merchant_ref; }
function set_ec_nbds_code($value) { $this->ec_nbds_code = $value; }
function get_ec_nbds_code() { return $this->ec_nbds_code; }
function set_ec_other_name($value) { $this->ec_other_name = urlencode($value); }
function get_ec_other_name() { return $this->ec_other_name; }
function set_ec_payee($value) { $this->ec_payee = urlencode($value); }
function get_ec_payee() { return $this->ec_payee; }
function set_ec_rt($value) { $this->ec_rt = urlencode($value); }
function get_ec_rt() { return $this->ec_rt; }
function set_ec_serial_number($value) { $this->ec_serial_number = urlencode($value); }
function get_ec_serial_number() { return $this->ec_serial_number; }
function set_ec_state($value) { $this->ec_state = urlencode($value); }
function get_ec_state() { return $this->ec_state; }
function set_ec_transaction_dt($value) { $this->ec_transaction_dt = urlencode($value); }
function get_ec_transaction_dt() { return $this->ec_transaction_dt; }
function set_ec_zip($value) { $this->ec_zip = urlencode($value); }
function get_ec_zip() { return $this->ec_zip; }
function set_grand_total($value) { $this->grand_total = sprintf("%01.2f", $value); }
function get_grand_total() { return $this->grand_total; }
function set_merchant_email($value) { $this->merchant_email = urlencode($value); }
function get_merchant_email() { return $this->merchant_email; }
function set_merchant_trace_nbr($value) { $this->merchant_trace_nbr = $value; }
function get_merchant_trace_nbr() { return $this->merchant_trace_nbr; }
function set_original_amount($value) { $this->original_amount = sprintf("%01.2f", $value); }
function get_original_amount() { return $this->original_amount; }
function set_original_trandate_mm($value) { $this->original_trandate_mm = $value; }
function get_original_trandate_mm() { return $this->original_trandate_mm; }
function set_original_trandate_dd($value) { $this->original_trandate_dd = $value; }
function get_original_trandate_dd() { return $this->original_trandate_dd; }
function set_original_trandate_yyyy($value) { $this->original_trandate_yyyy = $value; }
function get_original_trandate_yyyy() { return $this->original_trandate_yyyy; }
function set_original_reference($value) { $this->original_reference = $value; }
function get_original_reference() { return $this->original_reference; }
function set_order_number($value) { $this->order_number = $value; }
function get_order_number() { return $this->order_number; }
function set_shipping_flag($value) { $this->shipping_flag = $value; }
function get_shipping_flag() { return $this->shipping_flag; }
function set_shipping_prefix($value) { $this->shipping_prefix = urlencode($value); }
function get_shipping_prefix() { return $this->shipping_prefix; }
function set_shipping_name($value) { $this->shipping_name = urlencode($value); }
function get_shipping_name() { return $this->shipping_name; }
function set_shipping_address1($value) { $this->shipping_address1 = urlencode($value); }
function get_shipping_address1() { return $this->shipping_address1; }
function set_shipping_address2($value) { $this->shipping_address2 = urlencode($value); }
function get_shipping_address2() { return $this->shipping_address2; }
function set_shipping_city($value) { $this->shipping_city = urlencode($value); }
function get_shipping_city() { return $this->shipping_city; }
function set_shipping_state($value) { $this->shipping_state = urlencode($value); }
function get_shipping_state() { return $this->shipping_state; }
function set_shipping_zip($value) { $this->shipping_zip = urlencode($value); }
function get_shipping_zip() { return $this->shipping_zip; }
function set_shipping_comments($value) { $this->shipping_comments = urlencode($value); }
function get_shipping_comments() { return $this->shipping_comments; }
function set_shipping_country($value) { $this->shipping_country = urlencode($value); }
function get_shipping_country() { return $this->shipping_country; }
function set_shipping_phone($value) { $this->shipping_phone = urlencode($value); }
function get_shipping_phone() { return $this->shipping_phone; }
function set_shipping_fax($value) { $this->shipping_fax = urlencode($value); }
function get_shipping_fax() { return $this->shipping_fax; }
function set_shipper($value) { $this->shipper = urlencode($value); }
function get_shipper() { return $this->shipper; }
function set_shipper_tracking_nbr($value) { $this->shipper_tracking_nbr = $value; }
function get_shipper_tracking_nbr() { return $this->shipper_tracking_nbr; }
function set_track1($value) { $this->track1 = urlencode($value); }
function get_track1() { return $this->track1; }
function set_track2($value) { $this->track2 = urlencode($value); }
function get_track2() { return $this->track2; }
function set_cnp_recurring($value) { $this->cnp_recurring = $value; }
function set_cnp_security($value) { $this->cnp_security = $value; }
function get_EchoResponse() { return $this->EchoResponse; }
function get_echotype1() { return $this->echotype1; }
function get_echotype2() { return $this->echotype2; }
function get_echotype3() { return $this->echotype3; }
function get_openecho() { return $this->openecho; }
function set_EchoServer($value) { $this->EchoServer = $value; }
function get_authorization() { return $this->authorization; }
function get_avs_result() { return $this->avs_result; }
function get_reference() { return $this->reference; }
function get_order_number() { return $this->order_number; }
function get_EchoSuccess() { return $this->EchoSuccess; }
function get_status() { return $this->status; }
function get_security_result() { return $this->GetEchoProp($this->echotype3, "security_result"); }
function get_mac() { return $this->GetEchoProp($this->echotype3, "mac"); }
function GetEchoProp($haystack, $prop) { // prepend garbage in case the property // starts at position 0 .. I know, there's a better way // to do this, right? $haystack = "garbage" . $haystack;
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.