Exemple #1
0
 protected function _mapFactory($map)
 {
     $class = 'QuickBooks_IPP_Cache_Mapper_' . ucfirst(strtolower($map));
     $file = 'QuickBooks/IPP/Cache/Mapper/' . ucfirst(strtolower($map));
     QuickBooks_Loader::load($file);
     return new $class($map_dsn);
 }
Exemple #2
0
 public static function create($encrypt)
 {
     $class = 'QuickBooks_Encryption_' . ucfirst(strtolower($encrypt));
     $file = '/QuickBooks/Encryption/' . ucfirst(strtolower($encrypt)) . '.php';
     QuickBooks_Loader::load($file);
     return new $class();
 }
Exemple #3
0
 /**
  * Create an instance of a request type object
  * 
  * @param string $request
  * @return QuickBooks_Request
  */
 protected function _requestFactory($request)
 {
     $class = 'QuickBooks_WebConnector_Request_' . ucfirst(strtolower($request));
     $file = '/QuickBooks/WebConnector/Request/' . ucfirst(strtolower($request)) . '.php';
     // Make sure that class gets loaded
     QuickBooks_Loader::load($file, false);
     if (class_exists($class)) {
         return new $class();
     }
     return false;
 }
Exemple #4
0
 /**
  * Create an instance of a driver class from a DSN connection string *or* a connection resource
  * 
  * You can actually pass in *either* a DSN-style connection string OR an already connected database resource
  * 	- mysql://user:pass@localhost:port/database
  * 	- $var (Resource ID #XYZ, valid MySQL connection resource)
  * 
  * @param mixed $dsn_or_conn	A DSN-style connection string or a PHP resource
  * @param array $config			An array of configuration options for the driver
  * @param array $hooks			An array mapping hooks to user-defined hook functions to call
  * @param integer $log_level	
  * @return object				A class instance, a child class of QuickBooks_Driver
  */
 public static function create($dsn_or_conn, $config = array(), $hooks = array(), $log_level = QUICKBOOKS_LOG_NORMAL)
 {
     static $instances = array();
     if (!is_array($hooks)) {
         $hooks = array();
     }
     // Do not serialize the $hooks because they might contain non-serializeable objects
     $key = (string) $dsn_or_conn . serialize($config) . $log_level;
     if (!isset($instances[$key])) {
         if (is_resource($dsn_or_conn)) {
             $scheme = current(explode(' ', get_resource_type($dsn_or_conn)));
         } else {
             $scheme = QuickBooks_Utilities::parseDSN($dsn_or_conn, array(), 'scheme');
         }
         if (false !== strpos($scheme, 'sql')) {
             $scheme = 'Sql_' . ucfirst(strtolower($scheme));
         } else {
             $scheme = ucfirst(strtolower($scheme));
         }
         $class = 'QuickBooks_Driver_' . $scheme;
         $file = '/QuickBooks/Driver/' . str_replace(' ', '/', ucwords(str_replace('_', ' ', strtolower($scheme)))) . '.php';
         //print('class: ' . $class . "\n");
         //print('file: ' . $file . "\n");
         QuickBooks_Loader::load($file);
         if (class_exists($class)) {
             $Driver = new $class($dsn_or_conn, $config);
             $Driver->registerHooks($hooks);
             $Driver->setLogLevel($log_level);
             /*
             static $static = 0;
             $static++;
             print('Constructed new instance ' . $static . ' [' . $key . ']' . "\n");
             mysql_query("INSERT INTO quickbooks_log ( msg, log_datetime ) VALUES ( 'Here is my " . $static . " key: " . $key . "', NOW() )");
             //print_r($hooks);
             */
             // @todo Ugh this is really ugly... maybe have $log_level passed in as a parameter? Not really a driver option at all?
             //if (isset($config['log_level']))
             //{
             //	$driver->setLogLevel($config['log_level']);
             //}
             $instances[$key] = $Driver;
         } else {
             $instances[$key] = null;
         }
     }
     return $instances[$key];
 }
Exemple #5
0
/**
 * QuickBooks driver factory for database logging
 */
QuickBooks_Loader::load('/QuickBooks/Driver/Factory.php');
/**
 * QuickBooks credit card class
 */
QuickBooks_Loader::load('/QuickBooks/Payments/CreditCard.php');
/**
 * QuickBooks merchant service transaction class
 */
QuickBooks_Loader::load('/QuickBooks/Payments/Transaction.php');
/**
 * Token class
 */
QuickBooks_Loader::load('/QuickBooks/Payments/Token.php');
/**
 * QuickBooks Merchant Service implementation
 */
class Quickbooks_Payments
{
    /**
     * No error occurred
     * @var integer
     */
    const OK = QUICKBOOKS_ERROR_OK;
    /**
     * No error occurred
     * @var integer
     */
    const ERROR_OK = QUICKBOOKS_ERROR_OK;
Exemple #6
0
 /**
  * Get an adapter class instance
  * 
  * @param string $adapter
  * @param string $wsdl
  * @param array $soap_options
  * @param integer $loglevel
  * @return boolean
  */
 protected function _adapterFactory($adapter, $wsdl, $soap_options, $loglevel)
 {
     $adapter = ucfirst(strtolower($adapter));
     $file = '/QuickBooks/Adapter/Server/' . $adapter . '.php';
     $class = 'QuickBooks_Adapter_Server_' . $adapter;
     QuickBooks_Loader::load($file);
     if (class_exists($class)) {
         return new $class($wsdl, $soap_options);
     }
     return null;
 }
 * 
 * Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * @author Keith Palmer <*****@*****.**>
 * @license LICENSE.txt 
 *  
 * @package QuickBooks
 */
/**
 * 
 */
QuickBooks_Loader::load('/QuickBooks/Encryption/Factory.php');
/**
 * 
 * 
 */
abstract class QuickBooks_Encryption
{
    /**
     * 
     * 
     * 
     */
    public function prefix($str)
    {
        return '{' . strlen(get_class($this)) . ':' . strtolower(get_class($this)) . '}' . $str;
    }
 * Copyright (c) {2010-04-16} {Keith Palmer / ConsoliBYTE, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * @author Keith Palmer <*****@*****.**>
 * @license LICENSE.txt 
 * 
 * @package QuickBooks
 * @subpackage Client
 */
/**
 * QuickBooks request base class
 */
QuickBooks_Loader::load('/QuickBooks/WebConnector/Request.php');
/**
 * 
 * 
 * 
 */
class QuickBooks_WebConnector_Request_ConnectionError extends QuickBooks_WebConnector_Request
{
    public $ticket;
    public $hresult;
    public $message;
    public function __construct($ticket = null, $hresult = null, $message = null)
    {
        $this->ticket = $ticket;
        $this->hresult = $hresult;
        $this->message = $message;
<?php

/**
 * 
 * 
 * @package QuickBooks
 * @subpackage Object
 */
/**
 * 
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object.php');
/**
 * 
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/SalesReceipt.php');
/**
 * 
 * 
 */
class QuickBooks_QBXML_Object_SalesReceipt_DiscountLine extends QuickBooks_QBXML_Object
{
    /**
     * Create a new QuickBooks SalesReceipt SalesReceiptLine object
     * 
     * @param array $arr
     */
    public function __construct($arr = array())
    {
        parent::__construct($arr);
    }
Exemple #10
0
 *	- QuickBooks HTTP Bridges
 *  - QuickBooks Foxycart integrator (relaying)
 * 
 * 
 * @todo Documentation?
 * 
 * @license LICENSE.txt
 * @author Keith Palmer <*****@*****.**>
 * 
 * @package QuickBooks
 * @subpackage HTTP
 */
/**
 * QuickBooks utilities class
 */
QuickBooks_Loader::load('/QuickBooks/Utilities.php');
define('QUICKBOOKS_HTTP_ERROR_OK', QUICKBOOKS_ERROR_OK);
define('QUICKBOOKS_HTTP_ERROR_CERTIFICATE', 1);
define('QUICKBOOKS_HTTP_ERROR_UNSUPPORTED', 2);
define('QUICKBOOKS_HTTP_METHOD_GET', 'GET');
define('QUICKBOOKS_HTTP_METHOD_POST', 'POST');
define('QUICKBOOKS_HTTP_METHOD_HEAD', 'HEAD');
class QuickBooks_HTTP
{
    const HTTP_400 = 400;
    const HTTP_401 = 401;
    const HTTP_500 = 500;
    protected $_url;
    protected $_request_headers;
    protected $_body;
    protected $_post;
Exemple #11
0
 * Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * @author Keith Palmer <*****@*****.**>
 * @license LICENSE.txt
 * 
 * @package QuickBooks
 * @subpackage Adapter
 */
/**
 * 
 */
QuickBooks_Loader::load('/QuickBooks/Adapter/Server.php');
/**
 * 
 */
class QuickBooks_Adapter_Server_PHP implements QuickBooks_Adapter_Server
{
    protected $_server;
    public function __construct($wsdl, $soap_options)
    {
        $this->_server = new SoapServer($wsdl, $soap_options);
    }
    public function handle($raw_http_input)
    {
        return $this->_server->handle($raw_http_input);
    }
    public function setClass($class, $dsn_or_conn, $map, $onerror, $hooks, $log_level, $raw_http_input, $handler_options, $driver_options, $callback_options)
 * QuickBooks ReceivePayment object container
 * 
 * @author Keith Palmer <*****@*****.**>
 * @license LICENSE.txt 
 * 
 * @package QuickBooks
 * @subpackage Object
 */
/**
 * Base object class
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object.php');
/**
 * Dependency class (applied payment)
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/BillPaymentCheck/AppliedToTxn.php');
/**
 * QuickBooks ReceivePayment object 
 */
class QuickBooks_QBXML_Object_BillPaymentCheck extends QuickBooks_QBXML_Object
{
    /**
     * Create a new QuickBooks_Object_ReceivePayment object
     * 
     * @param array $arr
     */
    public function __construct($arr = array())
    {
        parent::__construct($arr);
    }
    /**
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * This class represents a transaction returned by the QuickBooks Merchant 
 * Service web gateway. 
 * 
 * @package QuickBooks
 * @subpackage MerchantService
 */
/**
 * QuickBooks MerchantService transaction processor
 */
QuickBooks_Loader::load('/QuickBooks/MerchantService.php');
/**
 * XML parser class
 */
QuickBooks_Loader::load('/QuickBooks/XML/Parser.php');
/**
 * QuickBooks Merchant Service transaction class
 */
class QuickBooks_MerchantService_Transaction
{
    /**
     * The type of transaction (QUICKBOOKS_MERCHANTSERVICE_CHARGE, etc.)
     * @var string
     */
    protected $_type;
    /**
     * The transaction ID
     * @var string
     */
    protected $_transID;
 protected static function _ChildObjectsToXML($type, $action, $children, $parentPath = '')
 {
     $Driver = QuickBooks_Driver_Singleton::getInstance();
     $nodes = array();
     $file = '/QuickBooks/QBXML/Schema/Object/' . QuickBooks_Utilities::actionToRequest($action) . '.php';
     $class = 'QuickBooks_QBXML_Schema_Object_' . QuickBooks_Utilities::actionToRequest($action);
     QuickBooks_Loader::load($file);
     $schema_object = new $class();
     $usePath = '';
     if ($parentPath != '') {
         $usePath .= $parentPath . ' ';
     }
     foreach ($children as $child) {
         // Figure out which LinkedTxn method should be used...
         if (strpos($child['table'], "linkedtxn") !== false) {
             if (stripos($action, "add") !== false) {
                 $part = preg_replace("/add/i", "", $action);
                 $part .= "LineAdd";
             } else {
                 if (stripos($action, 'mod') !== false) {
                     $part = preg_replace("/mod/i", "", $action);
                     $part .= "LineMod";
                 }
             }
             if ($schema_object->exists($usePath . 'LinkToTxnID')) {
                 $Node = new QuickBooks_XML_Node("LinkToTxnID", $child['data']->get("ToTxnID"));
                 $nodes[count($nodes)] = $Node;
                 continue;
             } else {
                 if ($schema_object->exists($action . ' ' . $part . ' ' . 'LinkToTxn')) {
                     $Node = new QuickBooks_XML_Node("LinkToTxnID", $child['data']->get("ToTxnID"));
                     $nodes[count($nodes)] = $Node;
                     continue;
                 } else {
                     if ($schema_object->exists($usePath . 'LinkedTxn')) {
                         $Node = new QuickBooks_XML_Node("LinkToTxnID", $child['data']->get("ToTxnID"));
                         $nodes[count($nodes)] = $Node;
                         continue;
                     } else {
                         if ($schema_object->exists($action . ' ' . $part . ' ' . 'LinkedTxn')) {
                             $Node = new QuickBooks_XML_Node("LinkToTxnID", $child['data']->get("ToTxnID"));
                             $nodes[count($nodes)] = $Node;
                             continue;
                         } else {
                             if ($schema_object->exists($usePath . 'ApplyCheckToTxnAdd')) {
                                 $Node = new QuickBooks_XML_Node("ApplyCheckToTxnAdd");
                                 $Node->setChildDataAt($Node->name() . ' ' . 'TxnID', $child['data']->get("ToTxnID"));
                                 $Node->setChildDataAt($Node->name() . ' ' . 'Amount', $child['data']->get("ToTxnID"));
                                 $nodes[count($nodes)] = $Node;
                                 continue;
                             } else {
                                 if ($schema_object->exists($usePath . 'ApplyCheckToTxnMod')) {
                                     $Node = new QuickBooks_XML_Node("ApplyCheckToTxnMod");
                                     $Node->setChildDataAt($Node->name() . ' ' . 'TxnID', $child['data']->get("ToTxnID"));
                                     $Node->setChildDataAt($Node->name() . ' ' . 'Amount', $child['data']->get("ToTxnID"));
                                     $nodes[count($nodes)] = $Node;
                                     continue;
                                 } else {
                                     continue;
                                 }
                             }
                         }
                     }
                 }
             }
         } else {
             if (strpos($child['table'], "dataext") !== false) {
                 continue;
             }
         }
         $map = '';
         $others = array();
         QuickBooks_SQL_Schema::mapToSchema($child['table'] . '.*', QUICKBOOKS_SQL_SCHEMA_MAP_TO_XML, $map, $others);
         $map = str_replace(' *', '', $map);
         $explode = explode(' ', $map);
         $first = trim(current($explode));
         $map = trim(implode(' ', array_slice($explode, 1)));
         if (stripos($action, 'add') !== false) {
             $map = str_replace('Ret', 'Add', $map);
         } else {
             $map = str_replace('Ret', 'Mod', $map);
         }
         // Journal entries have an unusual JournalEntryMod syntax. Instead of
         //	the typical CreditLineMod and DebitLineMod entries, they instead
         //	have just a single combined entry, JournalLineMod.
         if ($action == QUICKBOOKS_MOD_JOURNALENTRY) {
             if ($child['table'] == 'journalentry_journaldebitline' or $child['table'] == 'journalentry_journalcreditline') {
                 $map = 'JournalLineMod';
             }
         }
         $Node = new QuickBooks_XML_Node($map);
         /*
         	$retArr[$index]["table"] = $table;
         	$retArr[$index]["data"] = QuickBooks_SQL_Object($table, null, $arr);
         	$retArr[$index]["children"]
         */
         foreach ($child['data']->asArray() as $field => $value) {
             $map = '';
             $others = array();
             QuickBooks_SQL_Schema::mapToSchema($child['table'] . '.' . $field, QUICKBOOKS_SQL_SCHEMA_MAP_TO_XML, $map, $others);
             if ($Driver->foldsToLower()) {
                 $retpos = strpos($map, 'Ret ');
                 $retval = substr($map, 0, $retpos + 4);
                 $map = substr($map, $retpos + 4);
                 if (stripos($action, 'add') !== false) {
                     $map = str_replace('Ret ', 'Add ', $map);
                 } else {
                     $map = str_replace('Ret ', 'Mod ', $map);
                 }
                 //print('unfolding: {' . $map . '}' . "\n");
                 $map = $schema_object->unfold($map);
                 //print('	unfolded to: [' . $map . ']' . "\n");
             }
             //print($field . ' => ' . $value . "\n");
             //print_r($map);
             //print("\n\n");
             if (!$map or !strlen($value)) {
                 continue;
             }
             // OK, the paths look like this:
             // 	CustomerRet FirstName
             //
             // We don't need the 'CustomerRet' part of it, that's actually incorrect, so we'll strip it off
             $explode = explode(' ', $map);
             $first = trim(current($explode));
             $map = trim(implode(' ', array_slice($explode, 1)));
             if (stripos($action, "add") !== false) {
                 $map = str_replace("Ret", "Add", $map);
             } else {
                 $map = str_replace("Ret", "Mod", $map);
             }
             $map = preg_replace("/.*" . $Node->name() . " /", "", $map);
             /*
             if (strtolower($Node->name()) == "estimatelinemod" and 
             	strpos($map, 'TxnLineID') !== false )
             {
             	$value = -1;
             }
             */
             if (false === strpos($map, ' ')) {
                 if ($schema_object->exists($usePath . $Node->name() . ' ' . $map)) {
                     $use_in_request = true;
                     switch ($schema_object->dataType($usePath . $Node->name() . ' ' . $map)) {
                         case 'AMTTYPE':
                             $value = str_replace(',', '', number_format($value, 2));
                             break;
                         case 'BOOLTYPE':
                             if ($value == 1) {
                                 $value = 'true';
                             } else {
                                 if ($value == 0) {
                                     $value = 'false';
                                 } else {
                                     $use_in_request = false;
                                 }
                             }
                             break;
                         default:
                             break;
                     }
                     if ($use_in_request) {
                         $Child = new QuickBooks_XML_Node($map);
                         $Child->setData($value);
                         $Node->addChild($Child);
                     }
                 } else {
                     // ignore it
                 }
             } else {
                 // Please see comments about JournalEntries above!
                 if ($action == QUICKBOOKS_MOD_JOURNALENTRY) {
                     $map = str_replace(array('JournalCreditLine ', 'JournalDebitLine '), '', $map);
                 }
                 if ($schema_object->exists($usePath . $Node->name() . ' ' . $map)) {
                     $use_in_request = true;
                     switch ($schema_object->dataType($usePath . $Node->name() . ' ' . $map)) {
                         case 'AMTTYPE':
                             $value = str_replace(',', '', number_format($value, 2));
                             break;
                         case 'BOOLTYPE':
                             if ($value == 1) {
                                 $value = 'true';
                             } else {
                                 if ($value == 0) {
                                     $value = 'false';
                                 } else {
                                     $use_in_request = false;
                                 }
                             }
                             break;
                         default:
                             break;
                     }
                     if ($use_in_request) {
                         $Node->setChildDataAt($Node->name() . ' ' . $map, $value, true);
                     }
                 }
             }
         }
         $tNodes = QuickBooks_Callbacks_SQL_Callbacks::_ChildObjectsToXML(strtolower($child['table']), $action, $child['children'], $usePath . $Node->name());
         foreach ($tNodes as $tn) {
             $Node->addChild($tn);
         }
         $nodes[count($nodes)] = $Node;
     }
     return $nodes;
 }
    /**
     * Encryption/decryption classes
     */
    QuickBooks_Loader::load('/QuickBooks/Encryption/Factory.php');
}
if (QUICKBOOKS_FRAMEWORK_CONSTANTS != QUICKBOOKS_FRAMEWORKS) {
    /**
     * Functions for calling callback functions 
     */
    QuickBooks_Loader::load('/QuickBooks/Callbacks.php');
}
if (QUICKBOOKS_FRAMEWORK_MISCELLANEOUS & QUICKBOOKS_FRAMEWORKS) {
    /**
     * Utilities for ensuring values fit into qbXML fields 
     */
    QuickBooks_Loader::load('/QuickBooks/Cast.php');
}
if (QUICKBOOKS_FRAMEWORK_MERCHANTSERVICE & QUICKBOOKS_FRAMEWORKS) {
    /**
     * QuickBooks Merchant Service support
     */
    QuickBooks_Loader::load('/QuickBooks/MerchantService.php');
}
if (QUICKBOOKS_FRAMEWORK_WEBCONNECTOR & QUICKBOOKS_FRAMEWORKS) {
    // Other servers
    QuickBooks_Loader::import('/QuickBooks/WebConnector/Server');
}
if (QUICKBOOKS_FRAMEWORK_QBXML & QUICKBOOKS_FRAMEWORKS) {
    // Objects for the API
    QuickBooks_Loader::import('/QuickBooks/QBXML/Object');
}
Exemple #16
0
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * @author Keith Palmer <*****@*****.**>
 * @license LICENSE.txt
 * 
 * @package QuickBooks
 * @subpackage Adapter
 */
/**
 * Server adapter base-class
 */
QuickBooks_Loader::load('/QuickBooks/Adapter/Server.php');
/**
 * SOAP server base class
 */
QuickBooks_Loader::load('/QuickBooks/SOAP/Server.php');
/**
 * 
 */
class QuickBooks_Adapter_Server_Builtin implements QuickBooks_Adapter_Server
{
    /**
     * QuickBooks_SOAP_Server built-in SOAP server instance
     */
    protected $_server;
    /**
     * Create a new adapter for the built-in SOAP server
     * 
     * @param string $wsdl				The path to the WSDL file
     * @param array $soap_options		An array of SOAP server options
     */
Exemple #17
0
/**
 *
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/Check/ExpenseLine.php');
/**
 *
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/Check/ItemLine.php');
/**
 *
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/Check/ItemGroupLine.php');
/**
 *
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/Check/ApplyCheckToTxn.php');
/**
 * 
 */
class QuickBooks_QBXML_Object_Check extends QuickBooks_QBXML_Object
{
    /**
     * Create a new QuickBooks_Object_Check object
     * 
     * @param array $arr
     */
    public function __construct($arr = array())
    {
        parent::__construct($arr);
    }
    // Path: AccountRef ListID, datatype:
<?php

/**
 * 
 * 
 * Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * @license LICENSE.txt
 * @author Keith Palmer <*****@*****.**>
 * 
 * @package QuickBooks
 * @subpackage IPP
 */
QuickBooks_Loader::load('/QuickBooks/IPP/Service/Report.php');
class QuickBooks_IPP_Service_Report_CustomersWhoOweMe extends QuickBooks_IPP_Service_Report
{
    public function report($Context, $realmID)
    {
        $xml = null;
        return parent::_report($Context, $realmID, QuickBooks_IPP_IDS::RESOURCE_REPORT_CUSTOMERSWHOOWEME, $xml);
    }
}
Exemple #19
0
<?php

/**
 * QuickBooks Unit-test framework
 * 
 * @author Keith Palmer <*****@*****.**>
 * @license LICENSE.txt
 * 
 * @package QuickBooks
 */
QuickBooks_Loader::load('/QuickBooks/UnitTest/Result.php');
class QuickBooks_UnitTest
{
    protected $__result;
    protected $__lastStatus;
    protected $__lastMessage;
    protected $__lastActual;
    protected $__lastExpected;
    public function __construct()
    {
    }
    public final function markTestSkipped()
    {
    }
    public final function markTestIncomplete()
    {
    }
    public final function run($print = true)
    {
        $all = true;
        $result = array();
Exemple #20
0
 * Copyright (c) {2010-04-16} {Keith Palmer / ConsoliBYTE, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * This class represents a transaction returned by the QuickBooks Merchant 
 * Service web gateway. 
 * 
 * @package QuickBooks
 * @subpackage MerchantService
 */
/**
 * QuickBooks MerchantService transaction processor
 */
QuickBooks_Loader::load('/QuickBooks/Payments.php');
/**
 * QuickBooks Merchant Service transaction class
 */
class QuickBooks_Payments_Transaction
{
    protected $_card;
    protected $_data;
    public function __construct($data)
    {
        $this->_data = $data;
        if (isset($data['card'])) {
            $this->_card = QuickBooks_Payments_CreditCard::fromArray($data['card']);
        }
    }
    public function toJSON()
Exemple #21
0
 * 
 * @package QuickBooks
 * @subpackage Driver
 */
/**
 * Abstract base class
 */
QuickBooks_Loader::load('/QuickBooks/Driver.php');
/**
 * SQL scheme generation
 */
QuickBooks_Loader::load('/QuickBooks/SQL/Schema.php');
/**
 * QWC file class (for the GUID ticket)
 */
QuickBooks_Loader::load('/QuickBooks/WebConnector/QWC.php');
/**
 * SQL data type - CHAR
 * @var string
 */
define('QUICKBOOKS_DRIVER_SQL_CHAR', 'char');
/**
 * SQL data type - VARCHAR
 * @var string
 */
define('QUICKBOOKS_DRIVER_SQL_VARCHAR', 'varchar');
/**
 * SQL data type - BOOLEAN
 * @var string
 */
define('QUICKBOOKS_DRIVER_SQL_BOOLEAN', 'boolean');
Exemple #22
0
/**
 * Response container for calls to ->receiveResponseXML()
 */
QuickBooks_Loader::load('/QuickBooks/WebConnector/Result/ReceiveResponseXML.php');
/**
 * Response container for calls to ->sendRequestXML()
 */
QuickBooks_Loader::load('/QuickBooks/WebConnector/Result/SendRequestXML.php');
/**
 * Response container for calls to ->getServerVersion()
 */
QuickBooks_Loader::load('/QuickBooks/WebConnector/Result/ServerVersion.php');
/**
 * Response container for calls to ->clientVersion()
 */
QuickBooks_Loader::load('/QuickBooks/WebConnector/Result/ClientVersion.php');
/**
 * Hook which gets called when the ->authenticate() method gets called
 * @param string
 */
define('QUICKBOOKS_HANDLERS_HOOK_AUTHENTICATE', 'QuickBooks_Handlers::authenticate');
/**
 * Hook which gets called when the ->clientVersion() method gets called
 * @var string
 */
define('QUICKBOOKS_HANDLERS_HOOK_CLIENTVERSION', 'QuickBooks_Handlers::clientVersion');
/**
 * Hook which gets called when the ->closeConnection() method gets called
 * @var string
 */
define('QUICKBOOKS_HANDLERS_HOOK_CLOSECONNECTION', 'QuickBooks_Handlers::closeConnection');
Exemple #23
0
// XML parser
QuickBooks_Loader::load('/QuickBooks/XML.php');
// Context element (holds application information)
QuickBooks_Loader::load('/QuickBooks/IPP/Context.php');
// IPP XML parser
QuickBooks_Loader::load('/QuickBooks/IPP/Parser.php');
// SAML federation of applications
QuickBooks_Loader::load('/QuickBooks/IPP/Federator.php');
// OAuth
QuickBooks_Loader::load('/QuickBooks/IPP/OAuth.php');
// IntuitAnywhere widgets
QuickBooks_Loader::load('/QuickBooks/IPP/IntuitAnywhere.php');
// IDS (Intuit Data Services) base class
QuickBooks_Loader::load('/QuickBooks/IPP/IDS.php');
// Import all IDS service classes
QuickBooks_Loader::import('/QuickBooks/IPP/Service');
/**
 * 
 * 
 *
 */
class QuickBooks_IPP
{
    const API_ADDRECORD = 'API_AddRecord';
    const API_GETBILLINGSTATUS = 'API_GetBillingStatus';
    /**
     * This is not a real API call! 
     */
    const API_GETBASEURL = '_getBaseURL_';
    const API_GETDBINFO = 'API_GetDBInfo';
    const API_GETDBVAR = 'API_GetDBVar';
Exemple #24
0
/** 
 * AES Encryption (depends on mcrypt for now)
 * 
 * Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * @author Keith Palmer <*****@*****.**>
 * 
 * @package QuickBooks
 */
//
QuickBooks_Loader::load('/QuickBooks/Encryption.php');
/**
 * 
 */
class QuickBooks_Encryption_AES extends QuickBooks_Encryption
{
    static function encrypt($key, $plain, $salt = null)
    {
        if (is_null($salt)) {
            $salt = QuickBooks_Encryption::salt();
        }
        $plain = serialize(array($plain, $salt));
        $crypt = mcrypt_module_open('rijndael-256', '', 'ofb', '');
        if (false !== stripos(PHP_OS, 'win') and version_compare(PHP_VERSION, '5.3.0') == -1) {
            $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($crypt), MCRYPT_RAND);
        } else {
Exemple #25
0
<?php

QuickBooks_Loader::load('/QuickBooks/IPP/Object.php');
class QuickBooks_IPP_Object_ShipAddr extends QuickBooks_IPP_Object
{
    public function setState($state)
    {
        return $this->setCountrySubDivisionCode($state);
    }
    public function getState()
    {
        return $this->getCountrySubDivisionCode();
    }
    protected function _order()
    {
        return array('Id' => true, 'Line1' => true, 'Line2' => true, 'Line3' => true, 'Line4' => true, 'Line5' => true, 'City' => true, 'Country' => true, 'CountrySubDivisionCode' => true, 'PostalCode' => true, 'PostalCodeSuffix' => true, 'Default' => true, 'Tag' => true);
    }
}
Exemple #26
0
/**
 * Document class
 */
QuickBooks_Loader::load('/QuickBooks/XML/Document.php');
/**
 * XML parser
 */
QuickBooks_Loader::load('/QuickBooks/XML/Parser.php');
/**
 * XML backend interface
 */
QuickBooks_Loader::load('/QuickBooks/XML/Backend.php');
/**
 * XML parser backends
 */
QuickBooks_Loader::import('/QuickBooks/XML/Backend');
/**
 * QuickBooks XML base class
 */
class QuickBooks_XML
{
    /**
     * Indicates an error *did not* occur
     * @var integer
     */
    const ERROR_OK = 0;
    /**
     * Alias of QUICKBOOKS_XML_ERROR_OK
     */
    const OK = 0;
    /**
<?php

/**
 * QuickBooks Department object container
 * 
 * @author Thomas Rientjes
 * @license LICENSE.txt
 * 
 * @package QuickBooks
 * @subpackage Object
 */
/**
 * 
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object.php');
/**
 * 
 */
class QuickBooks_QBXML_Object_Department extends QuickBooks_QBXML_Object
{
    /**
     * Create a new QuickBooks_Object_Department object
     *
     * @param array $arr
     */
    public function __construct($arr = array())
    {
        parent::__construct($arr);
    }
    /**
     * Set the ListID of the department
Exemple #28
0
/**
 * Invoice lines for Invoices
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/Invoice/InvoiceLine.php');
/**
 * Sales Receipt discount line item
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/Invoice/DiscountLine.php');
/**
 * Sales Receipt shipping line item
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/Invoice/ShippingLine.php');
/**
 * Sales Receipt sales tax line item
 */
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/Invoice/SalesTaxLine.php');
/**
 * QuickBooks Invoice class definition
 */
class QuickBooks_QBXML_Object_Invoice extends QuickBooks_QBXML_Object
{
    /**
     * Create a new QuickBooks Invoice object
     * 
     * @param array $arr
     */
    public function __construct($arr = array())
    {
        parent::__construct($arr);
    }
    /**
/**
 * 
 * 
 * Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/eclipse-1.0.php
 * 
 * @license LICENSE.txt
 * @author Keith Palmer <*****@*****.**>
 * 
 * @package QuickBooks
 * @subpackage IPP
 */
QuickBooks_Loader::load('/QuickBooks/IPP/Service.php');
class QuickBooks_IPP_Service_SalesReceipt extends QuickBooks_IPP_Service
{
    public function findAll($Context, $realmID)
    {
        $xml = null;
        return parent::_findAll($Context, $realmID, QuickBooks_IPP_IDS::RESOURCE_SALESRECEIPT, $xml);
    }
    /**
     * Add a new sales receipt to IDS/QuickBooks
     *
     * @param QuickBooks_IPP_Context $Context
     * @param string $realmID
     * @param QuickBooks_IPP_Object_SalesReceipt $Object		The sales receipt to add
     * @return string											The Id value of the new sales receipt
     */
Exemple #30
0
 * day, then you can register a recurring event instead of queueing up a 
 * request every single day. 
 * 
 * @author Keith Palmer <*****@*****.**>
 * @license LICENSE.txt
 * 
 * @package QuickBooks
 */
/**
 * Various QuickBooks-related utilities
 */
QuickBooks_Loader::load('/QuickBooks/Utilities.php');
/**
 * Helper singleton class
 */
QuickBooks_Loader::load('/QuickBooks/WebConnector/Queue/Singleton.php');
/**
 * QuickBooks queueing class - Queue up actions to be performed in QuickBooks
 */
class QuickBooks_WebConnector_Queue
{
    /**
     * The default username to use when queueing items
     * @var string
     */
    protected $_user;
    /**
     * Create a new QuickBooks queue instance
     * 
     * @param mixed $dsn_or_conn	A DSN-style connection string (i.e.: mysq://root:pass@locahost/database) or a database connection (if you wish to re-use an existing database connection)
     * @param array $config			Configuration array for the driver