Skip to content

Commit

Permalink
Merge pull request #11 from taciobrito/master
Browse files Browse the repository at this point in the history
Fix headers sent when exists upload files
  • Loading branch information
adhenrique authored Sep 29, 2021
2 parents 6066267 + d367316 commit 9269359
Show file tree
Hide file tree
Showing 36 changed files with 355 additions and 132 deletions.
14 changes: 14 additions & 0 deletions src/Contracts/ZoopBankAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ interface ZoopBankAccounts{
*/
public function __construct(APIResource $APIResource);

/**
* Create a new bank account token
*
* @param $post array
*/
public function create($post);

/**
* Associate a bank account from a given token.
*
Expand Down Expand Up @@ -46,4 +53,11 @@ public function get($bankAccountID);
* Returns a JSON object with a list of bank accounts.
*/
public function getAll();

/**
* Returns a JSON object with a list of bank accounts by seller.
*
* @param $sellerID string
*/
public function getAllBySeller($sellerID);
}
8 changes: 8 additions & 0 deletions src/Contracts/ZoopChargesCNP.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,12 @@ public function get($transactionID);
* @param $get array || null
*/
public function getAll($get = null);

/**
* Returns a JSON object with a list of transactions by seller.
*
* @param $sellerID string
* @param $get array || null
*/
public function getAllBySeller($sellerID, $get = null);
}
55 changes: 51 additions & 4 deletions src/Contracts/ZoopSellers.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,56 @@ public function __construct(APIResource $APIResource);
*/
public function createIndividuals($post);

/**
* Update a created Individual Seller
*
* @param $sellerID string
* @param $post array
*/
public function updateIndividuals($sellerID, $post);

/**
* Create a new Business Seller
*
* @param $post array
*/
public function createBusiness($post);

/**
* Update a created Business Seller
*
* @param $sellerID string
* @param $post array
*/
public function updateBusiness($sellerID, $post);

/**
* Delete a Seller by id
*
* @param $buyerID string
* @param $sellerID string
*/
public function delete($buyerID);
public function delete($sellerID);

/**
* Retrieve the details of a Seller by id
*
* @param $buyerID string
* @param $sellerID string
*/
public function get($buyerID);
public function get($sellerID);

/**
* Retrieve the details of a Seller by taxpayer_id
*
* @param $sellerTaxpayer_id string
*/
public function getByTaxpayer_id($sellerTaxpayer_id);

/**
* Retrieve the details of a Seller by ein
*
* @param $sellerEin string
*/
public function getByEin($sellerEin);

/**
* Returns a JSON object with a list of Sellers.
Expand Down Expand Up @@ -67,4 +97,21 @@ public function getDoc($docID);
* @param $sellerID string
*/
public function getAllDocs($sellerID);

/**
* Download doc file
*
* @param $docID string
*/
public function downloadDoc($docID);

/**
* Returns a JSON object with a list of MCCs.
*/
public function getAllMccs();

/**
* Returns a JSON object with a current balance and total account balance
*/
public function getBalances($sellerID);
}
2 changes: 1 addition & 1 deletion src/Exceptions/ZoopAuthenticationException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

namespace Zoop\src\Exceptions;
namespace Zoop\Exceptions;

class ZoopAuthenticationException extends \Exception{}
2 changes: 1 addition & 1 deletion src/Exceptions/ZoopObjectNotFound.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

namespace Zoop\src\Exceptions;
namespace Zoop\Exceptions;

class ZoopObjectNotFound extends \Exception {}
2 changes: 1 addition & 1 deletion src/Facades/ZoopBankAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopBankAccounts extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopBankAccounts';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopBuyers.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopBuyers extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopBuyers';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopCards.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopCards extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopCards';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopChargesCNP.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopChargesCNP extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopChargesCNP';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopInvoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopInvoices extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopInvoices';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopPlans.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopPlans extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopPlans';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopSellers.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopSellers extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopSellers';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopSplitTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopSplitTransactions extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopSplitTransactions';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopSubscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopSubscriptions extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopSubscriptions';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopTokens extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopTokens';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopTransfers.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopTransfers extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopTransfers';
}
}
2 changes: 1 addition & 1 deletion src/Facades/ZoopWebhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ZoopWebhooks extends Facade{
/**
* @return string
*/
protected static function getFacadeAccessor(){
protected static function getFacadeAccessor() {
return 'ZoopWebhooks';
}
}
2 changes: 1 addition & 1 deletion src/Helpers/ZoopHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trait ZoopHelpers{
*
* @return array
*/
public function reArrayFiles(&$file){
public function reArrayFiles(&$file) {
// dd($file);
$file_ary = array();
$file_count = count($file['name']);
Expand Down
16 changes: 8 additions & 8 deletions src/Lib/APIRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Zoop\Lib;

use Zoop\src\Exceptions\ZoopAuthenticationException;
use Zoop\src\Exceptions\ZoopObjectNotFound;
use Zoop\Exceptions\ZoopAuthenticationException;
use Zoop\Exceptions\ZoopObjectNotFound;

class APIRequest{

Expand All @@ -26,7 +26,7 @@ class APIRequest{
*
* @param $base object
*/
public function __construct($base){
public function __construct($base) {
$this->zoopBase = $base;
}

Expand All @@ -37,7 +37,7 @@ public function __construct($base){
*
* @return APIRequest
*/
public static function getInstance($base){
public static function getInstance($base) {
if (is_null(self::$instance)) {
self::$instance = new APIRequest($base);
}
Expand All @@ -57,7 +57,7 @@ public static function getInstance($base){
* @throws ZoopAuthenticationException
* @throws ZoopObjectNotFound
*/
public function request($method, $url, $headers, $data = []){
public function request($method, $url, $headers, $data = []) {
global $zoop_last_api_response_code;

if ($this->zoopBase->getMarketplaceId() == null) {
Expand Down Expand Up @@ -104,11 +104,11 @@ public function request($method, $url, $headers, $data = []){
*
* @return array
*/
private function requestWithCURL($method, $url, $headers, $data = Array()){
private function requestWithCURL($method, $url, $headers, $data = Array()) {
$curl = curl_init();
$opts = Array();

if(strtolower($method) == 'file'){
if(strtolower($method) == 'file') {
$opts[CURLOPT_POST] = 1;
$opts[CURLOPT_POSTFIELDS] = $data;
}
Expand Down Expand Up @@ -177,4 +177,4 @@ private function encodeParameters($method, $url, $data = []) {
$data
];
}
}
}
Loading

0 comments on commit 9269359

Please sign in to comment.