forked from adhenrique/zoop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 94ee60b
Showing
34 changed files
with
1,585 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.bundle | ||
db/*.sqlite3 | ||
log/*.log | ||
tmp/ | ||
.sass-cache/ | ||
coverage/ | ||
*~ | ||
*.DS_Store | ||
*.out | ||
*.swp | ||
.sass-cache/ | ||
.sass-cache/* | ||
.sass-cache/** | ||
tmp/ | ||
tmp/*/* | ||
tmp/** | ||
*/*.swp | ||
|
||
/vendor/ | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License | ||
|
||
Copyright (c) 2012-2015 Iugu | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
# ZOOP Laravel | ||
|
||
Zoop-laravel is a package for **Laravel 5.3+**, which consumes ZOOP payments api's. | ||
|
||
## Requeriments | ||
|
||
* Laravel 5.3+ | ||
* PHP 5.6+ | ||
* PHP ext-curl | ||
* PHP ext-json | ||
* PHP ext-mbstring | ||
|
||
|
||
## Instalation | ||
### 1 - Composer require | ||
Use composer to install the package and automatically update `composer.json`, running: | ||
|
||
~~~ | ||
composer require adhenrique/zoop | ||
~~~ | ||
|
||
### 2 - Update Laravel configuration | ||
Update your application configuration to register the package in `config/app.php` adding the following line in `'providers'` section: | ||
|
||
~~~ | ||
'providers' => [ | ||
//... | ||
Zoop\src\ZoopServiceProvider::class, | ||
//... | ||
], | ||
~~~ | ||
|
||
### 3 - Update ZOOP Laravel configuration | ||
Update your credentials in `zoop/src/resources/config/config.php` by changing the following lines: | ||
|
||
~~~ | ||
'defaults' => [ | ||
//... | ||
'publishable_key' => 'YOUR_PUBLISHABLE_KEY', | ||
'marketplace_id' => 'YOUR_MARKETPLACE_ID', | ||
//... | ||
] | ||
~~~ | ||
|
||
...enjoy it :D. | ||
|
||
## Usage | ||
### 1 - Tokenizer Credit Card | ||
**In your Controller** | ||
```php | ||
namespace App\Http\Controllers; | ||
|
||
use Zoop\src\Facades\ZoopTokens; | ||
|
||
class HomeController extends Controller{ | ||
$ccToken = ZoopTokens::tokenizeCard([ | ||
'holder_name' => 'Makeda Swasey', | ||
'expiration_month' => "12", | ||
'expiration_year' => "2015", | ||
'security_code' => "373", | ||
'card_number' => "4532395075641483", | ||
]); | ||
|
||
dd($ccToken); | ||
} | ||
``` | ||
|
||
### 2 - Creating a new Individual Seller | ||
**In your Controller** | ||
```php | ||
namespace App\Http\Controllers; | ||
|
||
use Zoop\src\Facades\ZoopSellers; | ||
|
||
class HomeController extends Controller{ | ||
$individualSeller = ZoopSellers::create([ | ||
'first_name' => 'Rodrigo', | ||
'last_name' => "Miranda", | ||
'email' => "[email protected]", | ||
'phone_number' => "+12195465432", | ||
'ssn_last4_digits' => "7551", | ||
'birthdate' => "1983-09-11", | ||
'website' => "http://pagzoop.com", | ||
'facebook' => "https://www.facebook.com/rodrigo", | ||
'twitter' => "http://twitter.com/hypercreative", | ||
]); | ||
|
||
dd($individualSeller); | ||
} | ||
``` | ||
|
||
### 3 - Creating a new Buyer | ||
**In your Controller** | ||
```php | ||
namespace App\Http\Controllers; | ||
|
||
use Zoop\src\Facades\ZoopBuyers; | ||
|
||
class HomeController extends Controller{ | ||
$buyer = ZoopBuyers::create([ | ||
'first_name' => 'Fabiano', | ||
'last_name' => 'Cruz', | ||
'description' => 'Comprador de teste', | ||
'email' => '[email protected]', | ||
]); | ||
|
||
dd($buyer); | ||
} | ||
``` | ||
|
||
### 4 - Card Not Present Transaction | ||
**In your Controller** | ||
```php | ||
namespace App\Http\Controllers; | ||
|
||
use Zoop\src\Facades\ZoopChargeCNP; | ||
|
||
class HomeController extends Controller{ | ||
$cnp = ZoopChargesCNP::create([ | ||
'currency' => 'BRL', | ||
'amount' => '100', | ||
'payment_type' => 'credit', | ||
'description' => 'Venda de teste, somente!', | ||
'statement_descriptor' => 'Descrição de testes', | ||
'on_behalf_of' => 'bb2a51f1c22a4c30b6bf6819be87ac52', | ||
'installment_plan[mode]' => 'interest_free', | ||
'installment_plan[number_installments]' => '1', | ||
'customer' => 'bb2a51f1c22a4c30b6bf6819be87ac52', //buyer ud | ||
]); | ||
|
||
dd($cnp); | ||
} | ||
``` | ||
|
||
## ZOOP Api Reference | ||
|
||
[https://pagzoop.com/api/docs/](https://pagzoop.com/api/docs/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "adhenrique/zoop", | ||
"description": "Zoop SDK to Laravel framework version 5.3+", | ||
"keywords": [ | ||
"Zoop", | ||
"pagamento móvel", | ||
"cartão de credito", | ||
"ponto de venda", | ||
"e-commerce", | ||
"PDV", | ||
"Wispot", | ||
"Myguest" | ||
], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Adenilton Henrique Ribeiro", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.6", | ||
"ext-curl": "*", | ||
"ext-json": "*", | ||
"ext-mbstring": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Zoop\src\Contracts; | ||
|
||
use Zoop\src\Lib\APIResource; | ||
|
||
interface ZoopBankAccounts{ | ||
|
||
/** | ||
* API Resource. | ||
* | ||
* @param $APIResource $APIResource | ||
*/ | ||
public function __construct(APIResource $APIResource); | ||
|
||
/** | ||
* Associate a bank account from a given token. | ||
* | ||
* @param $post array | ||
*/ | ||
public function associateWithACustomer($post); | ||
|
||
/** | ||
* Deactivate bank account by id. | ||
* | ||
* @param $bankAccountID string | ||
* @param $post array | ||
*/ | ||
public function deactivate($bankAccountID, $post); | ||
|
||
/** | ||
* Deletes the specified bank account by id | ||
* | ||
* @param $bankAccountID string | ||
*/ | ||
public function delete($bankAccountID); | ||
|
||
/** | ||
* Returns the bank account resource by id | ||
* | ||
* @param $bankAccountID string | ||
*/ | ||
public function get($bankAccountID); | ||
|
||
/** | ||
* Returns a JSON object with a list of bank accounts. | ||
*/ | ||
public function getAll(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Zoop\src\Contracts; | ||
|
||
use Zoop\src\Lib\APIResource; | ||
|
||
interface ZoopBuyers{ | ||
|
||
/** | ||
* API Resource. | ||
* | ||
* @param $APIResource $APIResource | ||
*/ | ||
public function __construct(APIResource $APIResource); | ||
|
||
/** | ||
* Create a new Buyer | ||
* | ||
* @param $post array | ||
*/ | ||
public function create($post); | ||
|
||
/** | ||
* Delete a Buyer by id | ||
* | ||
* @param $buyerID string | ||
*/ | ||
public function delete($buyerID); | ||
|
||
/** | ||
* Retrieve the details of a Buyer by id | ||
* | ||
* @param $buyerID string | ||
*/ | ||
public function get($buyerID); | ||
|
||
/** | ||
* Returns a JSON object with a list of buyers accounts. | ||
*/ | ||
public function getAll(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Zoop\src\Contracts; | ||
|
||
use Zoop\src\Lib\APIResource; | ||
|
||
interface ZoopCards{ | ||
|
||
/** | ||
* API Resource. | ||
* | ||
* @param $APIResource $APIResource | ||
*/ | ||
public function __construct(APIResource $APIResource); | ||
|
||
/** | ||
* Associate a credit card token with a given customer id. | ||
* | ||
* @param $post array | ||
*/ | ||
public function associateWithACustomer($post); | ||
|
||
/** | ||
* Deactivate card by id. | ||
* | ||
* @param $creditCardID string | ||
* @param $post array | ||
*/ | ||
public function deactivate($creditCardID, $post); | ||
|
||
/** | ||
* Delete a Credit Card by id | ||
* | ||
* @param $buyerID string | ||
*/ | ||
public function delete($buyerID); | ||
|
||
/** | ||
* Retrieve the details of a Credit Card by id | ||
* | ||
* @param $buyerID string | ||
*/ | ||
public function get($buyerID); | ||
|
||
/** | ||
* Returns a JSON object with a list of Credit Cards. | ||
*/ | ||
public function getAll(); | ||
} |
Oops, something went wrong.