├── .gitignore ├── docs ├── img │ ├── favicon.ico │ ├── icons │ │ ├── ok.png │ │ ├── file.gif │ │ ├── class.png │ │ ├── favicon.ico │ │ ├── folder.gif │ │ ├── method.png │ │ ├── search.gif │ │ ├── constant.png │ │ ├── file-php.png │ │ ├── function.png │ │ ├── interface.png │ │ ├── property.png │ │ ├── variable.png │ │ ├── arrow_down.png │ │ ├── arrow_right.png │ │ ├── icon-th-big.png │ │ ├── view_source.png │ │ ├── visibility_public.png │ │ ├── visibility_private.png │ │ ├── icon-folder-open-big.png │ │ ├── visibility_protected.png │ │ └── icon_template.svg │ ├── loader.gif │ ├── iviewer │ │ ├── grab.cur │ │ ├── hand.cur │ │ ├── iviewer.zoom_in.png │ │ ├── iviewer.zoom_fit.png │ │ ├── iviewer.zoom_fit2.gif │ │ ├── iviewer.zoom_in2.gif │ │ ├── iviewer.zoom_out.png │ │ ├── iviewer.zoom_out2.gif │ │ ├── iviewer.zoom_zero.png │ │ ├── iviewer.rotate_left.png │ │ ├── iviewer.rotate_right.png │ │ └── iviewer.zoom_zero2.gif │ ├── apple-touch-icon.png │ ├── glyphicons-halflings.png │ ├── apple-touch-icon-72x72.png │ ├── apple-touch-icon-114x114.png │ └── glyphicons-halflings-white.png ├── js │ ├── prettify │ │ ├── lang-go.js │ │ ├── lang-lua.js │ │ ├── lang-ml.js │ │ ├── lang-sql.js │ │ ├── lang-tex.js │ │ ├── lang-vb.js │ │ ├── lang-apollo.js │ │ ├── lang-scala.js │ │ ├── lang-vhdl.js │ │ ├── lang-wiki.js │ │ ├── lang-proto.js │ │ ├── lang-yaml.js │ │ ├── lang-hs.js │ │ ├── lang-lisp.js │ │ ├── lang-css.js │ │ ├── lang-n.js │ │ └── lang-clj.js │ ├── menu.js │ ├── jquery.mousewheel.min.js │ ├── sidebar.js │ └── jquery.cookie.js ├── css │ ├── prettify.css │ └── jquery.iviewer.css ├── deprecated.html ├── graph_class.html ├── markers.html ├── index.html ├── classes │ ├── Moneybird.SyncObject.html │ └── Moneybird.SyncArray.html └── namespaces │ ├── Moneybird.Error.html │ ├── Moneybird.Detail.html │ ├── Moneybird.Contact.Sync.html │ ├── Moneybird.Invoice.Sync.html │ ├── Moneybird.Invoice.Detail.html │ ├── Moneybird.Estimate.Detail.html │ ├── Moneybird.Invoice.History.html │ ├── Moneybird.Invoice.Payment.html │ ├── Moneybird.Estimate.History.html │ └── Moneybird.IncomingInvoice.Sync.html ├── SyncObject.php ├── SyncArray.php ├── InvalidIdException.php ├── NotValidException.php ├── InvalidConfigException.php ├── InvalidStateException.php ├── InvalidFilterException.php ├── InvalidRequestException.php ├── ServerErrorException.php ├── UnableToSettleException.php ├── Exception.php ├── ForbiddenException.php ├── InvalidServiceTypeException.php ├── NotFoundException.php ├── InvalidSequenceTypeException.php ├── XmlMapper ├── InvalidXmlException.php └── Exception.php ├── HttpClient ├── CurlErrorException.php ├── ConnectionErrorException.php ├── UnknownHttpStatusException.php ├── Exception.php ├── HttpStatusException.php └── Oauth.php ├── NotLoggedInException.php ├── Mapper ├── Exception.php └── Mapable.php ├── Product ├── ArrayObject.php └── Service.php ├── TaxRate ├── ArrayObject.php └── Service.php ├── Domainmodel └── Exception.php ├── ArrayObject ├── UndefinedMethodException.php └── TypeMismatchException.php ├── IncomingInvoice ├── Detail.php ├── ArrayObject.php ├── Payment.php ├── Detail │ └── ArrayObject.php ├── History │ └── ArrayObject.php ├── Payment │ └── ArrayObject.php ├── Sync │ └── ArrayObject.php ├── History.php ├── Subject.php ├── Sync.php └── Service.php ├── Estimate ├── Detail.php ├── ArrayObject.php ├── Detail │ └── ArrayObject.php ├── History │ └── ArrayObject.php ├── Sync │ └── ArrayObject.php ├── Envelope.php ├── History.php ├── Subject.php ├── Sync.php └── Service.php ├── Envelope ├── InvalidMethodException.php └── AbstractEnvelope.php ├── InvoiceProfile ├── ArrayObject.php └── Service.php ├── Payment ├── InvalidMethodException.php └── AbstractPayment.php ├── RecurringTemplate ├── Detail.php ├── Detail │ └── ArrayObject.php ├── ArrayObject.php ├── Subject.php └── Service.php ├── Contact ├── ArrayObject.php ├── Note │ └── ArrayObject.php ├── Sync │ └── ArrayObject.php ├── Sync.php ├── Note.php └── Service.php ├── Invoice ├── ArrayObject.php ├── Payment.php ├── Detail │ └── ArrayObject.php ├── History │ └── ArrayObject.php ├── Payment │ └── ArrayObject.php ├── Sync │ └── ArrayObject.php ├── Envelope.php ├── Subject.php ├── Sync.php ├── Detail.php └── History.php ├── Service.php ├── PdfDocument.php ├── DeleteBySaving.php ├── InvoiceProfile.php ├── Storable.php ├── Error.php ├── CurrentSession.php ├── Sendable.php ├── DirtyAware.php ├── Error └── ArrayObject.php ├── Product.php ├── composer.json ├── Payable.php ├── Mapper.php ├── README.md ├── TaxRate.php ├── MIT-LICENSE.txt ├── Transport.php ├── Disclosure.php ├── tests ├── subclasses.php ├── config.php ├── Product │ └── ServiceTest.php ├── InvoiceProfile │ └── ServiceTest.php ├── TaxRate │ └── ServiceTest.php ├── LogTransportDecoratorTest.php └── ApiConnectorTest.php ├── Detail └── AbstractDetail.php ├── SimpleXMLElement.php ├── LogTransportDecorator.php └── ArrayObject.php /.gitignore: -------------------------------------------------------------------------------- 1 | tests/my-config.php 2 | composer.lock 3 | vendor/ 4 | -------------------------------------------------------------------------------- /docs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/favicon.ico -------------------------------------------------------------------------------- /docs/img/icons/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/ok.png -------------------------------------------------------------------------------- /docs/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/loader.gif -------------------------------------------------------------------------------- /docs/img/icons/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/file.gif -------------------------------------------------------------------------------- /docs/img/icons/class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/class.png -------------------------------------------------------------------------------- /docs/img/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/favicon.ico -------------------------------------------------------------------------------- /docs/img/icons/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/folder.gif -------------------------------------------------------------------------------- /docs/img/icons/method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/method.png -------------------------------------------------------------------------------- /docs/img/icons/search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/search.gif -------------------------------------------------------------------------------- /docs/img/iviewer/grab.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/grab.cur -------------------------------------------------------------------------------- /docs/img/iviewer/hand.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/hand.cur -------------------------------------------------------------------------------- /docs/img/icons/constant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/constant.png -------------------------------------------------------------------------------- /docs/img/icons/file-php.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/file-php.png -------------------------------------------------------------------------------- /docs/img/icons/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/function.png -------------------------------------------------------------------------------- /docs/img/icons/interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/interface.png -------------------------------------------------------------------------------- /docs/img/icons/property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/property.png -------------------------------------------------------------------------------- /docs/img/icons/variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/variable.png -------------------------------------------------------------------------------- /docs/js/prettify/lang-go.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-go.js -------------------------------------------------------------------------------- /docs/js/prettify/lang-lua.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-lua.js -------------------------------------------------------------------------------- /docs/js/prettify/lang-ml.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-ml.js -------------------------------------------------------------------------------- /docs/js/prettify/lang-sql.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-sql.js -------------------------------------------------------------------------------- /docs/js/prettify/lang-tex.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-tex.js -------------------------------------------------------------------------------- /docs/js/prettify/lang-vb.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-vb.js -------------------------------------------------------------------------------- /docs/img/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/img/icons/arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/arrow_down.png -------------------------------------------------------------------------------- /docs/img/icons/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/arrow_right.png -------------------------------------------------------------------------------- /docs/img/icons/icon-th-big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/icon-th-big.png -------------------------------------------------------------------------------- /docs/img/icons/view_source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/view_source.png -------------------------------------------------------------------------------- /docs/js/prettify/lang-apollo.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-apollo.js -------------------------------------------------------------------------------- /docs/js/prettify/lang-scala.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-scala.js -------------------------------------------------------------------------------- /docs/js/prettify/lang-vhdl.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-vhdl.js -------------------------------------------------------------------------------- /docs/js/prettify/lang-wiki.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/js/prettify/lang-wiki.js -------------------------------------------------------------------------------- /docs/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /docs/img/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /docs/img/icons/visibility_public.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/visibility_public.png -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.zoom_in.png -------------------------------------------------------------------------------- /docs/img/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /docs/img/icons/visibility_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/visibility_private.png -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.zoom_fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.zoom_fit.png -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.zoom_fit2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.zoom_fit2.gif -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.zoom_in2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.zoom_in2.gif -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.zoom_out.png -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.zoom_out2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.zoom_out2.gif -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.zoom_zero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.zoom_zero.png -------------------------------------------------------------------------------- /docs/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /docs/img/icons/icon-folder-open-big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/icon-folder-open-big.png -------------------------------------------------------------------------------- /docs/img/icons/visibility_protected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/icons/visibility_protected.png -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.rotate_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.rotate_left.png -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.rotate_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.rotate_right.png -------------------------------------------------------------------------------- /docs/img/iviewer/iviewer.zoom_zero2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/youngguns-nl/moneybird_php_api/HEAD/docs/img/iviewer/iviewer.zoom_zero2.gif -------------------------------------------------------------------------------- /SyncObject.php: -------------------------------------------------------------------------------- 1 | ?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /InvoiceProfile.php: -------------------------------------------------------------------------------- 1 | _discloseNotEmpty[] = 'estimateEmail'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Error.php: -------------------------------------------------------------------------------- 1 | attribute . ': ' . $this->message; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CurrentSession.php: -------------------------------------------------------------------------------- 1 | _discloseNotEmpty[] = 'invoiceId'; 26 | $this->_discloseNotEmpty[] = 'invoiceEmail'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Estimate/History.php: -------------------------------------------------------------------------------- 1 | __toString(); 26 | } 27 | return implode(PHP_EOL, $strings); 28 | } 29 | } -------------------------------------------------------------------------------- /docs/css/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /InvoiceProfile/Service.php: -------------------------------------------------------------------------------- 1 | connector = $connector; 26 | } 27 | 28 | public function getAll() 29 | { 30 | return $this->connector->getAll(__NAMESPACE__); 31 | } 32 | } -------------------------------------------------------------------------------- /IncomingInvoice/History.php: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /Estimate/Subject.php: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /Product.php: -------------------------------------------------------------------------------- 1 | =5.3.0" 15 | }, 16 | "suggest": { 17 | "psr/log": "Log request and responses made to MoneyBird." 18 | }, 19 | "autoload": { 20 | "psr-0": { "Moneybird": "" } 21 | }, 22 | "target-dir": "Moneybird", 23 | "require-dev": { 24 | "psr/log": "^1.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs/js/prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], 3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]); 4 | -------------------------------------------------------------------------------- /Payable.php: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /docs/js/menu.js: -------------------------------------------------------------------------------- 1 | var timeout = 500; 2 | var closetimer = 0; 3 | var ddmenuitem = 0; 4 | 5 | function menu_open() { 6 | menu_canceltimer(); 7 | menu_close(); 8 | ddmenuitem = $(this).find('ul').css('visibility', 'visible'); 9 | } 10 | 11 | function menu_close() { 12 | if (ddmenuitem) ddmenuitem.css('visibility', 'hidden'); 13 | } 14 | 15 | function menu_timer() { 16 | closetimer = window.setTimeout(menu_close, timeout); 17 | } 18 | 19 | function menu_canceltimer() { 20 | if (closetimer) { 21 | window.clearTimeout(closetimer); 22 | closetimer = null; 23 | } 24 | } 25 | 26 | $(document).ready(function() { 27 | $('#file-nav > li').bind('mouseover', menu_open); 28 | $('#file-nav > li').bind('mouseout', menu_timer); 29 | }); 30 | 31 | document.onclick = menu_close; -------------------------------------------------------------------------------- /RecurringTemplate/Subject.php: -------------------------------------------------------------------------------- 1 | 36 | -------------------------------------------------------------------------------- /docs/js/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MoneyBird API PHP Library 2 | ========================= 3 | 4 | V2 5 | ------- 6 | This library is for the v1 MoneyBird API, it will not work on v2. 7 | [v2 API](https://github.com/EmileBons/moneybird-com-php-api) 8 | 9 | V1 10 | ------- 11 | This is a public repository for the PHP library for the MoneyBird API. 12 | 13 | For more information about the MoneyBird API, please visit http://www.moneybird.nl/help/api 14 | 15 | Visit this project on github: https://github.com/youngguns-nl/moneybird_php_api 16 | 17 | Contact the author: Sjors van der Pluijm ; @sjorsvdp 18 | 19 | For technical documentation: please see the docs folder 20 | 21 | For examples and usage: [see github](https://github.com/youngguns-nl/moneybird_php_api/wiki/Examples) 22 | 23 | License 24 | ------- 25 | This project is subject to the MIT license. A copy of the license is included. 26 | 27 | -------------------------------------------------------------------------------- /Contact/Sync.php: -------------------------------------------------------------------------------- 1 | id = $value; 37 | } 38 | } -------------------------------------------------------------------------------- /Product/Service.php: -------------------------------------------------------------------------------- 1 | connector = $connector; 26 | } 27 | 28 | public function getAll() 29 | { 30 | return $this->connector->getAll(__NAMESPACE__); 31 | } 32 | 33 | public function getById($id) 34 | { 35 | foreach ($this->getAll() as $product) { 36 | if ($product->id == $id) { 37 | return $product; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Invoice/Sync.php: -------------------------------------------------------------------------------- 1 | id = $value; 37 | } 38 | } -------------------------------------------------------------------------------- /Estimate/Sync.php: -------------------------------------------------------------------------------- 1 | id = $value; 37 | } 38 | } -------------------------------------------------------------------------------- /IncomingInvoice/Sync.php: -------------------------------------------------------------------------------- 1 | id = $value; 37 | } 38 | } -------------------------------------------------------------------------------- /TaxRate.php: -------------------------------------------------------------------------------- 1 | values = $values; 24 | } 25 | 26 | public function toArray() 27 | { 28 | return $this->values; 29 | } 30 | 31 | public function __get($key) 32 | { 33 | if (array_key_exists($key, $this->values)) { 34 | return $this->values[$key]; 35 | } 36 | throw new Exception('Property ' . $key . ' has not been disclosed'); 37 | } 38 | 39 | public function __set($key, $value) 40 | { 41 | throw new Exception('A disclosure is read-only, don\'t try to write to it.'); 42 | } 43 | 44 | public function __isset($key) 45 | { 46 | return array_key_exists($key, $this->values); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tests/subclasses.php: -------------------------------------------------------------------------------- 1 | '', 7 | 'username' => '', 8 | 'password' => '', 9 | 'authType' => 'http', 10 | 'oauth' => array( 11 | 'consumerKey' => '', 12 | 'consumerSecret' => '', 13 | 'token' => '', 14 | 'tokenSecret' => '', 15 | ), 16 | 'testcontact' => '', 17 | ); 18 | 19 | require_once dirname(__FILE__) . '/../ApiConnector.php'; 20 | 21 | spl_autoload_register('Moneybird\ApiConnector::autoload'); 22 | 23 | Moneybird\ApiConnector::$debug = true; 24 | 25 | if (file_exists(dirname(__FILE__).'/my-config.php')) { 26 | include(dirname(__FILE__).'/my-config.php'); 27 | } 28 | 29 | if (!function_exists('getTransport')) { 30 | function getTransport($config) { 31 | if ($config['authType'] == 'oauth') { 32 | $transport = new Moneybird\HttpClient\Oauth(); 33 | $consumer = new Moneybird\Lib\OAuthConsumer($config['oauth']['consumerKey'], $config['oauth']['consumerSecret'], NULL); 34 | $token = new Moneybird\Lib\OAuthConsumer($config['oauth']['token'], $config['oauth']['tokenSecret']); 35 | $transport->setConsumerAndToken($consumer, $token); 36 | } else { 37 | $transport = new Moneybird\HttpClient(); 38 | $transport->setAuth( 39 | $config['username'], 40 | $config['password'] 41 | ); 42 | } 43 | return $transport; 44 | } 45 | } -------------------------------------------------------------------------------- /Detail/AbstractDetail.php: -------------------------------------------------------------------------------- 1 | _deleted = true; 49 | } 50 | 51 | /** 52 | * Get delete status 53 | * @return bool 54 | */ 55 | public function isDeleted() 56 | { 57 | return $this->_deleted; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /docs/js/prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, 3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); 5 | -------------------------------------------------------------------------------- /docs/js/jquery.mousewheel.min.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) 2 | * Licensed under the MIT License (LICENSE.txt). 3 | * 4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 6 | * Thanks to: Seamus Leahy for adding deltaX and deltaY 7 | * 8 | * Version: 3.0.6 9 | * 10 | * Requires: 1.2.2+ 11 | */ 12 | (function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]= 13 | d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); -------------------------------------------------------------------------------- /docs/js/sidebar.js: -------------------------------------------------------------------------------- 1 | jQuery.expr[':'].Contains = function(a, i, m) { 2 | return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0; 3 | }; 4 | 5 | $(function() { 6 | $("#sidebar-nav").accordion({ 7 | autoHeight: false, 8 | navigation: true, 9 | collapsible: true 10 | }).accordion("activate", false) 11 | .find('a.link').unbind('click').click( 12 | function(ev) { 13 | ev.cancelBubble = true; // IE 14 | if (ev.stopPropagation) { 15 | ev.stopPropagation(); // the rest 16 | } 17 | 18 | return true; 19 | }).prev().prev().remove(); 20 | 21 | $("#sidebar-nav>h3").click(function() { 22 | if ($(this).attr('initialized') == 'true') return; 23 | 24 | $(this).next().find(".sidebar-nav-tree").treeview({ 25 | collapsed: true, 26 | persist: "cookie" 27 | }); 28 | $(this).attr('initialized', true); 29 | }); 30 | }); 31 | 32 | function tree_search(input) { 33 | treeview = $(input).parent().parent().next(); 34 | 35 | // Expand all items 36 | treeview.find('.expandable-hitarea').click(); 37 | 38 | // make all items visible again 39 | treeview.find('li:hidden').show(); 40 | 41 | // hide all items that do not match the given search criteria 42 | if ($(input).val()) { 43 | treeview.find('li').not(':has(a:Contains(' + $(input).val() + '))').hide(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /docs/js/prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a=null; 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], 18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]); 19 | -------------------------------------------------------------------------------- /tests/Product/ServiceTest.php: -------------------------------------------------------------------------------- 1 | object = $connector->getService('Product'); 36 | } 37 | 38 | /** 39 | * Tears down the fixture, for example, closes a network connection. 40 | * This method is called after a test is executed. 41 | */ 42 | protected function tearDown() { 43 | 44 | } 45 | 46 | /** 47 | * @covers Moneybird\Product_Service::getAll 48 | */ 49 | public function testGetAll() { 50 | $products = $this->object->getAll(); 51 | $this->assertInstanceOf('Moneybird\Product\ArrayObject', $products); 52 | $this->assertGreaterThan(0, count($products), 'No products found'); 53 | } 54 | 55 | } 56 | 57 | ?> 58 | -------------------------------------------------------------------------------- /Invoice/Detail.php: -------------------------------------------------------------------------------- 1 | $product->description, 47 | 'ledgerAccountId' => $product->ledgerAccountId, 48 | 'price' => $product->price, 49 | 'taxRateId' => $product->taxRateId, 50 | )); 51 | } 52 | return parent::extract($values, $filter, $isDirty); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tests/InvoiceProfile/ServiceTest.php: -------------------------------------------------------------------------------- 1 | object = $connector->getService('InvoiceProfile'); 36 | } 37 | 38 | /** 39 | * Tears down the fixture, for example, closes a network connection. 40 | * This method is called after a test is executed. 41 | */ 42 | protected function tearDown() { 43 | 44 | } 45 | 46 | /** 47 | * @covers Moneybird\InvoiceProfile_Service::getAll 48 | */ 49 | public function testGetAll() { 50 | $profiles = $this->object->getAll(); 51 | $this->assertInstanceOf('Moneybird\InvoiceProfile\ArrayObject', $profiles); 52 | $this->assertGreaterThan(0, count($profiles), 'No profiles found'); 53 | } 54 | 55 | } 56 | 57 | ?> 58 | -------------------------------------------------------------------------------- /tests/TaxRate/ServiceTest.php: -------------------------------------------------------------------------------- 1 | object = $connector->getService('TaxRate'); 36 | } 37 | 38 | /** 39 | * Tears down the fixture, for example, closes a network connection. 40 | * This method is called after a test is executed. 41 | */ 42 | protected function tearDown() { 43 | 44 | } 45 | 46 | /** 47 | * @covers Moneybird\TaxRate_Service::getAll 48 | */ 49 | public function testGetAll() { 50 | $tests = array( 51 | 'all' => 4, 52 | 'inactive' => 1, 53 | 'sales' => 3, 54 | 'purchase' => 1, 55 | ); 56 | foreach ($tests as $filter => $count) { 57 | $taxrates = $this->object->getAll($filter); 58 | $this->assertInstanceOf('Moneybird\TaxRate\ArrayObject', $taxrates, $filter); 59 | $this->assertEquals($count, count($taxrates)); 60 | } 61 | } 62 | 63 | } 64 | 65 | ?> 66 | -------------------------------------------------------------------------------- /Payment/AbstractPayment.php: -------------------------------------------------------------------------------- 1 | _paymentMethods)) { 59 | throw new InvalidMethodException('Invalid payment method: ' . $value); 60 | } 61 | 62 | $this->paymentMethod = $value; 63 | $this->setDirtyState($isDirty, 'paymentMethod'); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Envelope/AbstractEnvelope.php: -------------------------------------------------------------------------------- 1 | _discloseAttr = array('sendMethod'); 37 | foreach ($this->_discloseNotEmpty as $attr) { 38 | if (!empty($this->$attr)) { 39 | $this->_discloseAttr[] = $attr; 40 | } 41 | } 42 | return parent::disclose($key); 43 | } 44 | 45 | /** 46 | * Set send method 47 | * @param string $value 48 | * @param bool $isDirty new value is dirty, defaults to true 49 | * @throws InvalidMethodException 50 | */ 51 | protected function setSendMethodAttr($value, $isDirty = true) 52 | { 53 | if (!in_array($value, array('hand', 'email', 'post'))) { 54 | throw new InvalidMethodException('Invalid send method: ' . $value); 55 | } 56 | 57 | $this->sendMethod = $value; 58 | $this->setDirtyState($isDirty, 'sendMethod'); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Invoice/History.php: -------------------------------------------------------------------------------- 1 | validate()) { 48 | throw new NotValidException('Unable to validate invoice history'); 49 | } 50 | 51 | if ($invoice === null) { 52 | throw new Exception('$invoice must be instance of Invoice'); 53 | } 54 | 55 | $newInvoice = $service->saveHistory($this, $invoice); 56 | $invoice->setData($newInvoice->toArray(), false); 57 | return $this->reload( 58 | end($invoice->history) 59 | ); 60 | } 61 | 62 | public function delete(ServiceInterface $service) 63 | { 64 | throw new Exception('Not implemented'); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /TaxRate/Service.php: -------------------------------------------------------------------------------- 1 | connector = $connector; 28 | } 29 | 30 | /** 31 | * Get all tax rates 32 | * 33 | * @param string $filter Filter name (all, sales, purchase, inactive) 34 | * @return ArrayObject 35 | * @throws InvalidFilterException 36 | */ 37 | public function getAll($filter = null) 38 | { 39 | $filters = array('all', 'sales', 'purchase', 'inactive'); 40 | if (!in_array($filter, $filters)) { 41 | $message = 'Unknown filter "' . $filter . '" for TaxRates'; 42 | $message .= '; available filters: ' . implode(', ', $filters); 43 | throw new InvalidFilterException($message); 44 | } 45 | 46 | $rates = new ArrayObject; 47 | foreach ($this->connector->getAll(__NAMESPACE__) as $rate) { 48 | if (($filter == 'inactive' && $rate->active) || ($filter != 'inactive' && !$rate->active)) { 49 | continue; 50 | } 51 | if ($filter == 'sales' && $rate->taxRateType != TaxRate::RATE_TYPE_SALES) { 52 | continue; 53 | } elseif ($filter == 'purchase' && $rate->taxRateType != TaxRate::RATE_TYPE_PURCHASE) { 54 | continue; 55 | } 56 | $rates->append($rate); 57 | } 58 | return $rates; 59 | } 60 | } -------------------------------------------------------------------------------- /Contact/Note.php: -------------------------------------------------------------------------------- 1 | validate()) { 41 | throw new NotValidException('Unable to validate contact note'); 42 | } 43 | 44 | if ($contact === null) { 45 | throw new Exception('$contact must be instance of Contact'); 46 | } 47 | 48 | $newContact = $service->saveNote($this, $contact); 49 | $contact->setData($newContact->toArray(), false); 50 | return $this->reload( 51 | end($newContact->notes) 52 | ); 53 | } 54 | 55 | /** 56 | * Deletes a contact note 57 | * @param Service $service 58 | * @param Contact $contact 59 | */ 60 | public function delete(ServiceInterface $service, Contact $contact = null) 61 | { 62 | if ($contact === null) { 63 | throw new Exception('$contact must be instance of Contact'); 64 | } 65 | $service->deleteNote($this, $contact); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /RecurringTemplate/Service.php: -------------------------------------------------------------------------------- 1 | connector = $connector; 32 | } 33 | 34 | /** 35 | * Get template by id 36 | * @param int $id 37 | * @return RecurringTemplate 38 | */ 39 | public function getById($id) 40 | { 41 | return $this->connector->getById(__NAMESPACE__, $id); 42 | } 43 | 44 | /** 45 | * Get all templates 46 | * 47 | * @param string $filter 48 | * @param Subject $parent 49 | * @return ArrayObject 50 | * @throws InvalidFilterException 51 | */ 52 | public function getAll($filter = null, Subject $parent = null) 53 | { 54 | return $this->connector->getAll(__NAMESPACE__, $filter, $parent); 55 | } 56 | 57 | /** 58 | * Updates or inserts a template 59 | * @param RecurringTemplate $template 60 | * @return RecurringTemplate 61 | */ 62 | public function save(RecurringTemplate $template) 63 | { 64 | return $this->connector->save($template); 65 | } 66 | 67 | /** 68 | * Deletes a template 69 | * @param RecurringTemplate $template 70 | * @return self 71 | */ 72 | public function delete(RecurringTemplate $template) 73 | { 74 | $this->connector->delete($template); 75 | return $this; 76 | } 77 | } -------------------------------------------------------------------------------- /docs/css/jquery.iviewer.css: -------------------------------------------------------------------------------- 1 | .iviewer_common { 2 | position:absolute; 3 | bottom:10px; 4 | border: 1px solid #000; 5 | height: 28px; 6 | z-index: 5000; 7 | } 8 | 9 | .iviewer_cursor { 10 | cursor: url(../img/iviewer/hand.cur) 6 8, pointer; 11 | } 12 | 13 | .iviewer_drag_cursor { 14 | cursor: url(../img/iviewer/grab.cur) 6 8, pointer; 15 | } 16 | 17 | .iviewer_button { 18 | width: 28px; 19 | cursor: pointer; 20 | background-position: center center; 21 | background-repeat: no-repeat; 22 | } 23 | 24 | .iviewer_zoom_in { 25 | left: 20px; 26 | background: url(../img/iviewer/iviewer.zoom_in.png); 27 | } 28 | 29 | .iviewer_zoom_out { 30 | left: 55px; 31 | background: url(../img/iviewer/iviewer.zoom_out.png); 32 | } 33 | 34 | .iviewer_zoom_zero { 35 | left: 90px; 36 | background: url(../img/iviewer/iviewer.zoom_zero.png); 37 | } 38 | 39 | .iviewer_zoom_fit { 40 | left: 125px; 41 | background: url(../img/iviewer/iviewer.zoom_fit.png); 42 | } 43 | 44 | .iviewer_zoom_status { 45 | left: 160px; 46 | font: 1em/28px Sans; 47 | color: #000; 48 | background-color: #fff; 49 | text-align: center; 50 | width: 60px; 51 | } 52 | 53 | .iviewer_rotate_left { 54 | left: 227px; 55 | background: #fff url(../img/iviewer/iviewer.rotate_left.png) center center no-repeat; 56 | } 57 | 58 | .iviewer_rotate_right { 59 | left: 262px; 60 | background: #fff url(../img/iviewer/iviewer.rotate_right.png) center center no-repeat; 61 | } 62 | 63 | .viewer 64 | { 65 | width: 100%; 66 | height: 500px; 67 | position: relative; 68 | background: transparent url('../img/loader.gif') no-repeat center center; 69 | } 70 | 71 | .viewer img 72 | { 73 | max-width: none; 74 | } 75 | 76 | .wrapper 77 | { 78 | overflow: hidden; 79 | } 80 | 81 | .iviewer_common 82 | { 83 | border: 0; 84 | bottom: auto; 85 | top: 10px; 86 | } 87 | 88 | .iviewer_zoom_status 89 | { 90 | border: 1px solid black; 91 | } 92 | -------------------------------------------------------------------------------- /SimpleXMLElement.php: -------------------------------------------------------------------------------- 1 | ownerDocument; 23 | $node->appendChild($no->createCDATASection($cdata_text)); 24 | } 25 | 26 | /** 27 | * Create a child with CDATA value 28 | * @param string $name The name of the child element to add. 29 | * @param string $cdata_text The CDATA value of the child element. 30 | */ 31 | public function addChildCData($name, $cdata_text) 32 | { 33 | $child = $this->addChild($name); 34 | $child->addCData($cdata_text); 35 | } 36 | 37 | /** 38 | * Adds a child element to the XML node 39 | * @param string $name The name of the child element to add. 40 | * @param string $value [optional] If specified, the value of the child element. 41 | * @param string $namespace [optional] If specified, the namespace to which the child element belongs. 42 | * @return SimpleXMLElement The addChild method returns a SimpleXMLElement object representing the child added to the XML node. 43 | */ 44 | public function addChild($key, $value = null, $namespace = null) 45 | { 46 | return parent::addChild($key, htmlspecialchars($value), $namespace); 47 | } 48 | 49 | /** 50 | * Add SimpleXMLElement code into a SimpleXMLElement 51 | * @param SimpleXMLElement $append 52 | */ 53 | public function appendXML(SimpleXMLElement $append) 54 | { 55 | if (strlen(trim((string) $append)) == 0) { 56 | $xml = $this->addChild($append->getName()); 57 | foreach ($append->children() as $child) { 58 | $xml->appendXML($child); 59 | } 60 | } else { 61 | $xml = $this->addChild($append->getName(), (string) $append); 62 | } 63 | foreach ($append->attributes() as $n => $v) { 64 | $xml->addAttribute($n, $v); 65 | } 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /LogTransportDecorator.php: -------------------------------------------------------------------------------- 1 | decorator = $decorator; 26 | $this->log = $log; 27 | } 28 | 29 | public function send($url, $requestMethod, $data = null, Array $headers = null) 30 | { 31 | $this->log->info( 32 | 'MoneyBird Request', 33 | [ 34 | 'url' => $url, 35 | 'requestMethod' => $requestMethod, 36 | 'data' => $data, 37 | 'headers' => $headers 38 | ] 39 | ); 40 | 41 | try { 42 | $response = $this->decorator->send($url, $requestMethod, $data, $headers); 43 | 44 | $context = ['response' => $response]; 45 | 46 | $context = array_merge( 47 | $context, 48 | $this->getRequestLogContext() 49 | ); 50 | 51 | $this->log->info('MoneyBird Response', $context); 52 | } catch (\Moneybird\HttpClient\Exception $e) { 53 | $context = ['exception' => $e]; 54 | 55 | $context = array_merge( 56 | $context, 57 | $this->getRequestLogContext() 58 | ); 59 | 60 | $this->log->error('Response failed', $context); 61 | 62 | throw $e; 63 | } 64 | 65 | return $response; 66 | } 67 | 68 | /** 69 | * @return array 70 | */ 71 | protected function getRequestLogContext() 72 | { 73 | return $this->decorator->requestsLeft() === null 74 | ? [] 75 | : ['requestsLeft' => $this->decorator->requestsLeft()]; 76 | } 77 | 78 | public function requestsLeft() 79 | { 80 | return $this->decorator->requestsLeft(); 81 | } 82 | 83 | public function getLastResponse() 84 | { 85 | return $this->decorator->getLastResponse(); 86 | } 87 | 88 | public function setUserAgent($userAgent) 89 | { 90 | return $this->decorator->setUserAgent($userAgent); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /HttpClient/Oauth.php: -------------------------------------------------------------------------------- 1 | consumer = $consumer; 47 | $this->token = $token; 48 | return $this; 49 | } 50 | 51 | /** 52 | * Perform the request 53 | * 54 | * @param string $url URL of request 55 | * @param string $requestMethod (GET|POST|PUT|DELETE) 56 | * @param string $data Data in string format 57 | * @param array $headers 58 | * @return string 59 | * @throws Exception 60 | * @throws HttpStatusException 61 | * @throws UnknownHttpStatusException 62 | * @throws ConnectionErrorException 63 | * @access public 64 | */ 65 | public function send($url, $requestMethod, $data = null, Array $headers = null) 66 | { 67 | $params = array(); 68 | if (false !== ($pos = strpos($url, '?'))) { 69 | $paramPairs = explode('&', substr($url, $pos + 1)); 70 | foreach ($paramPairs as $pair) { 71 | $pairSplit = explode('=', $pair); 72 | $params[$pairSplit[0]] = isset($pairSplit[1]) ? $pairSplit[1] : null; 73 | } 74 | } 75 | $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $requestMethod, $url, $params); 76 | $request->sign_request(new OAuthSignatureMethod(), $this->consumer, $this->token); 77 | 78 | if (is_null($headers)) { 79 | $headers = array(); 80 | } 81 | $headers = array_merge($headers, array($request->to_header())); 82 | 83 | return parent::send($url, $requestMethod, $data, $headers); 84 | } 85 | } -------------------------------------------------------------------------------- /Contact/Service.php: -------------------------------------------------------------------------------- 1 | connector = $connector; 32 | } 33 | 34 | /** 35 | * Get contacts sync status 36 | * @return ContactArray 37 | */ 38 | public function getSyncList() 39 | { 40 | return $this->connector->getSyncList(__NAMESPACE__); 41 | } 42 | 43 | /** 44 | * Get contact by id 45 | * @param int $id 46 | * @return Contact 47 | */ 48 | public function getById($id) 49 | { 50 | return $this->connector->getById(__NAMESPACE__, $id); 51 | } 52 | 53 | /** 54 | * Get contacts by id (max 100) 55 | * @param Array $ids 56 | * @return ContactArray 57 | */ 58 | public function getByIds($ids) 59 | { 60 | return $this->connector->getByIds(__NAMESPACE__, $ids); 61 | } 62 | 63 | /** 64 | * Get all contacts 65 | * 66 | * @return ContactArray 67 | */ 68 | public function getAll() 69 | { 70 | return $this->connector->getAll(__NAMESPACE__); 71 | } 72 | 73 | /** 74 | * Get contact by customer id 75 | * @param string $customerId 76 | * @return Contact 77 | */ 78 | public function getByCustomerId($customerId) 79 | { 80 | return $this->connector->getByNamedId(__NAMESPACE__, 'customer_id', $customerId); 81 | } 82 | 83 | /** 84 | * Updates or inserts a contact 85 | * @param Contact $contact 86 | * @return Contact 87 | */ 88 | public function save(Contact $contact) 89 | { 90 | return $this->connector->save($contact); 91 | } 92 | 93 | /** 94 | * Deletes a contact 95 | * @param Contact $contact 96 | * @return self 97 | */ 98 | public function delete(Contact $contact) 99 | { 100 | $this->connector->delete($contact); 101 | return $this; 102 | } 103 | 104 | /** 105 | * Inserts contact note 106 | * @param Note $note 107 | * @param Contact $contact 108 | * @return Note 109 | */ 110 | public function saveNote(Note $note, Contact $contact) 111 | { 112 | return $this->connector->save($note, $contact); 113 | } 114 | 115 | /** 116 | * Delete contact note 117 | * @param Note $note 118 | * @param Contact $contact 119 | * @return self 120 | */ 121 | public function deleteNote(Note $note, Contact $contact) 122 | { 123 | $this->connector->delete($note, $contact); 124 | return $this; 125 | } 126 | } -------------------------------------------------------------------------------- /docs/img/icons/icon_template.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 21 | 23 | 42 | 49 | 50 | 52 | 53 | 55 | image/svg+xml 56 | 58 | 59 | 60 | 61 | 62 | 67 | 73 | 79 | Co 92 | 93 | 94 | -------------------------------------------------------------------------------- /IncomingInvoice/Service.php: -------------------------------------------------------------------------------- 1 | connector = $connector; 34 | } 35 | 36 | /** 37 | * Get invoices sync status 38 | * @return IncomingInvoice_Array 39 | */ 40 | public function getSyncList() 41 | { 42 | return $this->connector->getSyncList(__NAMESPACE__); 43 | } 44 | 45 | /** 46 | * Get invoice by id 47 | * @param int $id 48 | * @return IncomingInvoice 49 | */ 50 | public function getById($id) 51 | { 52 | return $this->connector->getById(__NAMESPACE__, $id); 53 | } 54 | 55 | /** 56 | * Get invoices by id (max 100) 57 | * @param Array $ids 58 | * @return ArrayObject 59 | */ 60 | public function getByIds(Array $ids) 61 | { 62 | return $this->connector->getByIds(__NAMESPACE__, $ids); 63 | } 64 | 65 | /** 66 | * Get all invoices 67 | * 68 | * @param string|integer $filter Filter name or id (advanced filters) 69 | * @param Subject $parent 70 | * @return ArrayObject 71 | * @throws InvalidFilterException 72 | */ 73 | public function getAll($filter = null, Subject $parent = null) 74 | { 75 | return $this->connector->getAll(__NAMESPACE__, $filter, $parent); 76 | } 77 | 78 | /** 79 | * Updates or inserts an invoice 80 | * @param IncomingInvoice $invoice 81 | * @return IncomingInvoice 82 | */ 83 | public function save(IncomingInvoice $invoice) 84 | { 85 | return $this->connector->save($invoice); 86 | } 87 | 88 | /** 89 | * Deletes an invoice 90 | * @param IncomingInvoice $invoice 91 | * @return self 92 | */ 93 | public function delete(IncomingInvoice $invoice) 94 | { 95 | $this->connector->delete($invoice); 96 | return $this; 97 | } 98 | 99 | /** 100 | * Register a payment for the invoice 101 | * @param IncomingInvoice $invoice 102 | * @param Payment $payment 103 | * @return IncomingInvoice 104 | */ 105 | public function registerPayment(IncomingInvoice &$invoice, Payment $payment) 106 | { 107 | return $this->connector->registerPayment($invoice, $payment); 108 | } 109 | 110 | /** 111 | * Settle the payments 112 | * 113 | * @param IncomingInvoice $invoiceA 114 | * @param IncomingInvoice $invoiceB 115 | * @throws InvalidStateException 116 | * @throws UnableToSettleException 117 | */ 118 | public function settle(IncomingInvoice $invoiceA, IncomingInvoice $invoiceB) 119 | { 120 | return $this->connector->settle($invoiceA, $invoiceB); 121 | } 122 | } -------------------------------------------------------------------------------- /tests/LogTransportDecoratorTest.php: -------------------------------------------------------------------------------- 1 | decorated = $this->getMock('Moneybird\Transport'); 33 | $this->log = $this->getMock('Psr\Log\LoggerInterface'); 34 | $this->decorator = new LogTransportDecorator($this->decorated, $this->log); 35 | } 36 | 37 | public function testLogRequestAndResponse() 38 | { 39 | $url = 'http://test.nl'; 40 | $method = 'POST'; 41 | $params = ['foo' => 'bar']; 42 | $headers = ['cache-control' => 'public']; 43 | $expectedResponse = 'content'; 44 | 45 | $this->decorated->expects($this->any()) 46 | ->method('requestsLeft') 47 | ->will($this->returnValue(3)); 48 | 49 | $this->decorated->expects($this->once()) 50 | ->method('send') 51 | ->with($url, $method, $params, $headers) 52 | ->will($this->returnValue($expectedResponse)); 53 | 54 | $this->log->expects($this->at(0)) 55 | ->method('info') 56 | ->with('MoneyBird Request', [ 57 | 'url' => $url, 58 | 'requestMethod' => $method, 59 | 'data' => $params, 60 | 'headers' => $headers 61 | ]); 62 | 63 | $this->log->expects($this->at(1)) 64 | ->method('info') 65 | ->with('MoneyBird Response', [ 66 | 'response' => $expectedResponse, 67 | 'requestsLeft' => 3 68 | ]); 69 | 70 | $response = $this->decorator->send($url, $method, $params, $headers); 71 | 72 | $this->assertEquals($expectedResponse, $response); 73 | } 74 | 75 | /** 76 | * @expectedException \Moneybird\HttpClient\Exception 77 | */ 78 | public function testLogFailedRequest() 79 | { 80 | $url = 'http://test.nl'; 81 | $method = 'POST'; 82 | $params = ['foo' => 'bar']; 83 | $headers = ['cache-control' => 'public']; 84 | $exception = new \Moneybird\HttpClient\Exception('test'); 85 | 86 | $this->decorated->expects($this->any()) 87 | ->method('requestsLeft') 88 | ->will($this->returnValue(4)); 89 | 90 | $this->decorated->expects($this->once()) 91 | ->method('send') 92 | ->will($this->throwException($exception)); 93 | 94 | $this->log->expects($this->at(0)) 95 | ->method('info') 96 | ->with('MoneyBird Request', [ 97 | 'url' => $url, 98 | 'requestMethod' => $method, 99 | 'data' => $params, 100 | 'headers' => $headers 101 | ]); 102 | 103 | $this->log->expects($this->at(1)) 104 | ->method('error') 105 | ->with('Response failed', [ 106 | 'exception' => $exception, 107 | 'requestsLeft' => 4 108 | ]); 109 | 110 | $this->decorator->send($url, $method, $params, $headers); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /ArrayObject.php: -------------------------------------------------------------------------------- 1 | getChildName(); 37 | if (!($value instanceof $arrayType)) { 38 | throw new TypeMismatchException('Passed argument is not an instance of ' . $arrayType); 39 | } else { 40 | parent::append($value); 41 | } 42 | return $this; 43 | } 44 | 45 | /** 46 | * Merge another array of the same type into this array 47 | * 48 | * @param ArrayObject $array 49 | * @throws TypeMismatchException 50 | * @return ArrayObject 51 | */ 52 | public function merge(ArrayObject $array) 53 | { 54 | if (!($array instanceof $this)) { 55 | throw new TypeMismatchException('Passed argument is not an instance of ' . get_class($this)); 56 | } else { 57 | foreach ($array as $object) { 58 | $this->append($object); 59 | } 60 | } 61 | return $this; 62 | } 63 | 64 | /** 65 | * If method does not exists on array, call method on children 66 | * Returns an array with return values 67 | * 68 | * @param string $method 69 | * @param array $arguments 70 | * @throws UndefinedMethodException 71 | * @return Array 72 | */ 73 | public function __call($method, Array $arguments) 74 | { 75 | $arrayType = $this->getChildName(); 76 | if (!method_exists($arrayType, $method)) { 77 | throw new UndefinedMethodException('Fatal error: Call to undefined method ' . $arrayType . '::' . $method . '()'); 78 | } 79 | 80 | $return = array(); 81 | foreach ($this as $object) { 82 | $return[] = call_user_func_array(array($object, $method), $arguments); 83 | } 84 | return $return; 85 | } 86 | 87 | /** 88 | * Get classname of expected children 89 | * 90 | * @access $protected 91 | * @return string 92 | */ 93 | protected function getChildName() 94 | { 95 | if ($this->childname === null) { 96 | $classname = get_class($this); 97 | $pos = max(strrpos($classname, '_Array'), strrpos($classname, '\ArrayObject')); 98 | $this->childname = substr($classname, 0, $pos); 99 | } 100 | return $this->childname; 101 | } 102 | 103 | /** 104 | * Create JSON representation of array 105 | * 106 | * @return string 107 | */ 108 | public function toJson() 109 | { 110 | $array = array(); 111 | foreach ($this->disclose() as $key => $disclosure) { 112 | $values = $disclosure->toArray(); 113 | foreach ($values as &$value) { 114 | $value = utf8_encode($value); 115 | } 116 | $array[$key] = $values; 117 | } 118 | return json_encode($array); 119 | } 120 | 121 | /** 122 | * Create PHP array 123 | * @return Array 124 | */ 125 | public function toArray() 126 | { 127 | $array = array(); 128 | foreach ($this as $value) { 129 | $array[] = $value; 130 | } 131 | return $array; 132 | } 133 | } -------------------------------------------------------------------------------- /Estimate/Service.php: -------------------------------------------------------------------------------- 1 | connector = $connector; 32 | } 33 | 34 | /** 35 | * Get estimates sync status 36 | * @return Estimate_Array 37 | */ 38 | public function getSyncList() 39 | { 40 | return $this->connector->getSyncList(__NAMESPACE__); 41 | } 42 | 43 | /** 44 | * Get estimate by id 45 | * @param int $id 46 | * @return Estimate 47 | */ 48 | public function getById($id) 49 | { 50 | return $this->connector->getById(__NAMESPACE__, $id); 51 | } 52 | 53 | /** 54 | * Get estimates by id (max 100) 55 | * @param Array $ids 56 | * @return Estimate_Array 57 | */ 58 | public function getByIds(Array $ids) 59 | { 60 | return $this->connector->getByIds(__NAMESPACE__, $ids); 61 | } 62 | 63 | /** 64 | * Get all estimates 65 | * 66 | * @param string|integer $filter Filter name or id (advanced filters) 67 | * @param Subject $parent 68 | * @return ArrayObject 69 | * @throws InvalidFilterException 70 | */ 71 | public function getAll($filter = null, Subject $parent = null) 72 | { 73 | return $this->connector->getAll(__NAMESPACE__, $filter, $parent); 74 | } 75 | 76 | /** 77 | * Updates or inserts an estimate 78 | * @param Estimate $estimate 79 | * @return Estimate 80 | */ 81 | public function save(Estimate $estimate) 82 | { 83 | return $this->connector->save($estimate); 84 | } 85 | 86 | /** 87 | * Deletes an estimate 88 | * @param Estimate $estimate 89 | * @return self 90 | */ 91 | public function delete(Estimate $estimate) 92 | { 93 | $this->connector->delete($estimate); 94 | return $this; 95 | } 96 | 97 | /** 98 | * Send the estimate. Returns the updated estimate 99 | * @param Estimate $estimate 100 | * @param string $method Send method (email|hand|post); default: email 101 | * @param type $email Address to send to; default: contact e-mail 102 | * @param type $message 103 | * @return Estimate 104 | */ 105 | public function send(Estimate $estimate, $method = 'email', $email = null, $message = null) 106 | { 107 | return $this->connector->send($estimate, $this->buildEnvelope($method, $email, $message)); 108 | } 109 | 110 | /** 111 | * Build an envelope to send the estimate or reminder with 112 | * @param string $method Send method (email|hand|post); default: email 113 | * @param type $email Address to send to; default: contact e-mail 114 | * @param type $message 115 | * @return Envelope 116 | * @access protected 117 | */ 118 | protected function buildEnvelope($method = 'email', $email = null, $message = null) 119 | { 120 | return new Envelope( 121 | array( 122 | 'sendMethod' => $method, 123 | 'email' => $email, 124 | 'estimateEmail' => $message, 125 | ) 126 | ); 127 | } 128 | 129 | /** 130 | * Get the raw PDF content 131 | * @param Estimate $estimate 132 | * @return string 133 | */ 134 | public function getPdf(Estimate $estimate) 135 | { 136 | return $this->connector->getPdf($estimate); 137 | } 138 | } -------------------------------------------------------------------------------- /docs/js/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Cookie plugin 3 | * 4 | * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 5 | * Dual licensed under the MIT and GPL licenses: 6 | * http://www.opensource.org/licenses/mit-license.php 7 | * http://www.gnu.org/licenses/gpl.html 8 | * 9 | */ 10 | 11 | /** 12 | * Create a cookie with the given name and value and other optional parameters. 13 | * 14 | * @example $.cookie('the_cookie', 'the_value'); 15 | * @desc Set the value of a cookie. 16 | * @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true}); 17 | * @desc Create a cookie with all available options. 18 | * @example $.cookie('the_cookie', 'the_value'); 19 | * @desc Create a session cookie. 20 | * @example $.cookie('the_cookie', null); 21 | * @desc Delete a cookie by passing null as value. 22 | * 23 | * @param String name The name of the cookie. 24 | * @param String value The value of the cookie. 25 | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 26 | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 27 | * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 28 | * If set to null or omitted, the cookie will be a session cookie and will not be retained 29 | * when the the browser exits. 30 | * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 31 | * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 32 | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 33 | * require a secure protocol (like HTTPS). 34 | * @type undefined 35 | * 36 | * @name $.cookie 37 | * @cat Plugins/Cookie 38 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 39 | */ 40 | 41 | /** 42 | * Get the value of a cookie with the given name. 43 | * 44 | * @example $.cookie('the_cookie'); 45 | * @desc Get the value of a cookie. 46 | * 47 | * @param String name The name of the cookie. 48 | * @return The value of the cookie. 49 | * @type String 50 | * 51 | * @name $.cookie 52 | * @cat Plugins/Cookie 53 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 54 | */ 55 | jQuery.cookie = function(name, value, options) 56 | { 57 | if (typeof value != 'undefined') 58 | { // name and value given, set cookie 59 | options = options || {}; 60 | if (value === null) 61 | { 62 | value = ''; 63 | options.expires = -1; 64 | } 65 | var expires = ''; 66 | if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) 67 | { 68 | var date; 69 | if (typeof options.expires == 'number') 70 | { 71 | date = new Date(); 72 | date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 73 | } 74 | else 75 | { 76 | date = options.expires; 77 | } 78 | expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 79 | } 80 | var path = options.path ? '; path=' + options.path : ''; 81 | var domain = options.domain ? '; domain=' + options.domain : ''; 82 | var secure = options.secure ? '; secure' : ''; 83 | document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 84 | } 85 | else 86 | { // only name given, get cookie 87 | var cookieValue = null; 88 | if (document.cookie && document.cookie != '') 89 | { 90 | var cookies = document.cookie.split(';'); 91 | for (var i = 0; i < cookies.length; i++) 92 | { 93 | var cookie = jQuery.trim(cookies[i]); 94 | // Does this cookie string begin with the name we want? 95 | if (cookie.substring(0, name.length + 1) == (name + '=')) 96 | { 97 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 98 | break; 99 | } 100 | } 101 | } 102 | return cookieValue; 103 | } 104 | }; -------------------------------------------------------------------------------- /tests/ApiConnectorTest.php: -------------------------------------------------------------------------------- 1 | fail('Class Moneybird\Contact\ArrayObject already loaded'); 41 | } 42 | ApiConnector::autoload('Moneybird\Contact\ArrayObject'); 43 | if (!class_exists('Moneybird\Contact\ArrayObject', false)) { 44 | $this->fail('Class Moneybird\Contact\ArrayObject failed to load'); 45 | } 46 | } 47 | 48 | /** 49 | * @covers Moneybird\ApiConnector::autoload 50 | */ 51 | public function testAutoloadNotExistingClass() { 52 | include ('./config.php'); 53 | ApiConnector::autoload('NotExistingClass'); 54 | ApiConnector::autoload('Moneybird\NotExistingClass'); 55 | } 56 | 57 | /** 58 | * @covers Moneybird\ApiConnector::getCurrentSession 59 | */ 60 | public function testConfig() { 61 | include ('./config.php'); 62 | $transport = getTransport($config); 63 | 64 | $mapper = new XmlMapper(); 65 | $this->setExpectedException('Moneybird\InvalidConfigException'); 66 | $this->object = new ApiConnector('invalid.client.name', $transport, $mapper); 67 | } 68 | 69 | /** 70 | * @covers Moneybird\ApiConnector::getCurrentSession 71 | */ 72 | public function testGetCurrentSession() { 73 | include ('./config.php'); 74 | $transport = getTransport($config); 75 | 76 | $mapper = new XmlMapper(); 77 | $this->object = new ApiConnector($config['clientname'], $transport, $mapper); 78 | 79 | $this->assertInstanceOf('Moneybird\CurrentSession', $this->object->getCurrentSession()); 80 | } 81 | 82 | /** 83 | * @covers Moneybird\ApiConnector::requestsLeft 84 | */ 85 | public function testRequestsLeft() { 86 | include ('./config.php'); 87 | $transport = getTransport($config); 88 | $mapper = new XmlMapper(); 89 | try { 90 | $this->object = new ApiConnector($config['clientname'], $transport, $mapper); 91 | $this->assertGreaterThan(0, $this->object->requestsLeft()); 92 | } catch (ForBiddenException $e) { 93 | } 94 | } 95 | 96 | /** 97 | * @covers Moneybird\ApiConnector::save 98 | * 99 | public function testSave() { 100 | // Remove the following lines when you implement this test. 101 | $this->markTestIncomplete( 102 | 'This test has not been implemented yet.' 103 | ); 104 | } 105 | 106 | /** 107 | * @covers Moneybird\ApiConnector::save 108 | * 109 | public function testSaveErrors() { 110 | // Remove the following lines when you implement this test. 111 | $this->markTestIncomplete( 112 | 'This test has not been implemented yet.' 113 | ); 114 | } 115 | 116 | /** 117 | * @covers Moneybird\ApiConnector::delete 118 | * 119 | public function testDelete() { 120 | // Remove the following lines when you implement this test. 121 | $this->markTestIncomplete( 122 | 'This test has not been implemented yet.' 123 | ); 124 | } 125 | 126 | /** 127 | * @covers Moneybird\ApiConnector::getPdf 128 | * 129 | public function testGetPdf() { 130 | // Remove the following lines when you implement this test. 131 | $this->markTestIncomplete( 132 | 'This test has not been implemented yet.' 133 | ); 134 | } 135 | 136 | /** 137 | * @covers Moneybird\ApiConnector::getErrorMessages 138 | * 139 | public function testGetErrorMessages() { 140 | // Remove the following lines when you implement this test. 141 | $this->markTestIncomplete( 142 | 'This test has not been implemented yet.' 143 | ); 144 | } 145 | /**/ 146 | } 147 | 148 | ?> 149 | -------------------------------------------------------------------------------- /docs/deprecated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 62 |
No deprecated elements have been 63 | found in this project. 64 |
65 |
66 |
67 |
68 |
72 |
73 | 74 | 75 | -------------------------------------------------------------------------------- /docs/graph_class.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /docs/markers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
58 |
59 | 65 |
66 | The following markers were found: 67 |
  • todo  68 | 1 69 |
70 |
71 |
72 |

73 | Invoice/History.php1 74 |

75 |
76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 |
TypeLineDescription
todo38throw more specific exception on invalid parent
87 |
88 |
89 |
90 |
94 |
95 | 96 | 97 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |

phpDocumentor

55 |

Documentation

56 |
57 |
58 |
59 |
64 |
68 |
69 | 87 |
88 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/classes/Moneybird.SyncObject.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » \Moneybird\SyncObject 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 59 |
60 |
61 | 70 |
71 |

SyncObject

72 |

73 |
74 |
75 |
76 |
80 |
81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/classes/Moneybird.SyncArray.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » \Moneybird\SyncArray 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 59 |
60 |
61 | 70 |
71 |

Sync array for syncing objects

72 |

73 |
74 |
75 |
76 |
80 |
81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Error 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 74 |
75 |

76 | Classes and interfaces

77 |
78 |

ArrayObject 79 |

80 |

Error array

81 |
82 | « More » 83 |
84 |
85 |
86 |
87 |
91 |
92 | 93 | 94 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Detail 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 74 |
75 |

76 | Classes and interfaces

77 |
78 |

AbstractDetail 79 |

80 |

DetailAbstract

81 |
82 | « More » 83 |
84 |
85 |
86 |
87 |
91 |
92 | 93 | 94 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Contact.Sync.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Contact\Sync 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 75 |
76 |

77 | Classes and interfaces

78 |
79 |

ArrayObject 80 |

81 |

Contact array

82 |
83 | « More » 84 |
85 |
86 |
87 |
88 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Invoice.Sync.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Invoice\Sync 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 75 |
76 |

77 | Classes and interfaces

78 |
79 |

ArrayObject 80 |

81 |

Invoice sync array

82 |
83 | « More » 84 |
85 |
86 |
87 |
88 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Invoice.Detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Invoice\Detail 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 75 |
76 |

77 | Classes and interfaces

78 |
79 |

ArrayObject 80 |

81 |

Invoice_Detail array

82 |
83 | « More » 84 |
85 |
86 |
87 |
88 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Estimate.Detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Estimate\Detail 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 75 |
76 |

77 | Classes and interfaces

78 |
79 |

ArrayObject 80 |

81 |

Estimate_Detail array

82 |
83 | « More » 84 |
85 |
86 |
87 |
88 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Invoice.History.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Invoice\History 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 75 |
76 |

77 | Classes and interfaces

78 |
79 |

ArrayObject 80 |

81 |

Invoice_History array

82 |
83 | « More » 84 |
85 |
86 |
87 |
88 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Invoice.Payment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Invoice\Payment 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 75 |
76 |

77 | Classes and interfaces

78 |
79 |

ArrayObject 80 |

81 |

Invoice_Payment array

82 |
83 | « More » 84 |
85 |
86 |
87 |
88 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.Estimate.History.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\Estimate\History 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 75 |
76 |

77 | Classes and interfaces

78 |
79 |

ArrayObject 80 |

81 |

Estimate_History array

82 |
83 | « More » 84 |
85 |
86 |
87 |
88 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/namespaces/Moneybird.IncomingInvoice.Sync.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor » Moneybird\IncomingInvoice\Sync 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 48 |
49 | 53 |
54 |
55 |
56 | 57 |
58 | 65 |
66 |
67 | 75 |
76 |

77 | Classes and interfaces

78 |
79 |

ArrayObject 80 |

81 |

IncomingInvoice sync array

82 |
83 | « More » 84 |
85 |
86 |
87 |
88 |
92 |
93 | 94 | 95 | --------------------------------------------------------------------------------