PHPBuilder - ECHO_PHP- Driver_example



RSS Twitter
Snippets Money

ECHO_PHP- Driver_example

by: Robb Hanisee
|
May 23, 2001

Version: 1.0

Type: Sample Code (HOWTO)

Category: Money

License: GNU General Public License

Description: Illustrates the calling and use of the ECHO Transaction Processing PHP Class. Use this along with the ECHO Real Time Transaction Processing PHP Class download.



<?php
    // this was written and tested in PHP4 so I can't
    // vouch for PHP3.. but it should be fine.

    include ("echophp.class");

    $echoPHP = new EchoPHP;

    $echoPHP->set_EchoServer("https://wwws.echo-inc.com/scripts/INR200.EXE");
    $echoPHP->set_transaction_type("EV");
    $echoPHP->set_order_type("S");
    $echoPHP->set_merchant_echo_id("123>6481573"); // use your own id here
    $echoPHP->set_merchant_pin("98123734");        // use your onw pin here
    $echoPHP->set_billing_phone("503-123-4567");
    $echoPHP->set_billing_ip_address($REMOTE_ADDR);
    $echoPHP->set_billing_name("Visa");
    $echoPHP->set_billing_address1("18303 Some Street");
    $echoPHP->set_billing_city("Some City");
    $echoPHP->set_billing_state("Some State");
    $echoPHP->set_billing_zip("98223");
    $echoPHP->set_billing_country("USA");
    $echoPHP->set_billing_phone("503-123-4569");
    $echoPHP->set_billing_fax("503-123-4569");
    $echoPHP->set_billing_email("jim@openecho.com");

    // check payment info if supplied...
    /*
    $echoPHP->set_ec_bank_name($ec_bank_name);
    $echoPHP->set_ec_first_name($ec_first_name);
    $echoPHP->set_ec_last_name($ec_last_name);
    $echoPHP->set_ec_address1($ec_address1);
    $echoPHP->set_ec_city($ec_city);
    $echoPHP->set_ec_state($ec_state);
    $echoPHP->set_ec_zip($ec_zip);
    $echoPHP->set_ec_rt($ec_rt);
    $echoPHP->set_ec_account($ec_account);
    $echoPHP->set_ec_serial_number($ec_serial_number);
    $echoPHP->set_ec_payee($ec_payee);
    $echoPHP->set_ec_id_state($ec_id_state);
    $echoPHP->set_ec_id_number($ec_id_number);
    $echoPHP->set_ec_id_type($ec_id_type);
    $echoPHP->set_ec_license_state($ec_id_state);
    $echoPHP->set_ec_license_number($ec_id_number);
    */
    $echoPHP->set_debug("T");

    $echoPHP->set_cc_number("4005 5500 0000 0019");
    $echoPHP->set_grand_total(199.34);
    $echoPHP->set_ccexp_month(12);
    $echoPHP->set_ccexp_year(2004);

    $echoPHP->set_counter($echoPHP->getRandomCounter());

    if ($echoPHP->Submit()) {
        print("You made it!<BR>");
    } else {
        print("You didn't make it.<BR>");
    }
    print($echoPHP->get_echotype2());
?>

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Robb Hanisee

Comment:



Comment:

(Maximum characters: 1200). You have characters left.