File manager - Edit - /home/opticamezl/www/newok/mollie.tar
Back
src/Message/FetchPaymentMethodsResponse.php 0000604 00000001332 15173220363 0015057 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Common\Message\FetchPaymentMethodsResponseInterface; use Omnipay\Common\PaymentMethod; class FetchPaymentMethodsResponse extends AbstractResponse implements FetchPaymentMethodsResponseInterface { /** * Return available paymentmethods as an associative array. * * @return \Omnipay\Common\PaymentMethod[] */ public function getPaymentMethods() { if (isset($this->data['data'])) { $paymentMethods = array(); foreach ($this->data['data'] as $method) { $paymentMethods[] = new PaymentMethod($method['id'], $method['description']); } return $paymentMethods; } } } src/Message/PurchaseRequest.php 0000604 00000002467 15173220363 0012562 0 ustar 00 <?php namespace Omnipay\Mollie\Message; /** * Mollie Purchase Request * * @method \Omnipay\Mollie\Message\PurchaseResponse send() */ class PurchaseRequest extends AbstractRequest { public function getMetadata() { return $this->getParameter('metadata'); } public function setMetadata($value) { return $this->setParameter('metadata', $value); } public function getData() { $this->validate('apiKey', 'amount', 'description', 'returnUrl'); $data = array(); $data['amount'] = $this->getAmount(); $data['description'] = $this->getDescription(); $data['redirectUrl'] = $this->getReturnUrl(); $data['method'] = $this->getPaymentMethod(); $data['metadata'] = $this->getMetadata(); if ($this->getTransactionId()) { $data['metadata']['transactionId'] = $this->getTransactionId(); } $data['issuer'] = $this->getIssuer(); $webhookUrl = $this->getNotifyUrl(); if (null !== $webhookUrl) { $data['webhookUrl'] = $webhookUrl; } return $data; } public function sendData($data) { $httpResponse = $this->sendRequest('POST', '/payments', $data); return $this->response = new PurchaseResponse($this, $httpResponse->json()); } } src/Message/FetchTransactionResponse.php 0000604 00000005125 15173220363 0014407 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Common\Message\RedirectResponseInterface; class FetchTransactionResponse extends AbstractResponse implements RedirectResponseInterface { /** * {@inheritdoc} */ public function isRedirect() { return isset($this->data['links']['paymentUrl']); } /** * {@inheritdoc} */ public function getRedirectUrl() { if ($this->isRedirect()) { return $this->data['links']['paymentUrl']; } } /** * {@inheritdoc} */ public function getRedirectMethod() { return 'GET'; } /** * {@inheritdoc} */ public function getRedirectData() { return null; } /** * {@inheritdoc} */ public function isSuccessful() { return parent::isSuccessful(); } /** * @return boolean */ public function isOpen() { return isset($this->data['status']) && 'open' === $this->data['status']; } /** * @return boolean */ public function isCancelled() { return isset($this->data['status']) && 'cancelled' === $this->data['status']; } /** * @return boolean */ public function isPaid() { return isset($this->data['status']) && 'paid' === $this->data['status']; } /** * @return boolean */ public function isPaidOut() { return isset($this->data['status']) && 'paidout' === $this->data['status']; } /** * @return boolean */ public function isExpired() { return isset($this->data['status']) && 'expired' === $this->data['status']; } /** * @return mixed */ public function getTransactionReference() { if (isset($this->data['id'])) { return $this->data['id']; } } /** * @return mixed */ public function getTransactionId() { if (isset($this->data['metadata']['transactionId'])) { return $this->data['metadata']['transactionId']; } } /** * @return mixed */ public function getStatus() { if (isset($this->data['status'])) { return $this->data['status']; } } /** * @return mixed */ public function getAmount() { if (isset($this->data['amount'])) { return $this->data['amount']; } } /** * @return mixed */ public function getMetadata() { if (isset($this->data['metadata'])) { return $this->data['metadata']; } } } src/Message/PurchaseResponse.php 0000604 00000000536 15173220363 0012723 0 ustar 00 <?php namespace Omnipay\Mollie\Message; class PurchaseResponse extends FetchTransactionResponse { /** * When you do a `purchase` the request is never successful because * you need to redirect off-site to complete the purchase. * * {@inheritdoc} */ public function isSuccessful() { return false; } } src/Message/FetchIssuersRequest.php 0000604 00000001005 15173220363 0013402 0 ustar 00 <?php namespace Omnipay\Mollie\Message; /** * Mollie Fetch Issuers Request * * @method \Omnipay\Mollie\Message\FetchIssuersResponse send() */ class FetchIssuersRequest extends AbstractRequest { /** * @return null */ public function getData() { $this->validate('apiKey'); } public function sendData($data) { $httpResponse = $this->sendRequest('GET', '/issuers'); return $this->response = new FetchIssuersResponse($this, $httpResponse->json()); } } src/Message/AbstractRequest.php 0000604 00000002500 15173220363 0012537 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Guzzle\Common\Event; abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest { protected $endpoint = 'https://api.mollie.nl/v1'; public function getApiKey() { return $this->getParameter('apiKey'); } public function setApiKey($value) { return $this->setParameter('apiKey', $value); } public function setTransactionId($value) { return $this->setParameter('transactionId', $value); } public function getTransactionId() { return $this->getParameter('transactionId'); } protected function sendRequest($method, $endpoint, $data = null) { $this->httpClient->getEventDispatcher()->addListener('request.error', function (Event $event) { /** * @var \Guzzle\Http\Message\Response $response */ $response = $event['response']; if ($response->isError()) { $event->stopPropagation(); } }); $httpRequest = $this->httpClient->createRequest( $method, $this->endpoint . $endpoint, array( 'Authorization' => 'Bearer ' . $this->getApiKey() ), $data ); return $httpRequest->send(); } } src/Message/FetchPaymentMethodsRequest.php 0000604 00000001041 15173220363 0014706 0 ustar 00 <?php namespace Omnipay\Mollie\Message; /** * Mollie Fetch PaymentMethods Request * * @method \Omnipay\Mollie\Message\FetchPaymentMethodsResponse send() */ class FetchPaymentMethodsRequest extends AbstractRequest { /** * @return null */ public function getData() { $this->validate('apiKey'); } public function sendData($data) { $httpResponse = $this->sendRequest('GET', '/methods'); return $this->response = new FetchPaymentMethodsResponse($this, $httpResponse->json()); } } src/Message/AbstractResponse.php 0000604 00000000601 15173220363 0012705 0 ustar 00 <?php namespace Omnipay\Mollie\Message; class AbstractResponse extends \Omnipay\Common\Message\AbstractResponse { public function isSuccessful() { return !$this->isRedirect() && !isset($this->data['error']); } public function getMessage() { if (isset($this->data['error'])) { return $this->data['error']['message']; } } } src/Message/CompletePurchaseRequest.php 0000604 00000001647 15173220363 0014252 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Common\Exception\InvalidRequestException; /** * Mollie Complete Purchase Request * * @method \Omnipay\Mollie\Message\CompletePurchaseResponse send() */ class CompletePurchaseRequest extends FetchTransactionRequest { public function getData() { $this->validate('apiKey'); $data = array(); $data['id'] = $this->getTransactionReference(); if (!isset($data['id'])) { $data['id'] = $this->httpRequest->request->get('id'); } if (empty($data['id'])) { throw new InvalidRequestException("The transactionReference parameter is required"); } return $data; } public function sendData($data) { $httpResponse = $this->sendRequest('GET', '/payments/' . $data['id']); return $this->response = new CompletePurchaseResponse($this, $httpResponse->json()); } } src/Message/CompletePurchaseResponse.php 0000604 00000000374 15173220363 0014414 0 ustar 00 <?php namespace Omnipay\Mollie\Message; class CompletePurchaseResponse extends FetchTransactionResponse { /** * {@inheritdoc} */ public function isSuccessful() { return parent::isSuccessful() && $this->isPaid(); } } src/Message/FetchTransactionRequest.php 0000604 00000001202 15173220363 0014231 0 ustar 00 <?php namespace Omnipay\Mollie\Message; /** * Mollie Fetch Transaction Request * * @method \Omnipay\Mollie\Message\FetchTransactionResponse send() */ class FetchTransactionRequest extends AbstractRequest { public function getData() { $this->validate('apiKey', 'transactionReference'); $data = array(); $data['id'] = $this->getTransactionReference(); return $data; } public function sendData($data) { $httpResponse = $this->sendRequest('GET', '/payments/' . $data['id']); return $this->response = new FetchTransactionResponse($this, $httpResponse->json()); } } src/Message/FetchIssuersResponse.php 0000604 00000001231 15173220363 0013551 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Common\Issuer; use Omnipay\Common\Message\FetchIssuersResponseInterface; class FetchIssuersResponse extends AbstractResponse implements FetchIssuersResponseInterface { /** * Return available issuers as an associative array. * * @return \Omnipay\Common\Issuer[] */ public function getIssuers() { if (isset($this->data['data'])) { $issuers = array(); foreach ($this->data['data'] as $issuer) { $issuers[] = new Issuer($issuer['id'], $issuer['name'], $issuer['method']); } return $issuers; } } } src/Gateway.php 0000604 00000004552 15173220363 0007451 0 ustar 00 <?php namespace Omnipay\Mollie; use Omnipay\Common\AbstractGateway; /** * Mollie (iDeal) Gateway * * @link https://www.mollie.nl/files/documentatie/payments-api.html */ class Gateway extends AbstractGateway { /** * @return string */ public function getName() { return 'Mollie'; } /** * @return array */ public function getDefaultParameters() { return array( 'apiKey' => '' ); } /** * @return string */ public function getApiKey() { return $this->getParameter('apiKey'); } /** * @param string $value * @return $this */ public function setApiKey($value) { return $this->setParameter('apiKey', $value); } /** * @param array $parameters * @return \Omnipay\Mollie\Message\FetchIssuersRequest */ public function fetchIssuers(array $parameters = array()) { return $this->createRequest('\Omnipay\Mollie\Message\FetchIssuersRequest', $parameters); } /** * @param array $parameters * @return \Omnipay\Mollie\Message\FetchPaymentMethodsRequest */ public function fetchPaymentMethods(array $parameters = array()) { return $this->createRequest('\Omnipay\Mollie\Message\FetchPaymentMethodsRequest', $parameters); } /** * @param array $parameters * @return \Omnipay\Mollie\Message\FetchTransactionRequest */ public function fetchTransaction(array $parameters = array()) { return $this->createRequest('\Omnipay\Mollie\Message\FetchTransactionRequest', $parameters); } /** * @param array $parameters * @return \Omnipay\Mollie\Message\PurchaseRequest */ public function purchase(array $parameters = array()) { return $this->createRequest('\Omnipay\Mollie\Message\PurchaseRequest', $parameters); } /** * @param array $parameters * @return \Omnipay\Mollie\Message\CompletePurchaseRequest */ public function completePurchase(array $parameters = array()) { return $this->createRequest('\Omnipay\Mollie\Message\CompletePurchaseRequest', $parameters); } } .travis.yml 0000604 00000000317 15173220364 0006655 0 ustar 00 language: php php: - 5.3 - 5.4 - 5.5 - 5.6 - hhvm before_script: - composer install -n --dev --prefer-source script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text .gitignore 0000604 00000000060 15173220364 0006527 0 ustar 00 /vendor composer.lock composer.phar phpunit.xml composer.json 0000604 00000001636 15173220364 0007273 0 ustar 00 { "name": "omnipay/mollie", "type": "library", "description": "Mollie driver for the Omnipay payment processing library", "keywords": [ "gateway", "merchant", "mollie", "omnipay", "pay", "payment" ], "homepage": "https://github.com/thephpleague/omnipay-mollie", "license": "MIT", "authors": [ { "name": "Adrian Macneil", "email": "adrian@adrianmacneil.com" }, { "name": "Omnipay Contributors", "homepage": "https://github.com/thephpleague/omnipay-mollie/contributors" } ], "autoload": { "psr-4": { "Omnipay\\Mollie\\" : "src/" } }, "require": { "omnipay/common": "~2.2" }, "require-dev": { "omnipay/tests": "~2.0" }, "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } } } tests/Mock/FetchTransactionFailure.txt 0000604 00000000737 15173220364 0014115 0 ustar 00 HTTP/1.1 404 Not Found Server: nginx/1.4.4 Date: Mon, 20 Jan 2014 10:13:03 GMT Content-Type: application/json; charset=utf-8 Content-Length: 83 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains { "error":{ "type":"request", "message":"The payment id is invalid" } } tests/Mock/PurchaseSuccess.txt 0000604 00000001365 15173220364 0012447 0 ustar 00 HTTP/1.1 201 Created Server: nginx/1.4.4 Date: Sun, 19 Jan 2014 11:41:55 GMT Content-Type: application/json; charset=utf-8 Content-Length: 344 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains X-Whom: dc1-web-2 { "id":"tr_Qzin4iTWrU", "mode":"test", "createdDatetime":"2014-01-19T11:41:55.0Z", "status":"open", "amount":"100.00", "description":"Description", "method":"ideal", "metadata":"meta", "details":null, "links":{ "paymentUrl":"https://www.mollie.nl/payscreen/pay/Qzin4iTWrU", "redirectUrl":"http://www.google.nl" } } tests/Mock/PurchaseIssuerFailure.txt 0000604 00000001000 15173220364 0013603 0 ustar 00 HTTP/1.1 503 Service Temporarily Unavailable Server: nginx/1.4.4 Date: Mon, 20 Jan 2014 10:19:39 GMT Content-Type: application/json; charset=utf-8 Content-Length: 101 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains { "error":{ "type":"system", "message":"Issuer failure", "field":"issuer" } } tests/Mock/CompletePurchaseFailure.txt 0000604 00000000775 15173220364 0014123 0 ustar 00 HTTP/1.1 422 Unprocessable Entity Server: nginx/1.4.4 Date: Mon, 20 Jan 2014 10:19:39 GMT Content-Type: application/json; charset=utf-8 Content-Length: 101 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains { "error":{ "type":"request", "message":"The issuer is invalid", "field":"issuer" } } tests/Mock/FetchIssuersSuccess.txt 0000604 00000001060 15173220364 0013274 0 ustar 00 HTTP/1.1 200 OK Server: nginx/1.4.4 Date: Sun, 19 Jan 2014 11:28:09 GMT Content-Type: application/json; charset=utf-8 Content-Length: 152 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains X-Whom: dc1-web-2 { "totalCount":1, "offset":0, "count":1, "data":[ { "id":"ideal_TESTNL99", "name":"TBM Bank", "method":"ideal" } ] } tests/Mock/PurchaseSystemFailure.txt 0000604 00000001036 15173220364 0013626 0 ustar 00 HTTP/1.1 503 Service Temporarily Unavailable Server: nginx/1.4.4 Date: Mon, 20 Jan 2014 10:19:39 GMT Content-Type: application/json; charset=utf-8 Content-Length: 101 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains { "error":{ "type":"system", "message":"Payment platform for this payment method temporarily not available" } } tests/Mock/FetchPaymentMethodsFailure.txt 0000604 00000001120 15173220364 0014554 0 ustar 00 HTTP/1.1 401 Authorization Required Server: nginx/1.4.4 Date: Tue, 18 Mar 2014 20:44:58 GMT Content-Type: application/json; charset=utf-8 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains Www-Authenticate: Basic realm="Mollie API Key" { "error":{ "type":"request", "message":"Unauthorized request", "links":{ "documentation":"https://www.mollie.nl/api/docs/" } } } tests/Mock/FetchTransactionExpired.txt 0000604 00000001336 15173220364 0014122 0 ustar 00 HTTP/1.1 200 OK Server: nginx/1.4.4 Date: Sun, 19 Jan 2014 13:00:23 GMT Content-Type: application/json; charset=utf-8 Content-Length: 326 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains X-Whom: dc1-web-1 { "id":"tr_Qzin4iTWrU", "mode":"test", "createdDatetime":"2014-01-19T11:41:54.0Z", "status":"expired", "expiredDatetime":"2014-01-19T11:58:01.0Z", "amount":"100.00", "description":"Description", "method":"ideal", "metadata":"meta", "details":null, "links":{ "redirectUrl":"http://www.google.nl" } } tests/Mock/CompletePurchaseSuccess.txt 0000604 00000001442 15173220364 0014134 0 ustar 00 HTTP/1.1 200 OK Server: nginx/1.4.4 Date: Sun, 19 Jan 2014 12:48:09 GMT Content-Type: application/json; charset=utf-8 Content-Length: 394 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains X-Whom: dc1-web-2 { "id":"tr_Qzin4iTWrU", "mode":"test", "createdDatetime":"2014-01-19T11:41:55.0Z", "status":"paid", "paidDatetime":"2014-01-19T12:47:46.0Z", "amount":"100.00", "description":"Description", "method":"ideal", "metadata":"meta", "details":{ "consumerName":"T. TEST", "consumerAccount":"NL17RABO0213698412" }, "links":{ "redirectUrl":"http://www.google.nl" } } tests/Mock/FetchIssuersFailure.txt 0000604 00000001144 15173220364 0013256 0 ustar 00 HTTP/1.1 401 Authorization Required Server: nginx/1.4.4 Date: Mon, 20 Jan 2014 10:04:18 GMT Content-Type: application/json; charset=utf-8 Content-Length: 155 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains Www-Authenticate: Basic realm="Mollie API Key" { "error":{ "type":"request", "message":"Unauthorized request", "links":{ "documentation":"https://www.mollie.nl/api/docs/" } } } tests/Mock/FetchPaymentMethodsSuccess.txt 0000604 00000003424 15173220364 0014606 0 ustar 00 HTTP/1.1 200 OK Server: nginx/1.4.4 Date: Tue, 18 Mar 2014 20:44:01 GMT Content-Type: application/json; charset=utf-8 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains X-Whom: dc1-web-1 { "totalCount":4, "offset":0, "count":4, "data":[ { "id":"ideal", "description":"iDEAL", "amount":{ "minimum":"0.43", "maximum":"50000.00" }, "image":{ "normal":"https://www.mollie.nl/images/payscreen/methods/ideal.png", "bigger":"https://www.mollie.nl/images/payscreen/methods/ideal@2x.png" } }, { "id":"creditcard", "description":"Creditcard", "amount":{ "minimum":"0.32", "maximum":"10000.00" }, "image":{ "normal":"https://www.mollie.nl/images/payscreen/methods/creditcard.png", "bigger":"https://www.mollie.nl/images/payscreen/methods/creditcard@2x.png" } }, { "id":"mistercash", "description":"Mister Cash", "amount":{ "minimum":"0.31", "maximum":"10000.00" }, "image":{ "normal":"https://www.mollie.nl/images/payscreen/methods/mistercash.png", "bigger":"https://www.mollie.nl/images/payscreen/methods/mistercash@2x.png" } }, { "id":"banktransfer", "description":"Bank transfer", "amount":{ "minimum":"0.31", "maximum":"50000.00" }, "image":{ "normal":"https://www.mollie.nl/images/payscreen/methods/banktransfer.png", "bigger":"https://www.mollie.nl/images/payscreen/methods/banktransfer@2x.png" } } ] } tests/Mock/CompletePurchaseExpired.txt 0000604 00000001336 15173220364 0014126 0 ustar 00 HTTP/1.1 200 OK Server: nginx/1.4.4 Date: Sun, 19 Jan 2014 13:00:23 GMT Content-Type: application/json; charset=utf-8 Content-Length: 326 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains X-Whom: dc1-web-1 { "id":"tr_Qzin4iTWrU", "mode":"test", "createdDatetime":"2014-01-19T11:41:54.0Z", "status":"expired", "expiredDatetime":"2014-01-19T11:58:01.0Z", "amount":"100.00", "description":"Description", "method":"ideal", "metadata":"meta", "details":null, "links":{ "redirectUrl":"http://www.google.nl" } } tests/Mock/FetchTransactionSuccess.txt 0000604 00000001442 15173220364 0014130 0 ustar 00 HTTP/1.1 200 OK Server: nginx/1.4.4 Date: Sun, 19 Jan 2014 12:48:09 GMT Content-Type: application/json; charset=utf-8 Content-Length: 394 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains X-Whom: dc1-web-2 { "id":"tr_Qzin4iTWrU", "mode":"test", "createdDatetime":"2014-01-19T11:41:55.0Z", "status":"paid", "paidDatetime":"2014-01-19T12:47:46.0Z", "amount":"100.00", "description":"Description", "method":"ideal", "metadata":"meta", "details":{ "consumerName":"T. TEST", "consumerAccount":"NL17RABO0213698412" }, "links":{ "redirectUrl":"http://www.google.nl" } } tests/Mock/PurchaseFailure.txt 0000604 00000000775 15173220364 0012432 0 ustar 00 HTTP/1.1 422 Unprocessable Entity Server: nginx/1.4.4 Date: Mon, 20 Jan 2014 10:19:39 GMT Content-Type: application/json; charset=utf-8 Content-Length: 101 Connection: keep-alive Access-Control-Allow-Credentials: true Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS, DELETE Access-Control-Max-Age: 300 Cache-Control: no-cache, no-store Strict-Transport-Security: max-age=31556926; includeSubDomains { "error":{ "type":"request", "message":"The issuer is invalid", "field":"issuer" } } tests/Message/CompletePurchaseRequestTest.php 0000604 00000005233 15173220364 0015461 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Tests\TestCase; class CompletePurchaseRequestTest extends TestCase { /** * @var \Omnipay\Mollie\Message\CompletePurchaseRequest */ protected $request; public function setUp() { $this->request = new CompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize(array( 'apiKey' => 'mykey', )); $this->getHttpRequest()->request->replace(array( 'id' => 'tr_Qzin4iTWrU', )); } /** * @expectedException \Omnipay\Common\Exception\InvalidRequestException * @expectedExceptionMessage The transactionReference parameter is required */ public function testGetDataWithoutIDParameter() { $this->getHttpRequest()->request->remove('id'); $data = $this->request->getData(); $this->assertEmpty($data); } public function testGetData() { $data = $this->request->getData(); $this->assertSame("tr_Qzin4iTWrU", $data['id']); $this->assertCount(1, $data); } public function testSendSuccess() { $this->setMockHttpResponse('CompletePurchaseSuccess.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\CompletePurchaseResponse', $response); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isOpen()); $this->assertTrue($response->isPaid()); $this->assertFalse($response->isRedirect()); $this->assertSame('tr_Qzin4iTWrU', $response->getTransactionReference()); } public function testSendExpired() { $this->setMockHttpResponse('CompletePurchaseExpired.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\CompletePurchaseResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isPaid()); $this->assertTrue($response->isExpired()); $this->assertFalse($response->isRedirect()); $this->assertSame('tr_Qzin4iTWrU', $response->getTransactionReference()); } public function testSendFailure() { $this->setMockHttpResponse('PurchaseFailure.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\CompletePurchaseResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertSame("The issuer is invalid", $response->getMessage()); } } tests/Message/FetchIssuersRequestTest.php 0000604 00000003275 15173220364 0014631 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Common\Issuer; use Omnipay\Tests\TestCase; class FetchIssuersRequestTest extends TestCase { /** * @var \Omnipay\Mollie\Message\FetchIssuersRequest */ protected $request; public function setUp() { $this->request = new FetchIssuersRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize(array( 'apiKey' => 'mykey' )); } public function testGetData() { $data = $this->request->getData(); $this->assertEmpty($data); } public function testSendSuccess() { $this->setMockHttpResponse('FetchIssuersSuccess.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchIssuersResponse', $response); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $expectedIssuer = new Issuer('ideal_TESTNL99', 'TBM Bank', 'ideal'); $this->assertEquals(array($expectedIssuer), $response->getIssuers()); } public function testSendFailure() { $this->setMockHttpResponse('FetchIssuersFailure.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchIssuersResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertSame('Unauthorized request', $response->getMessage()); $this->assertNull($response->getIssuers()); } } tests/Message/FetchPaymentMethodsRequestTest.php 0000604 00000003534 15173220364 0016133 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Common\PaymentMethod; use Omnipay\Tests\TestCase; class FetchPaymentMethodsRequestTest extends TestCase { /** * @var \Omnipay\Mollie\Message\FetchPaymentMethodsRequest */ protected $request; public function setUp() { $this->request = new FetchPaymentMethodsRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize(array( 'apiKey' => 'mykey' )); } public function testGetData() { $data = $this->request->getData(); $this->assertEmpty($data); } public function testSendSuccess() { $this->setMockHttpResponse('FetchPaymentMethodsSuccess.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchPaymentMethodsResponse', $response); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $paymentMethods = $response->getPaymentMethods(); $this->assertCount(4, $paymentMethods); $expectedPaymentMethod = new PaymentMethod('ideal', 'iDEAL'); $this->assertEquals($expectedPaymentMethod, $paymentMethods[0]); } public function testSendFailure() { $this->setMockHttpResponse('FetchPaymentMethodsFailure.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchPaymentMethodsResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertSame('Unauthorized request', $response->getMessage()); $this->assertNull($response->getPaymentMethods()); } } tests/Message/FetchTransactionRequestTest.php 0000604 00000004622 15173220364 0015456 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Tests\TestCase; class FetchTransactionRequestTest extends TestCase { /** * @var \Omnipay\Mollie\Message\FetchTransactionRequest */ protected $request; public function setUp() { $this->request = new FetchTransactionRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize(array( 'apiKey' => 'mykey', 'transactionReference' => 'tr_Qzin4iTWrU', )); } public function testGetData() { $data = $this->request->getData(); $this->assertSame("tr_Qzin4iTWrU", $data['id']); $this->assertCount(1, $data); } public function testSendSuccess() { $this->setMockHttpResponse('FetchTransactionSuccess.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchTransactionResponse', $response); $this->assertTrue($response->isSuccessful()); $this->assertTrue($response->isPaid()); $this->assertFalse($response->isCancelled()); $this->assertFalse($response->isPaidOut()); $this->assertFalse($response->isRedirect()); $this->assertSame("paid", $response->getStatus()); $this->assertSame('tr_Qzin4iTWrU', $response->getTransactionReference()); $this->assertSame("100.00", $response->getAmount()); } public function testSendExpired() { $this->setMockHttpResponse('FetchTransactionExpired.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchTransactionResponse', $response); $this->assertTrue($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertSame('tr_Qzin4iTWrU', $response->getTransactionReference()); $this->assertTrue($response->isExpired()); } public function testSendFailure() { $this->setMockHttpResponse('FetchTransactionFailure.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchTransactionResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertNull($response->getStatus()); $this->assertNull($response->getAmount()); } } tests/Message/PurchaseRequestTest.php 0000604 00000012262 15173220364 0013770 0 ustar 00 <?php namespace Omnipay\Mollie\Message; use Omnipay\Tests\TestCase; class PurchaseRequestTest extends TestCase { /** * * @var \Omnipay\Mollie\Message\PurchaseRequest */ protected $request; public function setUp() { $this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize(array( 'apiKey' => 'mykey', 'amount' => '12.00', 'issuer' => 'my bank', 'description' => 'Description', 'returnUrl' => 'https://www.example.com/return', 'method' => 'ideal', 'metadata' => 'meta' )); } public function testGetData() { $this->request->initialize(array( 'apiKey' => 'mykey', 'amount' => '12.00', 'description' => 'Description', 'returnUrl' => 'https://www.example.com/return', 'paymentMethod' => 'ideal', 'metadata' => 'meta', 'issuer' => 'my bank' )); $data = $this->request->getData(); $this->assertSame("12.00", $data['amount']); $this->assertSame('Description', $data['description']); $this->assertSame('https://www.example.com/return', $data['redirectUrl']); $this->assertSame('ideal', $data['method']); $this->assertSame('meta', $data['metadata']); $this->assertSame('my bank', $data['issuer']); $this->assertCount(6, $data); } public function testGetDataWithWebhook() { $this->request->initialize(array( 'apiKey' => 'mykey', 'amount' => '12.00', 'description' => 'Description', 'returnUrl' => 'https://www.example.com/return', 'paymentMethod' => 'ideal', 'metadata' => 'meta', 'issuer' => 'my bank', 'notifyUrl' => 'https://www.example.com/hook' )); $data = $this->request->getData(); $this->assertSame("12.00", $data['amount']); $this->assertSame('Description', $data['description']); $this->assertSame('https://www.example.com/return', $data['redirectUrl']); $this->assertSame('ideal', $data['method']); $this->assertSame('meta', $data['metadata']); $this->assertSame('my bank', $data['issuer']); $this->assertSame('https://www.example.com/hook', $data['webhookUrl']); $this->assertCount(7, $data); } public function testSendSuccess() { $this->setMockHttpResponse('PurchaseSuccess.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\PurchaseResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertTrue($response->isRedirect()); $this->assertSame('GET', $response->getRedirectMethod()); $this->assertSame('https://www.mollie.nl/payscreen/pay/Qzin4iTWrU', $response->getRedirectUrl()); $this->assertNull($response->getRedirectData()); $this->assertSame('tr_Qzin4iTWrU', $response->getTransactionReference()); $this->assertTrue($response->isOpen()); $this->assertFalse($response->isPaid()); $this->assertNull($response->getCode()); $this->assertNull($response->getMessage()); } public function testSendFailure() { $this->setMockHttpResponse('PurchaseFailure.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\PurchaseResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertNull($response->getRedirectUrl()); $this->assertNull($response->getRedirectData()); $this->assertSame("The issuer is invalid", $response->getMessage()); } public function testIssuerFailure() { $this->setMockHttpResponse('PurchaseIssuerFailure.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\PurchaseResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertNull($response->getRedirectUrl()); $this->assertNull($response->getRedirectData()); $this->assertSame("Issuer failure", $response->getMessage()); } public function testSystemFailure() { $this->setMockHttpResponse('PurchaseSystemFailure.txt'); $response = $this->request->send(); $this->assertInstanceOf('Omnipay\Mollie\Message\PurchaseResponse', $response); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); $this->assertNull($response->getTransactionReference()); $this->assertNull($response->getRedirectUrl()); $this->assertNull($response->getRedirectData()); $this->assertSame("Payment platform for this payment method temporarily not available", $response->getMessage()); } } tests/GatewayTest.php 0000604 00000003254 15173220364 0010663 0 ustar 00 <?php namespace Omnipay\Mollie; use Omnipay\Tests\GatewayTestCase; class GatewayTest extends GatewayTestCase { /** * @var \Omnipay\Mollie\Gateway */ protected $gateway; public function setUp() { parent::setUp(); $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); } public function testFetchIssuers() { $request = $this->gateway->fetchIssuers(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchIssuersRequest', $request); } public function testFetchPaymentMethods() { $request = $this->gateway->fetchPaymentMethods(); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchPaymentMethodsRequest', $request); } public function testPurchase() { $request = $this->gateway->purchase(array('amount' => '10.00')); $this->assertInstanceOf('Omnipay\Mollie\Message\PurchaseRequest', $request); $this->assertSame('10.00', $request->getAmount()); } public function testPurchaseReturn() { $request = $this->gateway->completePurchase(array('amount' => '10.00')); $this->assertInstanceOf('Omnipay\Mollie\Message\CompletePurchaseRequest', $request); $this->assertSame('10.00', $request->getAmount()); } public function testFetchTransaction() { $request = $this->gateway->fetchTransaction(array( 'apiKey' => 'key', 'transactionReference' => 'tr_Qzin4iTWrU' )); $this->assertInstanceOf('Omnipay\Mollie\Message\FetchTransactionRequest', $request); $data = $request->getData(); $this->assertSame('tr_Qzin4iTWrU', $data['id']); } } CONTRIBUTING.md 0000604 00000001040 15173220364 0006767 0 ustar 00 # Contributing Guidelines * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. * Commit just the modifications, do not mess with the composer.json or CHANGELOG.md files. * Ensure your code is nicely formatted in the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) style and that all tests pass. * Send the pull request. * Check that the Travis CI build passed. If not, rinse and repeat. phpunit.xml.dist 0000604 00000001512 15173220364 0007715 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" syntaxCheck="false"> <testsuites> <testsuite name="Omnipay Test Suite"> <directory>./tests/</directory> </testsuite> </testsuites> <listeners> <listener class="Mockery\Adapter\Phpunit\TestListener" file="vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php" /> </listeners> <filter> <whitelist> <directory>./src</directory> </whitelist> </filter> </phpunit> LICENSE 0000604 00000002047 15173220364 0005553 0 ustar 00 Copyright (c) 2012-2013 Adrian Macneil 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. README.md 0000604 00000003503 15173220364 0006023 0 ustar 00 # Omnipay: Mollie **Mollie driver for the Omnipay PHP payment processing library** [](https://travis-ci.org/thephpleague/omnipay-mollie) [](https://packagist.org/packages/omnipay/mollie) [](https://packagist.org/packages/omnipay/mollie) [Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Mollie support for Omnipay. ## Installation Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file: ```json { "require": { "omnipay/mollie": "~3.0" } } ``` And run composer to update your dependencies: $ curl -s http://getcomposer.org/installer | php $ php composer.phar update ## Basic Usage The following gateways are provided by this package: * Mollie For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay) repository. ## Support If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found. If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to. If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/thephpleague/omnipay-mollie/issues), or better yet, fork the library and submit a pull request.
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings