diff --git a/.gitignore b/.gitignore index 57872d0..20480b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /vendor/ +/exemple-dev \ No newline at end of file diff --git a/composer.json b/composer.json index f0ca589..72a3cd8 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,7 @@ ], "require": { "php": "^7.2.5", - "guzzlehttp/guzzle": "^6.3", - "notafacil-io/php-client-notafacil": "^1.0" + "notafacil-io/php-common-notafacil": "^1.0" }, "require-dev": { @@ -33,7 +32,7 @@ }, "autoload": { "psr-4": { - "NotaFacil\\Nfse\\":"src/Nfse" + "NotaFacil\\Nfse\\":"src/NotaFacil" } }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index e94d0e2..705e295 100644 --- a/composer.lock +++ b/composer.lock @@ -4,225 +4,23 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "76504258e12bbdb20fe965052432c675", + "content-hash": "e50be04d95eb3f8bf8fc687abc228ad3", "packages": [ { - "name": "guzzlehttp/guzzle", - "version": "6.5.5", + "name": "notafacil-io/php-common-notafacil", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + "url": "https://github.com/notafacil-io/php-common-notafacil.git", + "reference": "d785260a01525dc43fe8b13811535c265888a2fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", - "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "url": "https://api.github.com/repos/notafacil-io/php-common-notafacil/zipball/d785260a01525dc43fe8b13811535c265888a2fb", + "reference": "d785260a01525dc43fe8b13811535c265888a2fb", "shasum": "" }, "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5" - }, - "time": "2020-06-16T21:01:06+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", - "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.1" - }, - "time": "2021-03-07T09:25:29+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.8.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.2" - }, - "time": "2021-04-26T09:17:50+00:00" - }, - { - "name": "notafacil-io/php-client-notafacil", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/notafacil-io/php-client-notafacil.git", - "reference": "6b1a462636dd8c2c4393733e9e14e9a90c90999c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/notafacil-io/php-client-notafacil/zipball/6b1a462636dd8c2c4393733e9e14e9a90c90999c", - "reference": "6b1a462636dd8c2c4393733e9e14e9a90c90999c", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.3", "php": "^7.2.5" }, "require-dev": { @@ -237,110 +35,10 @@ }, "autoload": { "psr-4": { - "NotaFacil\\Client\\": "src/NotaFacil" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Equipe Nota Fácil", - "email": "suporte@notafacil.io", - "role": "Owner" + "NotaFacil\\Common\\": "src/NotaFacil" }, - { - "name": "Claudio Alexssandro Lino", - "email": "codigosecafe@gmail.com", - "role": "Developer" - } - ], - "description": "Pacote de integração Nota Fácil | PHP Client Nota Fácil", - "support": { - "issues": "https://github.com/notafacil-io/php-client-notafacil/issues", - "source": "https://github.com/notafacil-io/php-client-notafacil/tree/1.0.0" - }, - "time": "2021-05-13T07:47:56+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { "files": [ - "src/getallheaders.php" + "src/NotaFacil/helper/helperNotafacil.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -349,263 +47,41 @@ ], "authors": [ { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-22T09:19:47+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" + "name": "Equipe Nota Fácil", + "email": "suporte@notafacil.io", + "homepage": "https://notafacil.io", + "role": "Owner" }, { - "url": "https://github.com/fabpot", - "type": "github" + "name": "Mauricio Lang", + "email": "mauricioandrey.lang@gmail.com", + "homepage": "https://www.gestaoetech.com.br", + "role": "Head de tecnologia e desenvolvimento" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-22T09:19:47+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" + "name": "Claudio Alexssandro Lino", + "email": "claudio.lino.dev@gmail.com", + "homepage": "https://claudiodev.com.br", + "role": "Developer" }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Matheus Falconde", + "email": "matheus_felipe25@live.com", + "role": "Developer" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Lucas Galvão Nunes", + "email": "contato@lucasgnunes.dev", + "homepage": "https://lucasgnunes.dev", + "role": "Developer" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], + "description": "Pacote de integração Nota Fácil | PHP Common Nota Fácil", "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" + "issues": "https://github.com/notafacil-io/php-common-notafacil/issues", + "source": "https://github.com/notafacil-io/php-common-notafacil/tree/1.0.3" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-07-12T11:57:37+00:00" } ], "packages-dev": [ @@ -1371,16 +847,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.15", + "version": "8.5.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "038d4196d8e8cb405cd5e82cedfe413ad6eef9ef" + "reference": "79067856d85421c56d413bd238d4e2cd6b0e54da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/038d4196d8e8cb405cd5e82cedfe413ad6eef9ef", - "reference": "038d4196d8e8cb405cd5e82cedfe413ad6eef9ef", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/79067856d85421c56d413bd238d4e2cd6b0e54da", + "reference": "79067856d85421c56d413bd238d4e2cd6b0e54da", "shasum": "" }, "require": { @@ -1452,7 +928,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.15" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.17" }, "funding": [ { @@ -1464,7 +940,7 @@ "type": "github" } ], - "time": "2021-03-17T07:27:54+00:00" + "time": "2021-06-23T05:12:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2197,16 +1673,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -2218,7 +1694,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2256,7 +1732,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -2272,20 +1748,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", "shasum": "" }, "require": { @@ -2297,7 +1773,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2336,7 +1812,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" }, "funding": [ { @@ -2352,20 +1828,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", "shasum": "" }, "require": { @@ -2374,7 +1850,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2419,7 +1895,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" }, "funding": [ { @@ -2435,20 +1911,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.2.8", + "version": "v5.3.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba" + "reference": "46aa709affb9ad3355bd7a810f9662d71025c384" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d693200a73fae179d27f8f1b16b4faf3e8569eba", - "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/46aa709affb9ad3355bd7a810f9662d71025c384", + "reference": "46aa709affb9ad3355bd7a810f9662d71025c384", "shasum": "" }, "require": { @@ -2507,7 +1983,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.2.8" + "source": "https://github.com/symfony/var-dumper/tree/v5.3.3" }, "funding": [ { @@ -2523,7 +1999,7 @@ "type": "tidelift" } ], - "time": "2021-05-07T13:42:21+00:00" + "time": "2021-06-24T08:13:00+00:00" }, { "name": "theseer/tokenizer", @@ -2643,5 +2119,5 @@ "php": "^7.2.5" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/exemple/Customers/01-CreateCustomers.php b/exemple/Customers/01-CreateCustomers.php new file mode 100644 index 0000000..adc3df9 --- /dev/null +++ b/exemple/Customers/01-CreateCustomers.php @@ -0,0 +1,56 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "nome_razao_social" => "CIAVET COMERCIAL IMP.AGRO.VETERINARIA LTDA", + "nome_fantasia" => "CIAVET COMERCIAL IMP.AGRO.VETERINARIA LTDA", + "tipo_cliente" => "PJ", + "cnpj_cpf" => "92.813.815/0001-08", + "tipo_cadastro" => "Cliente", + "rg" => "", + "rg_data_emissao" => "", + "rg_orgao_expedidor" => "", + "passaporte" => "", + "estrangeiro" => false, + "email" => "emailTeste@emailtest.com.br", + "nome_contato" => "", + "email_contato" => "emailTeste@emailtest.com.br", + "insc_estadual" => "", + "insc_municipal" => "", + "insc_produtor" => "", + "observacoes" => "", + "status" => 1, + "endereco_principal" => [ + "logradouro" => "RUA GAL.ARRUDA", + "bairro" => "CENTRO", + "numero" => "281", + "complemento" => "", + "cep" => "97.543-530", + "id_cidade" => 4610 + ], + "telefone_principal" => [ + "ddd" => "55", + "numero" => "999493888", + "tipo_telefone" => 2 + ] + ]; + + + + $services = (new CustomersNotaFacil($credentialsToken))->addCustomer($payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/02-UpdateCustomers.php b/exemple/Customers/02-UpdateCustomers.php new file mode 100644 index 0000000..f61461e --- /dev/null +++ b/exemple/Customers/02-UpdateCustomers.php @@ -0,0 +1,56 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "nome_razao_social" => "CIAVET COMERCIAL IMP.AGRO.VETERINARIA LTDA", + "nome_fantasia" => "CIAVET COMERCIAL IMP.AGRO.VETERINARIA LTDA", + "tipo_cliente" => "PJ", + "cnpj_cpf" => "92.813.815/0001-08", + "tipo_cadastro" => "Cliente", + "rg" => "", + "rg_data_emissao" => "", + "rg_orgao_expedidor" => "", + "passaporte" => "", + "estrangeiro" => false, + "email" => "emailTeste@emailtest.com.br", + "nome_contato" => "", + "email_contato" => "emailTeste@emailtest.com.br", + "insc_estadual" => "", + "insc_municipal" => "", + "insc_produtor" => "", + "observacoes" => "", + "status" => 1, + "endereco_principal" => [ + "logradouro" => "RUA GAL.ARRUDA", + "bairro" => "CENTRO", + "numero" => "281", + "complemento" => "", + "cep" => "97.543-530", + "id_cidade" => 4610 + ], + "telefone_principal" => [ + "ddd" => "55", + "numero" => "999493888", + "tipo_telefone" => 2 + ] + ]; + + + + $services = (new CustomersNotaFacil($credentialsToken))->updateCustomer(137, $payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/03-GetCustomersByID.php b/exemple/Customers/03-GetCustomersByID.php new file mode 100644 index 0000000..d34a446 --- /dev/null +++ b/exemple/Customers/03-GetCustomersByID.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->showByID(137); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/04-ListaAllCustomers.php b/exemple/Customers/04-ListaAllCustomers.php new file mode 100644 index 0000000..cc483ea --- /dev/null +++ b/exemple/Customers/04-ListaAllCustomers.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->listAll(); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/05-DeleteCustomersByID.php b/exemple/Customers/05-DeleteCustomersByID.php new file mode 100644 index 0000000..60034e2 --- /dev/null +++ b/exemple/Customers/05-DeleteCustomersByID.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->deleteCustomer(137); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/06-AddAdditionalAddressCustomersByID.php b/exemple/Customers/06-AddAdditionalAddressCustomersByID.php new file mode 100644 index 0000000..d4e56a5 --- /dev/null +++ b/exemple/Customers/06-AddAdditionalAddressCustomersByID.php @@ -0,0 +1,29 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "id_cidade" => 1, + "logradouro" => "Rua São Sebastião", + "bairro" => "Roseira", + "numero" => "103", + "complemento" => "Fundos", + "cep" => "83.070-240" + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->addMoreAddressCustomer(138,$payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/07-UpdateAdditionalAddressCustomersByID.php b/exemple/Customers/07-UpdateAdditionalAddressCustomersByID.php new file mode 100644 index 0000000..0e032cf --- /dev/null +++ b/exemple/Customers/07-UpdateAdditionalAddressCustomersByID.php @@ -0,0 +1,29 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "id_cidade" => 1, + "logradouro" => "Rua São Sebastião", + "bairro" => "Roseira", + "numero" => "103", + "complemento" => "Fundos", + "cep" => "83.070-240" + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->updateAddlAddress(138, 347, $payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/08-DeleteAdditionalAddressCustomersByID.php b/exemple/Customers/08-DeleteAdditionalAddressCustomersByID.php new file mode 100644 index 0000000..053fd25 --- /dev/null +++ b/exemple/Customers/08-DeleteAdditionalAddressCustomersByID.php @@ -0,0 +1,29 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "id_cidade" => 1, + "logradouro" => "Rua São Sebastião", + "bairro" => "Roseira", + "numero" => "103", + "complemento" => "Fundos", + "cep" => "83.070-240" + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->deleteAddlAddress(138, 346); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/09-ListAllAdditionalAddressCustomersByID.php b/exemple/Customers/09-ListAllAdditionalAddressCustomersByID.php new file mode 100644 index 0000000..161ca16 --- /dev/null +++ b/exemple/Customers/09-ListAllAdditionalAddressCustomersByID.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->listAllAddlAddress(138); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/10-GetAdditionalAddressCustomersByID.php b/exemple/Customers/10-GetAdditionalAddressCustomersByID.php new file mode 100644 index 0000000..b776641 --- /dev/null +++ b/exemple/Customers/10-GetAdditionalAddressCustomersByID.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->getAddlAddressByID(138, 347); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/11-AddAdditionalPhoneCustomersByID.php b/exemple/Customers/11-AddAdditionalPhoneCustomersByID.php new file mode 100644 index 0000000..2aa082b --- /dev/null +++ b/exemple/Customers/11-AddAdditionalPhoneCustomersByID.php @@ -0,0 +1,27 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "ddd" => "41", + "numero" => "4196105002", + "ramal" => "1", + "tipo_telefone" => 2 + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->addAddlPhone(138,$payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/12-UpdateAdditionalPhoneCustomersByID.php b/exemple/Customers/12-UpdateAdditionalPhoneCustomersByID.php new file mode 100644 index 0000000..f3a019e --- /dev/null +++ b/exemple/Customers/12-UpdateAdditionalPhoneCustomersByID.php @@ -0,0 +1,27 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "ddd" => "41", + "numero" => "4196105003", + "ramal" => "1", + "tipo_telefone" => 2 + ]; + + $services = (new CustomersNotaFacil($credentialsToken))->updateAddlPhone(138,285,$payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/13-ListAllAdditionalPhoneCustomersByID.php b/exemple/Customers/13-ListAllAdditionalPhoneCustomersByID.php new file mode 100644 index 0000000..f9fd877 --- /dev/null +++ b/exemple/Customers/13-ListAllAdditionalPhoneCustomersByID.php @@ -0,0 +1,22 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + + $services = (new CustomersNotaFacil($credentialsToken))->listAllAddlPhone(138); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/14-GetAdditionalPhoneCustomersByID.php b/exemple/Customers/14-GetAdditionalPhoneCustomersByID.php new file mode 100644 index 0000000..4a9f855 --- /dev/null +++ b/exemple/Customers/14-GetAdditionalPhoneCustomersByID.php @@ -0,0 +1,22 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + + $services = (new CustomersNotaFacil($credentialsToken))->getAddlPhoneByID(138, 285); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/Customers/15-DeleteAdditionalPhoneCustomersByID.php b/exemple/Customers/15-DeleteAdditionalPhoneCustomersByID.php new file mode 100644 index 0000000..de87d94 --- /dev/null +++ b/exemple/Customers/15-DeleteAdditionalPhoneCustomersByID.php @@ -0,0 +1,21 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + $services = (new CustomersNotaFacil($credentialsToken))->deleteAddlPhone(138, 285); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/authentication/SimpleLogin.php b/exemple/authentication/SimpleLogin.php new file mode 100644 index 0000000..0eaafdc --- /dev/null +++ b/exemple/authentication/SimpleLogin.php @@ -0,0 +1,25 @@ + "LOGIN_SOFTHOUSE", + "password" => "SENHA_SOFTHOUSE", + "secret_key" => "SECRET_KEY_SOFTHOUSE" + ]; + + $clientNotaFacil =(new AuthNotaFacil())->attempt($credentials) + // ->getResponse(); + ->getDataAuth(); + + dump($clientNotaFacil); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/certificate/01-AddCertificate.php b/exemple/certificate/01-AddCertificate.php new file mode 100644 index 0000000..1dcb818 --- /dev/null +++ b/exemple/certificate/01-AddCertificate.php @@ -0,0 +1,26 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "certificado_base64" => "", + "certificado_senha" => "", + "certificado_tipo" => "" + ]; + + $certificateData = (new CertificateNotaFacil($credentialsToken))->addCertificate($payload); + + dump($certificateData->getContent(), $certificateData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/certificate/02-ListAllCertificate.php b/exemple/certificate/02-ListAllCertificate.php new file mode 100644 index 0000000..8da70dc --- /dev/null +++ b/exemple/certificate/02-ListAllCertificate.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $certificateData = (new CertificateNotaFacil($credentialsToken))->listAll(); + + dump($certificateData->getContent(), $certificateData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/certificate/03-ShowCertificateByID.php b/exemple/certificate/03-ShowCertificateByID.php new file mode 100644 index 0000000..d2c7293 --- /dev/null +++ b/exemple/certificate/03-ShowCertificateByID.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $certificateData = (new CertificateNotaFacil($credentialsToken))->showByID($idCertificate); + + dump($certificateData->getContent(), $certificateData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/certificate/04-DeleteCertificateByID.php b/exemple/certificate/04-DeleteCertificateByID.php new file mode 100644 index 0000000..c975e66 --- /dev/null +++ b/exemple/certificate/04-DeleteCertificateByID.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $certificateData = (new CertificateNotaFacil($credentialsToken))->deleteCertificate($idCertificate); + + dump($certificateData->getContent(), $certificateData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/cities/01-ListAllCities.php b/exemple/cities/01-ListAllCities.php new file mode 100644 index 0000000..7460f45 --- /dev/null +++ b/exemple/cities/01-ListAllCities.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $companiesData = (new CitiesNotaFacil($credentialsToken))->listCities(); + + dump($companiesData->getContent(), $companiesData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/cities/02-FindCityByName.php b/exemple/cities/02-FindCityByName.php new file mode 100644 index 0000000..821497d --- /dev/null +++ b/exemple/cities/02-FindCityByName.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $citiesData = (new CitiesNotaFacil($credentialsToken))->findCityByName( 'São José dos pinhais' ); + + dump($citiesData->getContent(), $citiesData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/cities/03-ListAllCitiesApproved.php b/exemple/cities/03-ListAllCitiesApproved.php new file mode 100644 index 0000000..8ca4b19 --- /dev/null +++ b/exemple/cities/03-ListAllCitiesApproved.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $companiesData = (new CitiesNotaFacil($credentialsToken))->citiesApproved(); + + dump($companiesData->getContent(), $companiesData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/cities/04-FindCitiesApprovedByIBGE.php b/exemple/cities/04-FindCitiesApprovedByIBGE.php new file mode 100644 index 0000000..d61d949 --- /dev/null +++ b/exemple/cities/04-FindCitiesApprovedByIBGE.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $companiesData = (new CitiesNotaFacil($credentialsToken))->findApprovedByIBGE(3304557); + + dump($companiesData->getContent(), $companiesData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/company/01-SearchLoggedUserCompany.php b/exemple/company/01-SearchLoggedUserCompany.php new file mode 100644 index 0000000..51dcea4 --- /dev/null +++ b/exemple/company/01-SearchLoggedUserCompany.php @@ -0,0 +1,23 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + $companyData = (new CompanyNotaFacil($credentialsToken))->loggedData(); + + dump($companyData->getContent(), $companyData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/company/02-ListAllCompanies.php b/exemple/company/02-ListAllCompanies.php new file mode 100644 index 0000000..a170798 --- /dev/null +++ b/exemple/company/02-ListAllCompanies.php @@ -0,0 +1,21 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + $companiesData = (new CompanyNotaFacil($credentialsToken))->listAll(); + + dump($companiesData->getContent(), $companiesData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/company/03-ShowCompanyByID.php b/exemple/company/03-ShowCompanyByID.php new file mode 100644 index 0000000..bce162d --- /dev/null +++ b/exemple/company/03-ShowCompanyByID.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $companyData = (new CompanyNotaFacil($credentialsToken))->showByID(2); + + dump($companyData->getContent(), $companyData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/company/04-AddCompany.php b/exemple/company/04-AddCompany.php new file mode 100644 index 0000000..c293671 --- /dev/null +++ b/exemple/company/04-AddCompany.php @@ -0,0 +1,53 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "nome_razao_social" => "Francisca e Jaqueline Pães e Doces Ltda", + "nome_fantasia" =>"Francisca e Jaqueline Pães e Doces Ltda", + "tipo_conta" => "PJ", + "cnpj_cpf" => "91.413.019/0001-15", + "insc_estadual" => "213.49752-99", + "insc_municipal" => "456.49752-99", + "cnae_primario" => "159", + "email" => "sistema@franciscaejaquelinepaesedocesltda.com.br", + "responsavel" => "Romilde Rolim de Moura", + "endereco_principal" => [ + "logradouro" => "R SETE DE SETEMBRO", + "bairro" => "CENTRO", + "numero" => "378", + "cep" => "89843000", + "id_cidade" => 4317 + ], + "telefone_principal" => [ + "ddd" => "49", + "numero" => "89733609", + "tipo_telefone" => 1 + ], + "nfs_config" => [ + "natureza_operacao" => 1, + "regime_tributacao" => "3", + "regime_especial_tributacao" => "0", + "usuario_prefeitura" => "94911200987", + "senha_prefeitura" => "RRmilxe942", + "receber_notificacao" => true, + "email_notificacao" => "sistema@franciscaejaquelinepaesedocesltda.com.br" + ] + ]; + + $companyData = (new CompanyNotaFacil($credentialsToken))->addCompany($payload); + + dump($companyData->getContent(), $companyData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/company/05-UpdateCompany.php b/exemple/company/05-UpdateCompany.php new file mode 100644 index 0000000..cff137b --- /dev/null +++ b/exemple/company/05-UpdateCompany.php @@ -0,0 +1,55 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "nome_razao_social" => "Francisca e Jaqueline Pães e Doces Ltda", + "nome_fantasia" =>"Francisca e Jaqueline Pães e Doces Ltda", + "tipo_conta" => "PJ", + "cnpj_cpf" => "91.413.019/0001-15", + "insc_estadual" => "213.49752-99", + "insc_municipal" => "456.49752-99", + "cnae_primario" => "159", + "email" => "sistema@franciscaejaquelinepaesedocesltda.com.br", + "responsavel" => "Romilde Rolim de Moura", + "responsavel_telefone" => "1255555555", + "host" => "www.franciscaejaquelinepaesedocesltda.com.br", + "endereco_principal" => [ + "logradouro" => "R SETE DE SETEMBRO", + "bairro" => "CENTRO", + "numero" => "378", + "cep" => "89843000", + "id_cidade" => 4317 + ], + "telefone_principal" => [ + "ddd" => "41", + "numero" => "2748-9025", + "tipo_telefone" => 2 + ], + "nfs_config" => [ + "natureza_operacao" => 1, + "regime_tributacao" => true, + "regime_especial_tributacao" => 1, + "usuario_prefeitura" => "visualhost", + "senha_prefeitura" => "nfe!@#nfe" + ], + "cnaes" => [ 2 ] + ]; + + $companyData = (new CompanyNotaFacil($credentialsToken))->updateCompany(154,$payload); + + dump($companyData->getContent(), $companyData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/company/06-DeleteCompany.php b/exemple/company/06-DeleteCompany.php new file mode 100644 index 0000000..291f4b4 --- /dev/null +++ b/exemple/company/06-DeleteCompany.php @@ -0,0 +1,22 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + $companyData = (new CompanyNotaFacil($credentialsToken))->deleteCompany(157); + + dump($companyData->getContent(), $companyData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/company/07-ConfigCompany.php b/exemple/company/07-ConfigCompany.php new file mode 100644 index 0000000..b962b57 --- /dev/null +++ b/exemple/company/07-ConfigCompany.php @@ -0,0 +1,30 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + $payload = [ + "natureza_operacao" => 1, + "regime_tributacao" => 1, + "regime_especial_tributacao" => 1, + "usuario_prefeitura" => "visualhost", + "senha_prefeitura" => "nfe!@#nfe" + ]; + + $companyData = (new CompanyNotaFacil($credentialsToken))->configCompany($payload); + + dump($companyData->getContent(), $companyData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/nfse/01-AddNFSe.php b/exemple/nfse/01-AddNFSe.php new file mode 100644 index 0000000..85084c4 --- /dev/null +++ b/exemple/nfse/01-AddNFSe.php @@ -0,0 +1,110 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "cliente" => [ + "endereco_principal" => [ + "id_cidade" => "1", + "logradouro" => "RUA TENENTE DJALMA DUTRA", + "bairro" => "CENTRO", + "numero" => "915", + "complemento" => "ANDAR 7", + "cep" => "83005360" + ], + "telefone_principal" => [ + "ddd" => "65", + "numero" => "32661380", + "tipo_telefone" => "1" + ], + "nome_razao_social" => "Empresa teste", + "nome_fantasia" => "Empresa teste", + "tipo_cliente" => "PJ", + "cnpj_cpf" => "07298848000198", + "tipo_cadastro" => "Ambos", + "email" => "teste@emailtest.com.br", + "status" => 1 + ], + "nfs_total" => [ + "valor_servico" => "1.00", + "base_calculo" => "1.00", + "valor_deducoes" => "0.00", + "valor_incondicional" => "0.00", + "valor_condicional" => "0.00", + "aliquota_tributo_federal" => "0.00", + "valor_tributo_federal" => "0.00", + "aliquota_tributo_municipal" => "0.00", + "valor_tributo_municipal" => "0.00" + ], + "nfs_impostos" => [ + [ + "tipo" => "COFINS", + "reter" => "0", + "aliquota" => "0", + "valor" => "0" + ], + [ + "tipo" => "PIS", + "reter" => "0", + "aliquota" => "0", + "valor" => "0" + ], + [ + "tipo" => "CSLL", + "reter" => "0", + "aliquota" => "0", + "valor" => "0" + ], + [ + "tipo" => "IR", + "reter" => "0", + "aliquota" => "0", + "valor" => "0" + ], + [ + "tipo" => "INSS", + "reter" => "0", + "aliquota" => "0", + "valor" => "0" + ], + [ + "tipo" => "ISS", + "reter" => "0", + "aliquota" => "3.87", + "valor" => "0" + ] + ], + "numeracao_rps" => "100102", + "serie_rps" => "1", + "nome_cliente" => "Empresa SISTEMA DE GESTAO S.A.", + "regime_tributacao" => 1, + "regime_especial_tributacao" => 1, + "natureza_operacao" => 1, + "descricao_servico" => "Nota para fins de testes", + "codigo_atividade" => "1401", + "codigo_cnae" => "4520001", + "descricao_atividade" => "Lubrificacao, limpeza, lustracao, revisao, conserto, restauracao, blindagem, alinhamento, balanceamento, manutencao e conservacao de embarcacoes, aeronaves e veiculos em geral (exceto pecas e partes empregadas, que ficam sujeitas ao ICMS)", + "codigo_tributacao_municipio" => "1401001", + "valor_total_bruto" => "1.00", + "valor_total_liquido" => "1.00", + "ambiente" => true, + "tipo_local_prestacao_servico" => "0" + ]; + + + $services = (new NSFeNotaFacil($credentialsToken))->addNFSe($payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/nfse/02-UpdateNFSe.php b/exemple/nfse/02-UpdateNFSe.php new file mode 100644 index 0000000..0c585f5 --- /dev/null +++ b/exemple/nfse/02-UpdateNFSe.php @@ -0,0 +1,99 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "cliente" => 46355, + "nfs_total" => [ + "valor_servico" => "3392.85", + "base_calculo" => "3392.85", + "valor_deducoes" => "0.00", + "valor_incondicional" => "0.00", + "valor_condicional" => "0.00", + "aliquota_tributo_federal" => "0.00", + "valor_tributo_federal" => "0.00", + "aliquota_tributo_municipal" => "0.00", + "valor_tributo_municipal" => "0.00" + ], + "nfs_construcao_civil" => [ + "codigo_obra" => "COI", + "codigo_art" => "2020200197710", + "valor_material" => "0.00" + ], + "nfs_impostos" => [ + [ + "tipo" => "ISS", + "reter" => "0", + "aliquota" => "2.000000", + "valor" => "67.86" + ], + [ + "tipo" => "COFINS", + "reter" => "0", + "aliquota" => "0.00", + "valor" => "0.00" + ], + [ + "tipo" => "PIS", + "reter" => "0", + "aliquota" => "0.00", + "valor" => "0.00" + ], + [ + "tipo" => "CSLL", + "reter" => "0", + "aliquota" => "0.00", + "valor" => "0.00" + ], + [ + "tipo" => "INSS", + "reter" => "0", + "aliquota" => "0.00", + "valor" => "0.00" + ], + [ + "tipo" => "IR", + "reter" => "0", + "aliquota" => "0.00", + "valor" => "0.00" + ] + ], + "numeracao_rps" => "209", + "serie_rps" => "1", + "nome_cliente" => "AMAURI LOPES NEVES", + "nome_tecnico" => "", + "regime_tributacao" => "1", + "regime_especial_tributacao" => "0", + "natureza_operacao" => "1", + "descricao_servico" => "FORNECIMENTO DE MAO DE OBRA PARA REFORMA DE APARTAMENTO RESIDENCIAL, TOTALIZANDO 75m2; BEM COMO PINTURA; TROCA DE REVESTIMENTO (PISO E PAREDE) INSTALACOS HIDROSSANITARIAS; INSTALACOES DE ITENS EM GERAL.", + "codigo_atividade" => "0705", + "descricao_atividade" => "Reforma de Edificios e Congeneres", + "codigo_tributacao_municipio" => "070513", + "valor_total_bruto" => "3392.85", + "valor_total_liquido" => "3392.85", + "numero_processo_judicial" => "", + "observacao_servico" => "", + "observacao_interna_servico" => "", + "ambiente" => true, + "incentivador_cultural" => false, + "tipo_local_prestacao_servico" => "1", + "id_cidade" => "" + ]; + + + $services = (new NSFeNotaFacil($credentialsToken))->updateNFSe(143503,$payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/nfse/03-IssueNFSe.php b/exemple/nfse/03-IssueNFSe.php new file mode 100644 index 0000000..4dda0cc --- /dev/null +++ b/exemple/nfse/03-IssueNFSe.php @@ -0,0 +1,23 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = ["ids" => [ 143503 ] ]; + + + $services = (new NSFeNotaFacil($credentialsToken))->issueNFSe($payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/nfse/04-CancelIssueNFSe.php b/exemple/nfse/04-CancelIssueNFSe.php new file mode 100644 index 0000000..2e16e58 --- /dev/null +++ b/exemple/nfse/04-CancelIssueNFSe.php @@ -0,0 +1,26 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "ids"=> [ 28976 ], + "motivo_cancelamento"=> "Motivo para fins de testes" + ]; + + + $services = (new NSFeNotaFacil($credentialsToken))->cancelIssue($payload); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/services-cnae/01-SearchServices.php b/exemple/services-cnae/01-SearchServices.php new file mode 100644 index 0000000..6be92ce --- /dev/null +++ b/exemple/services-cnae/01-SearchServices.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $services = (new ServicesAndCnaeNotaFacil($credentialsToken))->searchServices('cão'); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/services-cnae/02-ListCnae.php b/exemple/services-cnae/02-ListCnae.php new file mode 100644 index 0000000..1e05dce --- /dev/null +++ b/exemple/services-cnae/02-ListCnae.php @@ -0,0 +1,21 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + $services = (new ServicesAndCnaeNotaFacil($credentialsToken))->listCnae(); + + dump($services->getContent(), $services->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/users/01-LoggedUser.php b/exemple/users/01-LoggedUser.php new file mode 100644 index 0000000..1ce6a4c --- /dev/null +++ b/exemple/users/01-LoggedUser.php @@ -0,0 +1,22 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $userData = (new UserNotaFacil($credentialsToken))->loggedData(); + + dump($userData->getContent(), $userData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/users/01.1-UserLoggedInWithAuthentication.php b/exemple/users/01.1-UserLoggedInWithAuthentication.php new file mode 100644 index 0000000..760e4e4 --- /dev/null +++ b/exemple/users/01.1-UserLoggedInWithAuthentication.php @@ -0,0 +1,27 @@ + "LOGIN_SOFTHOUSE", + "password" => "SENHA_SOFTHOUSE", + "secret_key" => "SECRET_KEY_SOFTHOUSE" + ]; + + $clientNotaFacil = new AuthNotaFacil(); + $clientNotaFacil->setConsumerID('CONSUMER_ID'); + + $credentialsToken = $clientNotaFacil->attempt($credentials)->getDataAuth(); + + $userData = (new UserNotaFacil($credentialsToken))->loggedData(); + + dump($userData->getContent(), $userData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/users/02-ListAllUsers.php b/exemple/users/02-ListAllUsers.php new file mode 100644 index 0000000..64c91e0 --- /dev/null +++ b/exemple/users/02-ListAllUsers.php @@ -0,0 +1,19 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + $userData = (new UserNotaFacil($credentialsToken))->listAll(); + + dump($userData->getContent(), $userData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/users/03-CreateUser.php b/exemple/users/03-CreateUser.php new file mode 100644 index 0000000..739bc5c --- /dev/null +++ b/exemple/users/03-CreateUser.php @@ -0,0 +1,40 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + + $payload = [ + "nome" => "Otávio Calebe Lucas Assunção", + "cpf" => "551.334.528-53", + "email" => "bunitinho3@tuamaeaquelaursa.com", + "login" => "bunitinho03", + "password" => "#S12341m", + "skype" => "bunitinho03", + "status" => true, + "telefone" => [ + "ddd" => "41", + "numero" => "995079453", + "ramal" => "1", + "tipo_telefone" => 1 + ], + "role" => 1 + ]; + + + + $userData = (new UserNotaFacil($credentialsToken))->addUser($payload); + + dump($userData->getContent(), $userData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/users/04-ShowUserByID.php b/exemple/users/04-ShowUserByID.php new file mode 100644 index 0000000..09fe433 --- /dev/null +++ b/exemple/users/04-ShowUserByID.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $userData = (new UserNotaFacil($credentialsToken))->showByID(22); + + dump($userData->getContent(), $userData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/users/05-UpdateUser.php b/exemple/users/05-UpdateUser.php new file mode 100644 index 0000000..7e67b24 --- /dev/null +++ b/exemple/users/05-UpdateUser.php @@ -0,0 +1,39 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $payload = [ + "nome" => "Otávio2 Calebe Lucas Assunção", + "cpf" => "551.334.528-53", + "email" => "bunitinho3@tuamaeaquelaursa.com", + "login" => "bunitinho12", + "password" => "#S12341m", + "skype" => "bunitinho03", + "status" => true, + "telefone" => [ + "ddd" => "41", + "numero" => "995079455", + "ramal" => "1", + "tipo_telefone" => 1 + ], + "role" => 1 + ]; + + + + $userData = (new UserNotaFacil($credentialsToken))->updateUser(22, $payload); + + dump($userData->getContent(), $userData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/exemple/users/06-DeleteUser.php b/exemple/users/06-DeleteUser.php new file mode 100644 index 0000000..3ac8360 --- /dev/null +++ b/exemple/users/06-DeleteUser.php @@ -0,0 +1,20 @@ + "CONSUMER_ID", + "token-bearer" => "TOKEN_BEARER" + ]; + + $userData = (new UserNotaFacil($credentialsToken))->deleteUser(22); + + dump($userData->getContent(), $userData->getStatusCode()); + +} catch (NotaFacilException $th) { + dump($th->getMessage(), $th->getCode()); +} \ No newline at end of file diff --git a/src/NotaFacil/Services/NSFeNotaFacil.php b/src/NotaFacil/Services/NSFeNotaFacil.php new file mode 100644 index 0000000..334a2db --- /dev/null +++ b/src/NotaFacil/Services/NSFeNotaFacil.php @@ -0,0 +1,48 @@ +credentialsNotaFacil = $credentialsNotaFacil; + } + + public function addNFSe($payload): NotaFacilResource + { + return $this->request( $this->base_url() . $this->endpoint->nfse->register, 'POST', $payload ); + } + + public function updateNFSe($idNFSe, $payload): NotaFacilResource + { + return $this->request( $this->base_url() . str_replace(':id', $idNFSe , $this->endpoint->nfse->update), 'PUT', $payload); + } + + public function deleteNFSe($idNFSe): NotaFacilResource + { + return $this->request( $this->base_url() . str_replace(':id', $idNFSe , $this->endpoint->nfse->delete), 'DELETE'); + } + + public function issueNFSe($payload): NotaFacilResource + { + return $this->request( $this->base_url() . $this->endpoint->nfse->issue, 'POST', $payload); + } + + public function cancelIssue($payload): NotaFacilResource + { + return $this->request( $this->base_url() . $this->endpoint->nfse->cancelIssue, 'POST', $payload); + } + + + +}