This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Showing
13 changed files
with
494 additions
and
8 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,32 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/moip/moip-sdk-php/compare/v1.2.0...v1.3.0) (2017-08-08) | ||
|
||
## Bug Fixes | ||
- **order:** | ||
- fix adding of installments in checkout preferences | ||
([3dee9fa](https://github.com/moip/moip-sdk-php/commit/3dee9fa7b9a5863ba4828de2f03a5fd7a1254898)) | ||
- **refund:** | ||
- fix of bank account refund | ||
([d336f9f](https://github.com/moip/moip-sdk-php/commit/d336f9f04dc92a978e3d67942091b573c9a30643)) | ||
- fix method to return HATEOAS links from API | ||
([025bfde](https://github.com/moip/moip-sdk-php/commit/025bfdedde5bfe953264b24daa0ba371e73e43cd)) | ||
- fix method to get DateTime from resources | ||
([3d30cbb](https://github.com/moip/moip-sdk-php/pull/152/commits/3d30cbbf49fb9c4ee1b6049dd93cd3487a9fef81)) | ||
|
||
|
||
## New Features | ||
- **escrow:** add escrow resource | ||
([ed99701](https://github.com/moip/moip-sdk-php/commit/ed9970156de1dea88a091fd33b54bcec8f91ce92)), | ||
- **notification preferences:** add notification preferences resource | ||
([e553d8b](https://github.com/moip/moip-sdk-php/commit/e553d8b9c9878009cb2d2e021043f3ebbaeb2dc5)) | ||
- **customer credit card:** add resource to add more credit cards to customer | ||
([d327f03](https://github.com/moip/moip-sdk-php/commit/d327f03b5d2449dbac95f3f3cabcd17a19b8853a)) | ||
|
||
## BREAKING CHANGES | ||
Now tests are runned using OAuth authentication instead Basic Auth, because now there are tests to resources that only uses OAuth authentication. |
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,43 @@ | ||
# Contributing | ||
:clap::tada: Thank you for taking the time to contribute! :tada::clap: | ||
|
||
We really value your willingness to contribute to this project. In order to higher the chances of your contribution being accepted, please refer to the following guidelines! | ||
|
||
## Steps | ||
|
||
1. Fork it! | ||
2. Create your feature branch: `git checkout -b feature/xyz develop` | ||
3. Commit your changes according to our commit message standards: `git commit -am 'feat(xyz) Added new functionality'` | ||
4. Push to your repo: `git push origin feature/xyz` | ||
5. Submit a pull request to `develop` | ||
|
||
## Workflow | ||
This repo uses Gitflow as its branch management system. You can learn more about Gitflow [here](https://www.atlassian.com/git/tutorials/comparing-workflows#gitflow-workflow). | ||
A few quick tips: | ||
* All feature branches should be based on `develop` and have the format `feature/branch_name`. | ||
* Minor bug fixes should be based on `master` and have the format `hotfix/branch_name`. | ||
|
||
### Commit Conventions | ||
In order to make the changelog generation easier we recommend the use of messages based on [Conventional Commits](https://conventionalcommits.org/). | ||
|
||
Examples: | ||
``` | ||
feat(orders): added `XYZ` helper function | ||
commit description | ||
footer notes | ||
``` | ||
|
||
``` | ||
refactor(orders): refactored `ABC` helper function | ||
The behaviour of `ABC` was inconsistent and (...) | ||
BREAKING CHANGE: return type of `ABC` is now `String` | ||
``` | ||
|
||
``` | ||
docs: updated documentation in Request.php | ||
``` | ||
|
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,80 @@ | ||
<?php | ||
|
||
namespace Moip\Helper; | ||
|
||
/** | ||
* Class Filters. | ||
*/ | ||
class Filters | ||
{ | ||
/** | ||
* @var array | ||
**/ | ||
private $filters = []; | ||
|
||
/** | ||
* Set filter to compare if field is greater than value. | ||
* | ||
* @param string $field field to setup filter. | ||
* @param int|Date $value value to setup filter. | ||
*/ | ||
public function greaterThan($field, $value) | ||
{ | ||
$this->filters[] = sprintf('%s::gt(%s)', $field, $value); | ||
} | ||
|
||
/** | ||
* Set filter to compare if field is greater than or equal value. | ||
* | ||
* @param string $field field to setup filter. | ||
* @param int|Date $value value to setup filter. | ||
*/ | ||
public function greaterThanOrEqual($field, $value) | ||
{ | ||
$this->filters[] = sprintf('%s::ge(%s)', $field, $value); | ||
} | ||
|
||
/** | ||
* Set filter to compare if field is less than value. | ||
* | ||
* @param string $field field to setup filter. | ||
* @param int|Date $value value to setup filter. | ||
*/ | ||
public function lessThan($field, $value) | ||
{ | ||
$this->filters[] = sprintf('%s::lt(%s)', $field, $value); | ||
} | ||
|
||
/** | ||
* Set filter to compare if field is between both values. | ||
* | ||
* @param string $field field to setup filter. | ||
* @param string $value1 first value to setup filter. | ||
* @param string $value2 second value to setup filter. | ||
*/ | ||
public function between($field, $value1, $value2) | ||
{ | ||
$this->filters[] = sprintf('%s::bt(%s,%s)', $field, $value1, $value2); | ||
} | ||
|
||
/** | ||
* Set filter to compare if field is in array. | ||
* | ||
* @param string $field field to setup filter. | ||
* @param array $values value to setup filter. | ||
*/ | ||
public function in($field, array $values) | ||
{ | ||
$this->filters[] = sprintf('%s::in(%s)', $field, implode(',', $values)); | ||
} | ||
|
||
/** | ||
* Join filters in one string. | ||
* | ||
* @return string | ||
*/ | ||
public function __toString() | ||
{ | ||
return implode('|', $this->filters); | ||
} | ||
} |
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,76 @@ | ||
<?php | ||
|
||
namespace Moip\Helper; | ||
|
||
/** | ||
* Class Pagination. | ||
*/ | ||
class Pagination | ||
{ | ||
/** | ||
* @var int | ||
**/ | ||
private $offset = 0; | ||
|
||
/** | ||
* @var int | ||
**/ | ||
private $limit = 100; | ||
|
||
/** | ||
* Pagination constructor. | ||
* | ||
* @param int $limit | ||
* @param int $offset | ||
*/ | ||
public function __construct($limit = null, $offset = null) | ||
{ | ||
if (!empty($limit)) { | ||
$this->limit = $limit; | ||
} | ||
|
||
if (!empty($offset)) { | ||
$this->offset = $offset; | ||
} | ||
} | ||
|
||
/** | ||
* Get offset. | ||
* | ||
* @return int | ||
*/ | ||
public function getOffset() | ||
{ | ||
return $this->offset; | ||
} | ||
|
||
/** | ||
* Set offset. | ||
* | ||
* @param int $offset | ||
*/ | ||
public function setOffset($offset) | ||
{ | ||
$this->offset = $offset; | ||
} | ||
|
||
/** | ||
* Get limit. | ||
* | ||
* @return int | ||
*/ | ||
public function getLimit() | ||
{ | ||
return $this->limit; | ||
} | ||
|
||
/** | ||
* Set limit. | ||
* | ||
* @param int $limit | ||
*/ | ||
public function setLimit($limit) | ||
{ | ||
$this->limit = $limit; | ||
} | ||
} |
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
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
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
Oops, something went wrong.