Skip to content

Commit

Permalink
Merge pull request #49 from mollie/v2-omnipay-mollie
Browse files Browse the repository at this point in the history
V2 omnipay mollie
  • Loading branch information
barryvdh authored Jul 24, 2018
2 parents f3131c6 + 5058ad7 commit dafdbdd
Show file tree
Hide file tree
Showing 71 changed files with 1,773 additions and 1,074 deletions.
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

0 comments on commit dafdbdd

Please sign in to comment.