Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 162 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/
79 changes: 79 additions & 0 deletions src/Models/AgentSeller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php namespace Konduto\Models;

use Konduto\Parsers\DateParser;

class AgentSeller extends BaseModel {

/**
* @inheritDoc
*/
protected function fields() {
return array("id", "login", "name", "taxId", "dob", "category", "created_at");
}

/**
* @inheritDoc
*/
protected function initParsers() {
return array("created_at", "dob" => 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);
}


}
119 changes: 119 additions & 0 deletions src/Models/Bank.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?php namespace Konduto\Models;

class Bank extends BaseModel {

const PIX_CPF = "pix_cpf";
const PIX_CNPJ = "pix_cnpj";
const PIX_PHONE = "pix_phone";
const PIX_EMAIL = "pix_email";
const PIX_EVP = "pix_evp";
const P2P = "p2p";
const NONE = "none";


public static $availableKeyTypes = array(self::PIX_CPF, self::PIX_CNPJ,
self::PIX_PHONE, self::PIX_EMAIL, self::PIX_EVP, self::P2P, self::NONE);

/**
* @inheritdoc
*/
protected function fields() {
return array("id", "key_type", "key_value", "holder_name", "holder_tax_id",
"bank_code", "bank_name", "bank_branch", "bank_account");
}

/**
* @return Bank
*/
public static function build(array $array) {
if (array_key_exists("key_type", $array) && in_array($array["key_type"], self::$availableKeyTypes)) {
switch ($array["key_type"]) {
case Bank:: PIX_CPF:
case Bank:: PIX_CNPJ:
case Bank:: PIX_PHONE:
case Bank:: PIX_EMAIL:
case Bank:: PIX_EVP:
case Bank:: P2P:
case Bank:: NONE:
return new Bank($array);
break;

default: // Exception
}
}
throw new \InvalidArgumentException("Array must contain a valid 'key_type' field");
}

public function getId() {
return $this->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);
}

}
19 changes: 19 additions & 0 deletions src/Models/BankDestinationAccount.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php namespace Konduto\Models;

class BankDestinationAccount extends Bank {

/**
* @inheritdoc
*/
protected function fields() {
return array_merge(parent::fields(), array("amount"));
}

public function getAmount() {
return $this->get("amount");
}

public function setAmount($value) {
return $this->set("amount", $value);
}
}
Loading