Sample PHP Code

function testXmlQuery($username,$password,$constraints)
    // transactionFields has all of the fields we want to validate
    // in the transaction tag in the XML output
    $transactionFields = array(





    // actionFields is used to validate the XML tags in the
    // action element
     $actionFields = array(

    $mycurl=new curl();
    $postStr='username='.$username.'&password='.$password. $constraints;
    $url="". $postStr;

    $testXmlSimple= new SimpleXMLElement($mycurl->data);

    if (!isset($testXmlSimple->transaction)) {
            throw new NmExUser('No transactions returned');

    $transNum = 1;
    foreach($testXmlSimple->transaction as $transaction) {
        foreach ($transactionFields as $xmlField) {
            if (!isset($transaction->{$xmlField}[0])){
                throw new NmExUser('Error in transaction_id:'. $transaction->transaction_id[0] .' id  Transaction tag is missing  field ' . $xmlField);
        if (!isset ($transaction->action)) {
            throw new nmExUser('Error, Action tag is missing from transaction_id '. $transaction->transaction_id[0]);

        $actionNum = 1;
        foreach ($transaction->action as $action){
            foreach ($actionFields as $xmlField){
                if (!isset($action->{$xmlField}[0])){
                    throw new NmExUser('Error with transaction_id'.$transaction->transaction_id[0].'
                                        Action number '. $actionNum . ' Action tag is missing field ' . $xmlField);


try {

    $constraints = "&action_type=sale&start_date=20060913";
    $result = testXmlQuery('test123','test1234',$constraints);
    print "Success.\n";

} catch (Exception $e) {



Apply for a Merchant Account Signup for the Payment Gateway

Retail & Internet Merchant Accounts

An Internet Merchant Account is sometimes referred to as a "MOTO" (Mail Order & Telephone Order) Account because they all require the ability to process a credit card payment when there is no physical credit card present to be swiped. A standard retail "swipe" merchant account does not allow processing of these "card-not-present" transactions.

View details »

High Risk Merchant Accounts

If the domestic banks are denying your merchant application because they believe your industry is considered high risk, CyoGate can help! We have an offshore network of merchant processing partners that enable us to provide low cost, high risk merchant solutions to a much wider range of businesses and industries.

View details »

Internet Payment Gateway

The CyoGate Internet Payment Gateway offers one of the quickest and most cost effective ways to accept and process credit card and electronic check payments online. Our payment gateway works with most existing merchant accounts and supports hundreds of popular web shopping carts and eCommerce platforms.

View details »