diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6205aea --- /dev/null +++ b/.gitignore @@ -0,0 +1,162 @@ +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope +.vscode/*.code-snippets + +# Ignore code-workspaces +*.code-workspace + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +### Composer ### +composer.phar +/vendor/ +composer.lock + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +### PHPUnit ### +# Covers PHPUnit +# Reference: https://phpunit.de/ + +# Generated files +.phpunit.result.cache +.phpunit.cache + +# PHPUnit +/app/phpunit.xml +/phpunit.xml + +# Build data +/build/ \ No newline at end of file diff --git a/src/Models/AgentSeller.php b/src/Models/AgentSeller.php new file mode 100644 index 0000000..aeaccd4 --- /dev/null +++ b/src/Models/AgentSeller.php @@ -0,0 +1,79 @@ + new DateParser()); + } + + public function getId() { + return $this->get("id"); + } + + public function setId($value) { + return $this->set("id", $value); + } + + + public function getLogin() { + return $this->get("login"); + } + + public function setLogin($value) { + return $this->set("login", $value); + } + + public function getName() { + return $this->get("name"); + } + + public function setName($value) { + return $this->set("name", $value); + } + + public function getTaxId() { + return $this->get("taxId"); + } + + public function setTaxId($value) { + return $this->set("taxId", $value); + } + + public function getDob() { + return $this->get("dob"); + } + + public function setDob($value) { + return $this->set("dob", $value); + } + + public function getCategory(){ + return $this->get("category"); + } + + public function setCategory($value){ + return $this->set("category", $value); + } + + public function getCreatedAt() { + return $this->get("created_at"); + } + + public function setCreatedAt($value) { + return $this->set("created_at", $value); + } + + +} diff --git a/src/Models/Bank.php b/src/Models/Bank.php new file mode 100644 index 0000000..fb779cc --- /dev/null +++ b/src/Models/Bank.php @@ -0,0 +1,119 @@ +get("id"); + } + + public function setId($value) { + return $this->set("id", $value); + } + + public function getKeyType() { + return $this->get("key_type"); + } + + public function setKeyType($value) { + return $this->set("Key_type", $value); + } + + public function getKeyValue() { + return $this->get("key_value"); + } + + public function setKeyValue($value) { + return $this->set("Key_value", $value); + } + + public function getHolderName() { + return $this->get("holder_name"); + } + + public function setHolderName($value) { + return $this->set("holder_name", $value); + } + + public function getHolderTaxId() { + return $this->get("holder_tax_id"); + } + + public function setHolderTaxId($value) { + return $this->set("holder_tax_id", $value); + } + + public function getBankCode() { + return $this->get("bank_code"); + } + + public function setBankCode($value) { + return $this->set("bank_code", $value); + } + + public function getBankName() { + return $this->get("bank_name"); + } + + public function setBankName($value) { + return $this->set("bank_name", $value); + } + + public function getBankBranch() { + return $this->get("bank_branch"); + } + + public function setBankBranch($value) { + return $this->set("bank_branch", $value); + } + + public function getBankAccount() { + return $this->get("bank_account"); + } + + public function setBankAccount($value) { + return $this->set("bank_account", $value); + } + +} diff --git a/src/Models/BankDestinationAccount.php b/src/Models/BankDestinationAccount.php new file mode 100644 index 0000000..56cdeea --- /dev/null +++ b/src/Models/BankDestinationAccount.php @@ -0,0 +1,19 @@ +get("amount"); + } + + public function setAmount($value) { + return $this->set("amount", $value); + } +} diff --git a/src/Models/BankOriginAccount.php b/src/Models/BankOriginAccount.php new file mode 100644 index 0000000..076e4ab --- /dev/null +++ b/src/Models/BankOriginAccount.php @@ -0,0 +1,20 @@ +get("balance"); + } + + public function setBalance($value) { + return $this->set("balance", $value); + } + +} diff --git a/src/Models/Delivery.php b/src/Models/Delivery.php new file mode 100644 index 0000000..ff08252 --- /dev/null +++ b/src/Models/Delivery.php @@ -0,0 +1,44 @@ +get("estimatedDeliveryDate"); + } + + public function setEstimatedDeliveryDate($value) { + return $this->set("estimatedDeliveryDate", $value); + } + + public function getEstimatedShippingDate() { + return $this->get("estimatedShippingDate"); + } + + public function setEstimatedShippingDate($value) { + return $this->set("estimatedShippingDate", $value); + } + + public function getDeliveryCompany() { + return $this->get("deliveryCompany"); + } + + public function setDeliveryCompany($value) { + return $this->set("deliveryCompany", $value); + } + + public function getDeliveryMethod() { + return $this->get("deliveryMethod"); + } + + public function setDeliveryMethod($value) { + return $this->set("deliveryMethod", $value); + } + +} diff --git a/src/Models/Order.php b/src/Models/Order.php index c315cfc..3ff8f82 100644 --- a/src/Models/Order.php +++ b/src/Models/Order.php @@ -1,6 +1,7 @@ new ArrayModelParser('Konduto\Models\BureauxQuery'), "events" => new ArrayModelParser('Konduto\Models\Event'), "triggered_rules" => new ArrayModelParser('Konduto\Models\TriggeredRule'), - "triggered_decision_list" => new ArrayModelParser('Konduto\Models\TriggeredDecisionList') + "triggered_decision_list" => new ArrayModelParser('Konduto\Models\TriggeredDecisionList'), + "agentSeller" => new ModelParser('Konduto\Models\AgentSeller'), + "pointOfSale" => new ModelParser('Konduto\Models\PointOfSale'), + "delivery" => new ModelParser('Konduto\Models\Delivery'), + "BankOriginAccount" => new BankArrayParser(), + "BankDestinationAccount" => new BankArrayParser() ); } @@ -358,4 +364,60 @@ public function getTriggeredRules() { public function getTriggeredDecisionList() { return $this->get("triggered_decision_list"); } + + /** + * @return \Konduto\Models\AgentSeller + */ + public function getAgentSeller() { + return $this->get("agentSeller"); + } + + public function setAgentSeller($value) { + return $this->set("agentSeller", $value); + } + + /** + * @return \Konduto\Models\PointOfSale + */ + public function getPointOfSale() { + return $this->get("pointOfSale"); + } + + public function setPointOfSale($value) { + return $this->set("pointOfSale", $value); + } + + /** + * @return \Konduto\Models\Delivery + */ + public function getDelivery() { + return $this->get("delivery"); + } + + public function setDelivery($value) { + return $this->set("delivery", $value); + } + + /** + * @return \Konduto\Models\BankOriginAccount + */ + public function getBankOriginAccount() { + return $this->get("bankOriginAccount"); + } + + public function setBankOriginAccount($value) { + return $this->set("bankOriginAccount", $value); + } + + /** + * @return \Konduto\Models\BankDestinationAccount[] + */ + public function getBankDestinationAccount() { + return $this->get("bankDestinationAccount"); + } + + public function setBankDestinationAccount(array $value) { + return $this->set("bankDestinationAccount", $value); + } + } diff --git a/src/Models/PointOfSale.php b/src/Models/PointOfSale.php new file mode 100644 index 0000000..f2b5136 --- /dev/null +++ b/src/Models/PointOfSale.php @@ -0,0 +1,59 @@ +get("id"); + } + + public function setId($value) { + return $this->set("id", $value); + } + + public function getName() { + return $this->get("name"); + } + + public function setName($value) { + return $this->set("name", $value); + } + + public function getLat() { + return $this->get("lat"); + } + + public function setLat($value) { + return $this->set("lat", $value); + } + + public function getLon() { + return $this->get("lon"); + } + + public function setLon($value) { + return $this->set("lon", $value); + } + + public function getAddress() { + return $this->get("address"); + } + + public function setAddress($value) { + return $this->set("address", $value); + } + + public function getZip() { + return $this->get("zip"); + } + + public function setZip($value) { + return $this->set("zip", $value); + } +} \ No newline at end of file diff --git a/src/Parsers/BankArrayParser.php b/src/Parsers/BankArrayParser.php new file mode 100644 index 0000000..7246a3e --- /dev/null +++ b/src/Parsers/BankArrayParser.php @@ -0,0 +1,16 @@ + $keyType) { + if (is_array($keyType)) + $value[$i] = Bank::build($keyType); + } + return $value; + } +} \ No newline at end of file diff --git a/tests/integration/GetOrderTest.php b/tests/integration/GetOrderTest.php index 8fe1cf2..b52136f 100644 --- a/tests/integration/GetOrderTest.php +++ b/tests/integration/GetOrderTest.php @@ -1,12 +1,13 @@ setId("51") + ->setName("Capital Representações") + ->setLat(-23.5677666) + ->setLon(-46.6487763) + ->setAddress("Rua Dez de Abril, 23") + ->setCity("São Paulo") + ->setState("SP") + ->setZip("01001-001") + ->setCountry("BR"); + $this->assertEquals("51", $pointOfSale->getId()); + $this->assertEquals("Capital Representações", $pointOfSale->getName()); + $this->assertEquals(-23.5677666, $pointOfSale->getLat()); + $this->assertEquals(-46.6487763, $pointOfSale->getLon()); + $this->assertEquals("Rua Dez de Abril, 23", $pointOfSale->getAddress()); + $this->assertEquals("São Paulo", $pointOfSale->getCity()); + $this->assertEquals("SP", $pointOfSale->getState()); + $this->assertEquals("01001-001", $pointOfSale->getZip()); + $this->assertEquals("BR", $pointOfSale->getCountry()); + } +} \ No newline at end of file