Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 omnipay mollie #49

Merged
merged 29 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
50a4bc7
Update the fetch issuer endpoint and some preparations
Jul 19, 2018
a0552cb
Update payment request to v2
Jul 19, 2018
5e2c4c2
Signature update in order to be compatible with PHP unit
Jul 19, 2018
7ff3931
Update complete purchase request tests
Jul 19, 2018
e8cec6b
Merge remote-tracking branch 'origin/v2-omnipay-mollie' into v2-omnip…
Jul 19, 2018
e0008ed
SiRefund creation
Jul 19, 2018
8e6a925
Refund creation - missing part
Jul 19, 2018
131a212
Update the customer tests to v2
Jul 19, 2018
97e7648
Update the fetch payment methods request to v2
Jul 19, 2018
bac2cec
Merge remote-tracking branch 'origin/v2-omnipay-mollie' into v2-omnip…
Jul 19, 2018
62e63f6
Fix gateway test and do some cleanup
Jul 19, 2018
a640c75
ReFetch transaction
Jul 19, 2018
5391f94
Merge remote-tracking branch 'origin/v2-omnipay-mollie' into v2-omnip…
Jul 19, 2018
99ffa2e
Splitting requests and responses to separate namespases and adding so…
Jul 20, 2018
10254a1
Splitting requests and responses to separate namespases and adding so…
Jul 20, 2018
3690264
Added phplint and phpmd
Jul 20, 2018
fde65f3
Code style
Jul 20, 2018
9d3a4ac
Classes descriptions and links to ththe documentation
Jul 20, 2018
1acaea3
AbstractResponse -> AbstractMollieResponse
Jul 20, 2018
a894622
Gateway docs
Jul 20, 2018
f8015d1
Add currency to the purchase validation
Jul 20, 2018
c635a3a
Some self-review changes
Jul 20, 2018
1618747
ClAmount fix for Refunds
Jul 23, 2018
2cd141e
Code style
Jul 23, 2018
3b21459
Fix failing test
Jul 23, 2018
7a58a27
Versions for dev libs and some code styling
Jul 23, 2018
9603591
Merge branch 'v2-omnipay-mollie' of github.com:mollie/omnipay-mollie …
Jul 23, 2018
5bcc673
Versions update
Jul 23, 2018
5058ad7
Versions update for omnipay/common
Jul 23, 2018
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
composer.lock
composer.phar
phpunit.xml
/.idea
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@
"autoload": {
"psr-4": { "Omnipay\\Mollie\\" : "src/" }
},
"autoload-dev": {
"psr-4": { "Omnipay\\Mollie\\Test\\": "tests/" }
},
"require": {
"omnipay/common": "^3"
"omnipay/common": "3.0.2"
},
"require-dev": {
"omnipay/tests": "^3",
"omnipay/tests": "^3.1",
"squizlabs/php_codesniffer": "^3",
"phpro/grumphp": "^0.14"
"phpro/grumphp": "^0.14",
"phpmd/phpmd": "^2",
"overtrue/phplint": "^1",
"jakub-onderka/php-parallel-lint": "^1"
},
"extra": {
"branch-alias": {
"dev-master": "4.0.x-dev"
"dev-master": "5.0.x-dev"
}
},
"scripts": {
Expand Down
9 changes: 8 additions & 1 deletion grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ parameters:
warning_severity: ~
ignore_patterns:
- tests/
triggered_by: [php]
triggered_by: [php]
phpmd:
exclude: []
ruleset: ['cleancode', 'codesize', 'naming']
triggered_by: ['php']
phplint:
exclude: []
triggered_by: ['php', 'phtml', 'php3', 'php4', 'php5']
105 changes: 76 additions & 29 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,31 @@
namespace Omnipay\Mollie;

use Omnipay\Common\AbstractGateway;
use Omnipay\Common\Message\RequestInterface;
use Omnipay\Mollie\Message\Request\CompletePurchaseRequest;
use Omnipay\Mollie\Message\Request\CreateCustomerRequest;
use Omnipay\Mollie\Message\Request\FetchCustomerRequest;
use Omnipay\Mollie\Message\Request\FetchIssuersRequest;
use Omnipay\Mollie\Message\Request\FetchPaymentMethodsRequest;
use Omnipay\Mollie\Message\Request\FetchTransactionRequest;
use Omnipay\Mollie\Message\Request\PurchaseRequest;
use Omnipay\Mollie\Message\Request\RefundRequest;
use Omnipay\Mollie\Message\Request\UpdateCustomerRequest;

/**
* Mollie (iDeal) Gateway
* Mollie Gateway provides a wrapper for Mollie API.
* Please have a look at links below to have a high-level overview and see the API specification
*
* @link https://www.mollie.nl/files/documentatie/payments-api.html
* @see https://www.mollie.com/en/developers
* @see https://docs.mollie.com/index
*
* @method RequestInterface authorize(array $options = array())
* @method RequestInterface completeAuthorize(array $options = array())
* @method RequestInterface capture(array $options = array())
* @method RequestInterface void(array $options = array())
* @method RequestInterface createCard(array $options = array())
* @method RequestInterface updateCard(array $options = array())
* @method RequestInterface deleteCard(array $options = array())
*/
class Gateway extends AbstractGateway
{
Expand Down Expand Up @@ -48,82 +68,109 @@ public function setApiKey($value)

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\FetchIssuersRequest
* @return FetchIssuersRequest
*/
public function fetchIssuers(array $parameters = array())
public function fetchIssuers(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\FetchIssuersRequest', $parameters);
/** @var FetchIssuersRequest $request */
$request = $this->createRequest(FetchIssuersRequest::class, $parameters);

return $request;
}

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\FetchPaymentMethodsRequest
* @return FetchPaymentMethodsRequest
*/
public function fetchPaymentMethods(array $parameters = array())
public function fetchPaymentMethods(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\FetchPaymentMethodsRequest', $parameters);
/** @var FetchPaymentMethodsRequest $request */
$request = $this->createRequest(FetchPaymentMethodsRequest::class, $parameters);

return $request;
}

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\FetchTransactionRequest
* @return FetchTransactionRequest
*/
public function fetchTransaction(array $parameters = array())
public function fetchTransaction(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\FetchTransactionRequest', $parameters);
/** @var FetchTransactionRequest $request */
$request = $this->createRequest(FetchTransactionRequest::class, $parameters);

return $request;
}

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\PurchaseRequest
* @return PurchaseRequest
*/
public function purchase(array $parameters = array())
public function purchase(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\PurchaseRequest', $parameters);
/** @var PurchaseRequest $request */
$request = $this->createRequest(PurchaseRequest::class, $parameters);

return $request;
}

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\CompletePurchaseRequest
* @return CompletePurchaseRequest
*/
public function completePurchase(array $parameters = array())
public function completePurchase(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\CompletePurchaseRequest', $parameters);
/** @var CompletePurchaseRequest $request */
$request = $this->createRequest(CompletePurchaseRequest::class, $parameters);

return $request;
}

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\RefundRequest
* @return RefundRequest
*/
public function refund(array $parameters = array())
public function refund(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\RefundRequest', $parameters);
/** @var RefundRequest $request */
$request = $this->createRequest(RefundRequest::class, $parameters);

return $request;
}

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\CreateCustomerRequest
* @return CreateCustomerRequest
*/
public function createCustomer(array $parameters = array())
public function createCustomer(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\CreateCustomerRequest', $parameters);
/** @var CreateCustomerRequest $request */
$request = $this->createRequest(CreateCustomerRequest::class, $parameters);

return $request;
}

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\UpdateCustomerRequest
* @return UpdateCustomerRequest
*/
public function updateCustomer(array $parameters = array())
public function updateCustomer(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\UpdateCustomerRequest', $parameters);
/** @var UpdateCustomerRequest $request */
$request = $this->createRequest(UpdateCustomerRequest::class, $parameters);

return $request;
}

/**
* @param array $parameters
* @return \Omnipay\Mollie\Message\FetchCustomerRequest
* @return FetchCustomerRequest
*/
public function fetchCustomer(array $parameters = array())
public function fetchCustomer(array $parameters = [])
{
return $this->createRequest('\Omnipay\Mollie\Message\FetchCustomerRequest', $parameters);
/** @var FetchCustomerRequest $request */
$request = $this->createRequest(FetchCustomerRequest::class, $parameters);

return $request;
}
}
42 changes: 0 additions & 42 deletions src/Message/AbstractRequest.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/Message/AbstractResponse.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Message/CreateCustomerResponse.php

This file was deleted.

16 changes: 0 additions & 16 deletions src/Message/FetchCustomerResponse.php

This file was deleted.

26 changes: 0 additions & 26 deletions src/Message/FetchIssuersRequest.php

This file was deleted.

26 changes: 0 additions & 26 deletions src/Message/FetchIssuersResponse.php

This file was deleted.

26 changes: 0 additions & 26 deletions src/Message/FetchPaymentMethodsRequest.php

This file was deleted.

Loading