From 76b6d0ee43b3321e7ad59ad8d76bffb04cbb7bd5 Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Thu, 11 Sep 2014 07:39:21 +0000 Subject: [PATCH 01/41] master is 0.12. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d0e2cd7..357e477 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "0.11.*" + "payum/core": "0.12.*@dev" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", @@ -39,7 +39,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.11-dev" + "dev-master": "0.12-dev" } }, "config": { From 854bdd465d3ce6b3ea8b9033a696013b2edab60d Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Wed, 29 Oct 2014 21:21:47 +0000 Subject: [PATCH 02/41] fixes --- src/Payum/PayumModule/Controller/AuthorizeController.php | 5 ++--- src/Payum/PayumModule/Controller/CaptureController.php | 4 ++-- src/Payum/PayumModule/Controller/NotifyController.php | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Payum/PayumModule/Controller/AuthorizeController.php b/src/Payum/PayumModule/Controller/AuthorizeController.php index b223c52..5a68c2b 100644 --- a/src/Payum/PayumModule/Controller/AuthorizeController.php +++ b/src/Payum/PayumModule/Controller/AuthorizeController.php @@ -4,8 +4,7 @@ use Payum\Core\Reply\HttpRedirect; use Payum\Core\Reply\HttpResponse; use Payum\Core\Reply\ReplyInterface; -use Payum\Core\Request\SecuredAuthorize; -use Payum\Core\Request\SecuredCapture; +use Payum\Core\Request\Authorize; use Zend\Http\Response; class AuthorizeController extends PayumController @@ -17,7 +16,7 @@ public function doAction() $payment = $this->getPayum()->getPayment($token->getPaymentName()); try { - $payment->execute(new SecuredAuthorize($token)); + $payment->execute(new Authorize($token)); } catch (ReplyInterface $reply) { if ($reply instanceof HttpRedirect) { $this->redirect()->toUrl($reply->getUrl()); diff --git a/src/Payum/PayumModule/Controller/CaptureController.php b/src/Payum/PayumModule/Controller/CaptureController.php index 17b03d5..654bcf5 100644 --- a/src/Payum/PayumModule/Controller/CaptureController.php +++ b/src/Payum/PayumModule/Controller/CaptureController.php @@ -4,7 +4,7 @@ use Payum\Core\Reply\HttpRedirect; use Payum\Core\Reply\HttpResponse; use Payum\Core\Reply\ReplyInterface; -use Payum\Core\Request\SecuredCapture; +use Payum\Core\Request\Capture; use Zend\Http\Response; class CaptureController extends PayumController @@ -16,7 +16,7 @@ public function doAction() $payment = $this->getPayum()->getPayment($token->getPaymentName()); try { - $payment->execute(new SecuredCapture($token)); + $payment->execute(new Capture($token)); } catch (ReplyInterface $reply) { if ($reply instanceof HttpRedirect) { $this->redirect()->toUrl($reply->getUrl()); diff --git a/src/Payum/PayumModule/Controller/NotifyController.php b/src/Payum/PayumModule/Controller/NotifyController.php index ce5283d..8b6aba4 100644 --- a/src/Payum/PayumModule/Controller/NotifyController.php +++ b/src/Payum/PayumModule/Controller/NotifyController.php @@ -1,7 +1,7 @@ getPayum()->getPayment($token->getPaymentName()); - $payment->execute(new SecuredNotify($_REQUEST, $token)); + $payment->execute(new Notify($token)); $this->getResponse()->setStatusCode(204); } From a843b99da6a8114de1c5ef285b0d2af476088218 Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Wed, 29 Oct 2014 21:21:52 +0000 Subject: [PATCH 03/41] Release 0.12.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 357e477..6a73559 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "0.12.*@dev" + "payum/core": "0.12.*" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", From c324588980df94f273b8d9975abb8cd185d2053d Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Wed, 29 Oct 2014 21:22:26 +0000 Subject: [PATCH 04/41] master is 0.13 now. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 6a73559..adc9e9f 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "0.12.*" + "payum/core": "0.13.*@dev" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", @@ -39,7 +39,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.12-dev" + "dev-master": "0.13-dev" } }, "config": { From a2290fabd5d7df0b42f9ac40a51d6b196043eab4 Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Thu, 1 Jan 2015 18:15:39 +0000 Subject: [PATCH 05/41] Release 0.13.0 --- config/module.config.routes.php | 13 ++++++ config/service/controller.config.php | 14 +++++++ docs/get-it-started.md | 8 ++-- .../Controller/RefundController.php | 41 +++++++++++++++++++ .../Security/HttpRequestVerifier.php | 4 +- .../Security/TokenFactoryFactory.php | 3 +- 6 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 src/Payum/PayumModule/Controller/RefundController.php diff --git a/config/module.config.routes.php b/config/module.config.routes.php index d3f42d0..de9a8fe 100644 --- a/config/module.config.routes.php +++ b/config/module.config.routes.php @@ -41,6 +41,19 @@ ), ), ), + 'payum_refund_do' => array( + 'type' => 'Segment', + 'options' => array( + 'route' => '/payment/refund[/:payum_token]', + 'constraints' => array( + 'payum_token' => '[a-zA-Z0-9]+' + ), + 'defaults' => array( + 'controller' => 'PayumRefund', + 'action' => 'do' + ), + ), + ), ), ), ); diff --git a/config/service/controller.config.php b/config/service/controller.config.php index 25d20e0..5c9b4ad 100644 --- a/config/service/controller.config.php +++ b/config/service/controller.config.php @@ -2,6 +2,8 @@ use Payum\PayumModule\Controller\AuthorizeController; use Payum\PayumModule\Controller\CaptureController; +use Payum\PayumModule\Controller\NotifyController; +use Payum\PayumModule\Controller\RefundController; return array( 'factories' => array( @@ -17,5 +19,17 @@ // Construct Authorize controller with required Payum Registry and HttpRequestVerifier dependencies. return new AuthorizeController($sm->get('payum'), $sm->get('payum.security.http_request_verifier')); }, + 'PayumNotify' => function ($cm) { + $sm = $cm->getServiceLocator(); + + // Construct Capture controller with required Payum Registry and HttpRequestVerifier dependencies. + return new NotifyController($sm->get('payum'), $sm->get('payum.security.http_request_verifier')); + }, + 'PayumRefund' => function ($cm) { + $sm = $cm->getServiceLocator(); + + // Construct Capture controller with required Payum Registry and HttpRequestVerifier dependencies. + return new RefundController($sm->get('payum'), $sm->get('payum.security.http_request_verifier')); + }, ), ); \ No newline at end of file diff --git a/docs/get-it-started.md b/docs/get-it-started.md index a85447f..7b5ef72 100644 --- a/docs/get-it-started.md +++ b/docs/get-it-started.md @@ -82,7 +82,7 @@ return array( 'hash' ), 'payments' => array( - 'paypal_es' => PaymentFactory::create(new Api(new Curl(), array( + 'paypal_ec' => PaymentFactory::create(new Api(new Curl(), array( 'username' => 'REPLACE WITH YOURS', 'password' => 'REPLACE WITH YOURS', 'signature' => 'REPLACE WITH YOURS', @@ -112,16 +112,16 @@ class IndexController extends AbstractActionController { $storage = $this->getServiceLocator()->get('payum')->getStorage('Application\Model\PaymentDetails'); - $details = $storage->createModel(); + $details = $storage->create(); $details['PAYMENTREQUEST_0_CURRENCYCODE'] = 'EUR'; $details['PAYMENTREQUEST_0_AMT'] = 1.23; - $storage->updateModel($details); + $storage->update($details); // FIXIT: I dont know how to inject controller plugin to the service. $this->getServiceLocator()->get('payum.security.token_factory')->setUrlPlugin($this->url()); $captureToken = $this->getServiceLocator()->get('payum.security.token_factory')->createCaptureToken( - 'paypal_es', $details, 'payment_done' + 'paypal_ec', $details, 'payment_done' ); $this->redirect()->toUrl($captureToken->getTargetUrl()); diff --git a/src/Payum/PayumModule/Controller/RefundController.php b/src/Payum/PayumModule/Controller/RefundController.php new file mode 100644 index 0000000..884bf9b --- /dev/null +++ b/src/Payum/PayumModule/Controller/RefundController.php @@ -0,0 +1,41 @@ +getHttpRequestVerifier()->verify($this->getRequest()); + $this->getHttpRequestVerifier()->invalidate($token); + + $payment = $this->getPayum()->getPayment($token->getPaymentName()); + + try { + $payment->execute(new Refund($token)); + } catch (ReplyInterface $reply) { + if ($reply instanceof HttpRedirect) { + $this->redirect()->toUrl($reply->getUrl()); + } + + if ($reply instanceof HttpResponse) { + $this->getResponse()->setContent($reply->getContent()); + + $response = new Response(); + $response->setStatusCode(200); + $response->setContent($reply->getContent()); + + return $response; + } + + throw new \LogicException('Unsupported reply', null, $reply); + } + + $this->redirect()->toUrl($token->getAfterUrl()); + } +} \ No newline at end of file diff --git a/src/Payum/PayumModule/Security/HttpRequestVerifier.php b/src/Payum/PayumModule/Security/HttpRequestVerifier.php index ac92d12..8908ad4 100644 --- a/src/Payum/PayumModule/Security/HttpRequestVerifier.php +++ b/src/Payum/PayumModule/Security/HttpRequestVerifier.php @@ -45,7 +45,7 @@ public function verify($httpRequest) if ($hash instanceof Token) { $token = $hash; } else { - if (false == $token = $this->tokenStorage->findModelById($hash)) { + if (false == $token = $this->tokenStorage->find($hash)) { //TODO here again should be 404 throw new InvalidArgumentException(sprintf('A token with hash `%s` could not be found.', $hash)); } @@ -68,6 +68,6 @@ public function verify($httpRequest) */ public function invalidate(TokenInterface $token) { - $this->tokenStorage->deleteModel($token); + $this->tokenStorage->delete($token); } } \ No newline at end of file diff --git a/src/Payum/PayumModule/Security/TokenFactoryFactory.php b/src/Payum/PayumModule/Security/TokenFactoryFactory.php index 0a86ba3..57d748e 100644 --- a/src/Payum/PayumModule/Security/TokenFactoryFactory.php +++ b/src/Payum/PayumModule/Security/TokenFactoryFactory.php @@ -16,7 +16,8 @@ public function createService(ServiceLocatorInterface $serviceLocator) $serviceLocator->get('payum'), 'payum_capture_do', 'payum_notify_do', - 'payum_authorize_do' + 'payum_authorize_do', + 'payum_refund_do' ); } } \ No newline at end of file From 2d8c01a00e6805691cbaebdf615b766658d2303c Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Thu, 1 Jan 2015 18:18:06 +0000 Subject: [PATCH 06/41] master is 0.14-dev now --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index adc9e9f..799fe5f 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "0.13.*@dev" + "payum/core": "0.14.*@dev" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", @@ -39,7 +39,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.13-dev" + "dev-master": "0.14-dev" } }, "config": { From 19596d75a95e02b9925e99f99c4e78389ac9d1da Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Thu, 1 Jan 2015 18:21:13 +0000 Subject: [PATCH 07/41] update docs. --- docs/get-it-started.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/get-it-started.md b/docs/get-it-started.md index 7b5ef72..3709598 100644 --- a/docs/get-it-started.md +++ b/docs/get-it-started.md @@ -74,6 +74,8 @@ use Payum\Paypal\ExpressCheckout\Nvp\PaymentFactory; $detailsClass = 'Application\Model\PaymentDetails'; +$paypalExpressCheckoutPaymentFactory = new \Payum\Paypal\ExpressCheckout\Nvp\PaymentFactory(); + return array( 'payum' => array( 'token_storage' => new FilesystemStorage( @@ -82,12 +84,12 @@ return array( 'hash' ), 'payments' => array( - 'paypal_ec' => PaymentFactory::create(new Api(new Curl(), array( - 'username' => 'REPLACE WITH YOURS', - 'password' => 'REPLACE WITH YOURS', - 'signature' => 'REPLACE WITH YOURS', + 'paypal_ec' => $paypalExpressCheckoutPaymentFactory->create(array( + 'username' => 'EDIT ME', + 'password' => 'EDIT ME', + 'signature' => 'EDIT ME', 'sandbox' => true - ))) + )), ), 'storages' => array( $detailsClass => new FilesystemStorage(__DIR__.'/../../data', $detailsClass, 'id'), From 805f80c5b2080d543166a50812bbe00e1f33d865 Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Mon, 23 Feb 2015 20:14:08 +0000 Subject: [PATCH 08/41] fixes. --- .../PayumModule/Registry/RegistryFactory.php | 2 +- .../PayumModule/Security/TokenFactory.php | 4 ++-- .../Security/TokenFactoryFactory.php | 21 +++++++++++++------ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/Payum/PayumModule/Registry/RegistryFactory.php b/src/Payum/PayumModule/Registry/RegistryFactory.php index a74c05c..885054f 100644 --- a/src/Payum/PayumModule/Registry/RegistryFactory.php +++ b/src/Payum/PayumModule/Registry/RegistryFactory.php @@ -19,7 +19,7 @@ public function createService(ServiceLocatorInterface $serviceLocator) $registry = new ServiceLocatorAwareRegistry( $options->getPayments(), $options->getStorages(), - null + [] ); $getHttpRequestAction = new GetHttpRequestAction($serviceLocator); diff --git a/src/Payum/PayumModule/Security/TokenFactory.php b/src/Payum/PayumModule/Security/TokenFactory.php index 3810f04..eb4ff2a 100644 --- a/src/Payum/PayumModule/Security/TokenFactory.php +++ b/src/Payum/PayumModule/Security/TokenFactory.php @@ -1,10 +1,10 @@ get('ControllerPluginManager'); + + $tokenFactory = new TokenFactory( $serviceLocator->get('payum.security.token_storage'), - $serviceLocator->get('payum'), - 'payum_capture_do', - 'payum_notify_do', - 'payum_authorize_do', - 'payum_refund_do' + $serviceLocator->get('payum') ); + $tokenFactory->setUrlPlugin($plugins->get('url')); + + return new GenericTokenFactory($tokenFactory, array( + 'capture' => 'payum_capture_do', + 'notify' => 'payum_notify_do', + 'authorize' => 'payum_authorize_do', + 'refund' => 'payum_refund_do' + )); } } \ No newline at end of file From 1d7efcaba6527d75d53e5db63feff7956b792f8b Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Mon, 23 Feb 2015 20:14:45 +0000 Subject: [PATCH 09/41] Release 0.14.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 799fe5f..0ace764 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "0.14.*@dev" + "payum/core": "0.14.*" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", From ac39be9f0730bfca3a38c87b532d096a42c4cd33 Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Mon, 23 Feb 2015 20:15:35 +0000 Subject: [PATCH 10/41] master is 0.15 dev. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0ace764..ef8d513 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "0.14.*" + "payum/core": "0.15.*@dev" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", @@ -39,7 +39,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.14-dev" + "dev-master": "0.15-dev" } }, "config": { From a9a64afa1369678a93666fa0b2807b06eec89cc2 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Wed, 11 Mar 2015 12:25:31 +0200 Subject: [PATCH 11/41] Update RegistryFactory.php no more fata lerror on service locator call from payments --- src/Payum/PayumModule/Registry/RegistryFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Payum/PayumModule/Registry/RegistryFactory.php b/src/Payum/PayumModule/Registry/RegistryFactory.php index 885054f..2bc6f64 100644 --- a/src/Payum/PayumModule/Registry/RegistryFactory.php +++ b/src/Payum/PayumModule/Registry/RegistryFactory.php @@ -21,14 +21,14 @@ public function createService(ServiceLocatorInterface $serviceLocator) $options->getStorages(), [] ); + + //TODO: quick fix. we should avoid early init of services. has to be reworked to be lazy + $registry->setServiceLocator($serviceLocator); $getHttpRequestAction = new GetHttpRequestAction($serviceLocator); foreach ($registry->getPayments() as $payment) { $payment->addAction($getHttpRequestAction); } - - //TODO: quick fix. we should avoid early init of services. has to be reworked to be lazy - $registry->setServiceLocator($serviceLocator); return $registry; } From 80ed823bbd903fdf88b8ef3349cf38d218572ff9 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 14:19:59 +0200 Subject: [PATCH 12/41] Update get-it-started.md no required anymore --- docs/get-it-started.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/get-it-started.md b/docs/get-it-started.md index 3709598..191dd06 100644 --- a/docs/get-it-started.md +++ b/docs/get-it-started.md @@ -119,9 +119,6 @@ class IndexController extends AbstractActionController $details['PAYMENTREQUEST_0_AMT'] = 1.23; $storage->update($details); - // FIXIT: I dont know how to inject controller plugin to the service. - $this->getServiceLocator()->get('payum.security.token_factory')->setUrlPlugin($this->url()); - $captureToken = $this->getServiceLocator()->get('payum.security.token_factory')->createCaptureToken( 'paypal_ec', $details, 'payment_done' ); From a0a21e68924fc58e6623c3f5083872d5e6575e0a Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 15:36:54 +0200 Subject: [PATCH 13/41] Update TokenFactory.php token not replaced in route --- src/Payum/PayumModule/Security/TokenFactory.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Payum/PayumModule/Security/TokenFactory.php b/src/Payum/PayumModule/Security/TokenFactory.php index eb4ff2a..138f9ce 100644 --- a/src/Payum/PayumModule/Security/TokenFactory.php +++ b/src/Payum/PayumModule/Security/TokenFactory.php @@ -27,9 +27,6 @@ public function setUrlPlugin(Url $urlPlugin) */ protected function generateUrl($path, array $parameters = array()) { - return $this->urlPlugin->fromRoute($path, array(), array( - 'force_canonical' => true, - 'query' => $parameters - )); + return $this->urlPlugin->fromRoute($path, $parameters, array('force_canonical' => true)); } -} \ No newline at end of file +} From a448b3ec2c8a42961211445fde5939ca2fd9c7e9 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 15:58:23 +0200 Subject: [PATCH 14/41] Update module.config.routes.php constrains --- config/module.config.routes.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/module.config.routes.php b/config/module.config.routes.php index de9a8fe..f55aa2d 100644 --- a/config/module.config.routes.php +++ b/config/module.config.routes.php @@ -7,7 +7,7 @@ 'options' => array( 'route' => '/payment/capture[/:payum_token]', 'constraints' => array( - 'payum_token' => '[a-zA-Z0-9]+' + 'payum_token' => '[a-zA-Z0-9_-]+' ), 'defaults' => array( 'controller' => 'PayumCapture', @@ -20,7 +20,7 @@ 'options' => array( 'route' => '/payment/notify[/:payum_token]', 'constraints' => array( - 'payum_token' => '[a-zA-Z0-9]+' + 'payum_token' => '[a-zA-Z0-9_-]+' ), 'defaults' => array( 'controller' => 'PayumNotify', @@ -33,7 +33,7 @@ 'options' => array( 'route' => '/payment/authorize[/:payum_token]', 'constraints' => array( - 'payum_token' => '[a-zA-Z0-9]+' + 'payum_token' => '[a-zA-Z0-9_-]+' ), 'defaults' => array( 'controller' => 'PayumAuthorize', @@ -46,7 +46,7 @@ 'options' => array( 'route' => '/payment/refund[/:payum_token]', 'constraints' => array( - 'payum_token' => '[a-zA-Z0-9]+' + 'payum_token' => '[a-zA-Z0-9_-]+' ), 'defaults' => array( 'controller' => 'PayumRefund', From 2a8fb1b0401781f436c7cf57ee54ff9d8e3f4ae9 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 16:19:59 +0200 Subject: [PATCH 15/41] Update HttpRequestVerifier.php it should get the params from route --- .../PayumModule/Security/HttpRequestVerifier.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Payum/PayumModule/Security/HttpRequestVerifier.php b/src/Payum/PayumModule/Security/HttpRequestVerifier.php index 8908ad4..5d82bde 100644 --- a/src/Payum/PayumModule/Security/HttpRequestVerifier.php +++ b/src/Payum/PayumModule/Security/HttpRequestVerifier.php @@ -26,8 +26,11 @@ public function __construct(StorageInterface $tokenStorage) /** * {@inheritDoc} */ - public function verify($httpRequest) + public function verify($controller) { + + $httpRequest = $controller->getRequest(); + if (false == $httpRequest instanceof Request) { throw new InvalidArgumentException(sprintf( 'Invalid request given. Expected %s but it is %s', @@ -36,8 +39,10 @@ public function verify($httpRequest) )); } + $hash = $controller->params()->fromRoute('payum_token') ?: $httpRequest->getQuery('payum_token'); + /** @var $httpRequest Request */ - if (false === $hash = $httpRequest->getQuery('payum_token')) { + if (!$hash) { //TODO we should set 404 to response but I do not know how. symfony just throws not found exception. throw new InvalidArgumentException('Token parameter not set in request'); } @@ -70,4 +75,4 @@ public function invalidate(TokenInterface $token) { $this->tokenStorage->delete($token); } -} \ No newline at end of file +} From f9587d05dc1052ed6da4fe05493e6ceb4006d373 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 16:20:52 +0200 Subject: [PATCH 16/41] Update CaptureController.php pass the controller not the request --- src/Payum/PayumModule/Controller/CaptureController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/CaptureController.php b/src/Payum/PayumModule/Controller/CaptureController.php index 654bcf5..dd5b548 100644 --- a/src/Payum/PayumModule/Controller/CaptureController.php +++ b/src/Payum/PayumModule/Controller/CaptureController.php @@ -11,7 +11,7 @@ class CaptureController extends PayumController { public function doAction() { - $token = $this->getHttpRequestVerifier()->verify($this->getRequest()); + $token = $this->getHttpRequestVerifier()->verify($this); $payment = $this->getPayum()->getPayment($token->getPaymentName()); @@ -39,4 +39,4 @@ public function doAction() $this->redirect()->toUrl($token->getAfterUrl()); } -} \ No newline at end of file +} From 266971e3b05e08b98973e3e787cca8e3da791456 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 16:47:48 +0200 Subject: [PATCH 17/41] Update AuthorizeController.php --- src/Payum/PayumModule/Controller/AuthorizeController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/AuthorizeController.php b/src/Payum/PayumModule/Controller/AuthorizeController.php index 5a68c2b..0f62b42 100644 --- a/src/Payum/PayumModule/Controller/AuthorizeController.php +++ b/src/Payum/PayumModule/Controller/AuthorizeController.php @@ -11,7 +11,7 @@ class AuthorizeController extends PayumController { public function doAction() { - $token = $this->getHttpRequestVerifier()->verify($this->getRequest()); + $token = $this->getHttpRequestVerifier()->verify($this); $payment = $this->getPayum()->getPayment($token->getPaymentName()); @@ -39,4 +39,4 @@ public function doAction() $this->redirect()->toUrl($token->getAfterUrl()); } -} \ No newline at end of file +} From a048342d5ec79aebbd236a38549ae9b4a0147b5b Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 16:48:18 +0200 Subject: [PATCH 18/41] Update AuthorizeController.php --- src/Payum/PayumModule/Controller/AuthorizeController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/AuthorizeController.php b/src/Payum/PayumModule/Controller/AuthorizeController.php index 5a68c2b..0f62b42 100644 --- a/src/Payum/PayumModule/Controller/AuthorizeController.php +++ b/src/Payum/PayumModule/Controller/AuthorizeController.php @@ -11,7 +11,7 @@ class AuthorizeController extends PayumController { public function doAction() { - $token = $this->getHttpRequestVerifier()->verify($this->getRequest()); + $token = $this->getHttpRequestVerifier()->verify($this); $payment = $this->getPayum()->getPayment($token->getPaymentName()); @@ -39,4 +39,4 @@ public function doAction() $this->redirect()->toUrl($token->getAfterUrl()); } -} \ No newline at end of file +} From 2e70c755c066c143bc63bfb56b4b8e8142184dd3 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 16:48:31 +0200 Subject: [PATCH 19/41] Update CaptureController.php --- src/Payum/PayumModule/Controller/CaptureController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/CaptureController.php b/src/Payum/PayumModule/Controller/CaptureController.php index 654bcf5..dd5b548 100644 --- a/src/Payum/PayumModule/Controller/CaptureController.php +++ b/src/Payum/PayumModule/Controller/CaptureController.php @@ -11,7 +11,7 @@ class CaptureController extends PayumController { public function doAction() { - $token = $this->getHttpRequestVerifier()->verify($this->getRequest()); + $token = $this->getHttpRequestVerifier()->verify($this); $payment = $this->getPayum()->getPayment($token->getPaymentName()); @@ -39,4 +39,4 @@ public function doAction() $this->redirect()->toUrl($token->getAfterUrl()); } -} \ No newline at end of file +} From 59c2b2492cb1584b6abe28a703a0e01567cab445 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 16:48:47 +0200 Subject: [PATCH 20/41] Update NotifyController.php --- src/Payum/PayumModule/Controller/NotifyController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/NotifyController.php b/src/Payum/PayumModule/Controller/NotifyController.php index 8b6aba4..d7f1ceb 100644 --- a/src/Payum/PayumModule/Controller/NotifyController.php +++ b/src/Payum/PayumModule/Controller/NotifyController.php @@ -7,7 +7,7 @@ class NotifyController extends PayumController { public function doAction() { - $token = $this->getHttpRequestVerifier()->verify($this->getRequest()); + $token = $this->getHttpRequestVerifier()->verify($this); $payment = $this->getPayum()->getPayment($token->getPaymentName()); @@ -15,4 +15,4 @@ public function doAction() $this->getResponse()->setStatusCode(204); } -} \ No newline at end of file +} From 33bb30e443eff4ed180fc0fb6198bf92f0d11807 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 16:49:09 +0200 Subject: [PATCH 21/41] Update RefundController.php --- src/Payum/PayumModule/Controller/RefundController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/RefundController.php b/src/Payum/PayumModule/Controller/RefundController.php index 884bf9b..ac129da 100644 --- a/src/Payum/PayumModule/Controller/RefundController.php +++ b/src/Payum/PayumModule/Controller/RefundController.php @@ -11,7 +11,7 @@ class RefundController extends PayumController { public function doAction() { - $token = $this->getHttpRequestVerifier()->verify($this->getRequest()); + $token = $this->getHttpRequestVerifier()->verify($this); $this->getHttpRequestVerifier()->invalidate($token); $payment = $this->getPayum()->getPayment($token->getPaymentName()); @@ -38,4 +38,4 @@ public function doAction() $this->redirect()->toUrl($token->getAfterUrl()); } -} \ No newline at end of file +} From daf4c45bc7161fd6fd6ac2f209cb6a7bc9874b4c Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Wed, 11 Mar 2015 12:25:31 +0200 Subject: [PATCH 22/41] Update RegistryFactory.php no more fata lerror on service locator call from payments(cherry picked from commit a9a64afa1369678a93666fa0b2807b06eec89cc2) --- src/Payum/PayumModule/Registry/RegistryFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Payum/PayumModule/Registry/RegistryFactory.php b/src/Payum/PayumModule/Registry/RegistryFactory.php index 885054f..2bc6f64 100644 --- a/src/Payum/PayumModule/Registry/RegistryFactory.php +++ b/src/Payum/PayumModule/Registry/RegistryFactory.php @@ -21,14 +21,14 @@ public function createService(ServiceLocatorInterface $serviceLocator) $options->getStorages(), [] ); + + //TODO: quick fix. we should avoid early init of services. has to be reworked to be lazy + $registry->setServiceLocator($serviceLocator); $getHttpRequestAction = new GetHttpRequestAction($serviceLocator); foreach ($registry->getPayments() as $payment) { $payment->addAction($getHttpRequestAction); } - - //TODO: quick fix. we should avoid early init of services. has to be reworked to be lazy - $registry->setServiceLocator($serviceLocator); return $registry; } From cb29fa624b65780de423f341761716d2affa03c4 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 14:19:59 +0200 Subject: [PATCH 23/41] Update get-it-started.md no required anymore(cherry picked from commit 80ed823bbd903fdf88b8ef3349cf38d218572ff9) --- docs/get-it-started.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/get-it-started.md b/docs/get-it-started.md index 3709598..191dd06 100644 --- a/docs/get-it-started.md +++ b/docs/get-it-started.md @@ -119,9 +119,6 @@ class IndexController extends AbstractActionController $details['PAYMENTREQUEST_0_AMT'] = 1.23; $storage->update($details); - // FIXIT: I dont know how to inject controller plugin to the service. - $this->getServiceLocator()->get('payum.security.token_factory')->setUrlPlugin($this->url()); - $captureToken = $this->getServiceLocator()->get('payum.security.token_factory')->createCaptureToken( 'paypal_ec', $details, 'payment_done' ); From ff46b6669d53bb9f1d9c0a8443593be5a36aa745 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 15:36:54 +0200 Subject: [PATCH 24/41] Update TokenFactory.php token not replaced in route(cherry picked from commit a0a21e68924fc58e6623c3f5083872d5e6575e0a) --- src/Payum/PayumModule/Security/TokenFactory.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Payum/PayumModule/Security/TokenFactory.php b/src/Payum/PayumModule/Security/TokenFactory.php index eb4ff2a..138f9ce 100644 --- a/src/Payum/PayumModule/Security/TokenFactory.php +++ b/src/Payum/PayumModule/Security/TokenFactory.php @@ -27,9 +27,6 @@ public function setUrlPlugin(Url $urlPlugin) */ protected function generateUrl($path, array $parameters = array()) { - return $this->urlPlugin->fromRoute($path, array(), array( - 'force_canonical' => true, - 'query' => $parameters - )); + return $this->urlPlugin->fromRoute($path, $parameters, array('force_canonical' => true)); } -} \ No newline at end of file +} From 6c245f1cbc6f3d4e76f5a25f667d47c296039109 Mon Sep 17 00:00:00 2001 From: Alin Jurj Date: Thu, 12 Mar 2015 15:58:23 +0200 Subject: [PATCH 25/41] Update module.config.routes.php constrains(cherry picked from commit a448b3ec2c8a42961211445fde5939ca2fd9c7e9) --- config/module.config.routes.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/module.config.routes.php b/config/module.config.routes.php index de9a8fe..f55aa2d 100644 --- a/config/module.config.routes.php +++ b/config/module.config.routes.php @@ -7,7 +7,7 @@ 'options' => array( 'route' => '/payment/capture[/:payum_token]', 'constraints' => array( - 'payum_token' => '[a-zA-Z0-9]+' + 'payum_token' => '[a-zA-Z0-9_-]+' ), 'defaults' => array( 'controller' => 'PayumCapture', @@ -20,7 +20,7 @@ 'options' => array( 'route' => '/payment/notify[/:payum_token]', 'constraints' => array( - 'payum_token' => '[a-zA-Z0-9]+' + 'payum_token' => '[a-zA-Z0-9_-]+' ), 'defaults' => array( 'controller' => 'PayumNotify', @@ -33,7 +33,7 @@ 'options' => array( 'route' => '/payment/authorize[/:payum_token]', 'constraints' => array( - 'payum_token' => '[a-zA-Z0-9]+' + 'payum_token' => '[a-zA-Z0-9_-]+' ), 'defaults' => array( 'controller' => 'PayumAuthorize', @@ -46,7 +46,7 @@ 'options' => array( 'route' => '/payment/refund[/:payum_token]', 'constraints' => array( - 'payum_token' => '[a-zA-Z0-9]+' + 'payum_token' => '[a-zA-Z0-9_-]+' ), 'defaults' => array( 'controller' => 'PayumRefund', From ed713dabd4aa718f4d499ceae346ce98e1aec539 Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Wed, 29 Apr 2015 14:02:36 +0000 Subject: [PATCH 26/41] sync module with changes in payum 0.15 --- README.md | 2 +- config/module.config.php | 2 +- docs/get-it-started.md | 20 +++++++++---------- .../Controller/AuthorizeController.php | 4 ++-- .../Controller/CaptureController.php | 4 ++-- .../Controller/NotifyController.php | 4 ++-- .../Controller/RefundController.php | 4 ++-- .../PayumModule/Options/PayumOptions.php | 12 +++++------ .../PayumModule/Registry/RegistryFactory.php | 6 +++--- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index d7c712c..8c68e30 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PayumModule The modulee integrates [payum](https://github.com/Payum/Payum) into [zend2](http://framework.zend.com/) framework. -It already supports [+35 payments](https://github.com/Payum/Core/blob/master/Resources/docs/supported-payments.md). +It already supports [+35 gateways](https://github.com/Payum/Core/blob/master/Resources/docs/supported-gateways.md). Provide nice configuration layer, secured capture controller, storages integration and lots of more features. ## Resources diff --git a/config/module.config.php b/config/module.config.php index 82729d3..59f4556 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -2,7 +2,7 @@ return array( 'payum' => array( 'token_storage' => null, - 'payments' => array(), + 'gateways' => array(), 'storages' => array(), ), ); diff --git a/docs/get-it-started.md b/docs/get-it-started.md index 191dd06..1149087 100644 --- a/docs/get-it-started.md +++ b/docs/get-it-started.md @@ -1,7 +1,7 @@ # Get it started. In this chapter we would show basic setup and usage of payum module for [zf2](http://framework.zend.com/). -We are using paypal here but it could be adopted for any other supported payments. +We are using paypal here but it could be adopted for any other supported gateways. ## Installation @@ -9,9 +9,9 @@ We are using paypal here but it could be adopted for any other supported payment php composer.phar require "payum/payum-module:*@stable" "payum/xxx:*@stable" ``` -_**Note**: Where payum/xxx is a payum package, for example it could be payum/paypal-express-checkout-nvp. Look at [supported payments](https://github.com/Payum/Core/blob/master/Resources/docs/supported-payments.md) to find out what you can use._ +_**Note**: Where payum/xxx is a payum package, for example it could be payum/paypal-express-checkout-nvp. Look at [supported gateways](https://github.com/Payum/Core/blob/master/Resources/docs/supported-gateways.md) to find out what you can use._ -_**Note**: Use payum/payum if you want to install all payments at once._ +_**Note**: Use payum/payum if you want to install all gateways at once._ Now you have all codes prepared and ready to be used. @@ -70,11 +70,11 @@ use Buzz\Client\Curl; use Payum\Core\Extension\StorageExtension; use Payum\Core\Storage\FilesystemStorage; use Payum\Paypal\ExpressCheckout\Nvp\Api; -use Payum\Paypal\ExpressCheckout\Nvp\PaymentFactory; +use Payum\Paypal\ExpressCheckout\Nvp\GatewayFactory; $detailsClass = 'Application\Model\PaymentDetails'; -$paypalExpressCheckoutPaymentFactory = new \Payum\Paypal\ExpressCheckout\Nvp\PaymentFactory(); +$paypalFactory = new \Payum\Paypal\ExpressCheckout\Nvp\PaypalExpressCheckoutGatewayFactory(); return array( 'payum' => array( @@ -83,8 +83,8 @@ return array( 'Application\Model\PaymentSecurityToken', 'hash' ), - 'payments' => array( - 'paypal_ec' => $paypalExpressCheckoutPaymentFactory->create(array( + 'gateways' => array( + 'paypal_ec' => $paypalFactory->create(array( 'username' => 'EDIT ME', 'password' => 'EDIT ME', 'signature' => 'EDIT ME', @@ -146,11 +146,11 @@ class IndexController extends AbstractActionController { public function doneAction() { - $token = $this->getServiceLocator()->get('payum.security.http_request_verifier')->verify($this->getRequest()); + $token = $this->getServiceLocator()->get('payum.security.http_request_verifier')->verify($this); - $payment = $this->getServiceLocator()->get('payum')->getPayment($token->getPaymentName()); + $gateway = $this->getServiceLocator()->get('payum')->getGateway($token->getGatewayName()); - $payment->execute($status = new GetHumanStatus($token)); + $gateway->execute($status = new GetHumanStatus($token)); return new JsonModel(array('status' => $status->getStatus()) + iterator_to_array($status->getModel())); } diff --git a/src/Payum/PayumModule/Controller/AuthorizeController.php b/src/Payum/PayumModule/Controller/AuthorizeController.php index 0f62b42..7ad37b2 100644 --- a/src/Payum/PayumModule/Controller/AuthorizeController.php +++ b/src/Payum/PayumModule/Controller/AuthorizeController.php @@ -13,10 +13,10 @@ public function doAction() { $token = $this->getHttpRequestVerifier()->verify($this); - $payment = $this->getPayum()->getPayment($token->getPaymentName()); + $gateway = $this->getPayum()->getGateway($token->getGatewayName()); try { - $payment->execute(new Authorize($token)); + $gateway->execute(new Authorize($token)); } catch (ReplyInterface $reply) { if ($reply instanceof HttpRedirect) { $this->redirect()->toUrl($reply->getUrl()); diff --git a/src/Payum/PayumModule/Controller/CaptureController.php b/src/Payum/PayumModule/Controller/CaptureController.php index dd5b548..8214221 100644 --- a/src/Payum/PayumModule/Controller/CaptureController.php +++ b/src/Payum/PayumModule/Controller/CaptureController.php @@ -13,10 +13,10 @@ public function doAction() { $token = $this->getHttpRequestVerifier()->verify($this); - $payment = $this->getPayum()->getPayment($token->getPaymentName()); + $gateway = $this->getPayum()->getGateway($token->getGatewayName()); try { - $payment->execute(new Capture($token)); + $gateway->execute(new Capture($token)); } catch (ReplyInterface $reply) { if ($reply instanceof HttpRedirect) { $this->redirect()->toUrl($reply->getUrl()); diff --git a/src/Payum/PayumModule/Controller/NotifyController.php b/src/Payum/PayumModule/Controller/NotifyController.php index d7f1ceb..6cb491d 100644 --- a/src/Payum/PayumModule/Controller/NotifyController.php +++ b/src/Payum/PayumModule/Controller/NotifyController.php @@ -9,9 +9,9 @@ public function doAction() { $token = $this->getHttpRequestVerifier()->verify($this); - $payment = $this->getPayum()->getPayment($token->getPaymentName()); + $gateway = $this->getPayum()->getGateway($token->getGatewayName()); - $payment->execute(new Notify($token)); + $gateway->execute(new Notify($token)); $this->getResponse()->setStatusCode(204); } diff --git a/src/Payum/PayumModule/Controller/RefundController.php b/src/Payum/PayumModule/Controller/RefundController.php index ac129da..297662a 100644 --- a/src/Payum/PayumModule/Controller/RefundController.php +++ b/src/Payum/PayumModule/Controller/RefundController.php @@ -14,10 +14,10 @@ public function doAction() $token = $this->getHttpRequestVerifier()->verify($this); $this->getHttpRequestVerifier()->invalidate($token); - $payment = $this->getPayum()->getPayment($token->getPaymentName()); + $gateway = $this->getPayum()->getGateway($token->getGatewayName()); try { - $payment->execute(new Refund($token)); + $gateway->execute(new Refund($token)); } catch (ReplyInterface $reply) { if ($reply instanceof HttpRedirect) { $this->redirect()->toUrl($reply->getUrl()); diff --git a/src/Payum/PayumModule/Options/PayumOptions.php b/src/Payum/PayumModule/Options/PayumOptions.php index 8962d18..616e209 100644 --- a/src/Payum/PayumModule/Options/PayumOptions.php +++ b/src/Payum/PayumModule/Options/PayumOptions.php @@ -7,7 +7,7 @@ class PayumOptions extends AbstractOptions { protected $tokenStorage; - protected $payments = array(); + protected $gateways = array(); protected $storages = array(); @@ -30,17 +30,17 @@ public function getTokenStorage() /** * @return array */ - public function getPayments() + public function getGateways() { - return $this->payments; + return $this->gateways; } /** - * @param array $payments + * @param array $gateways */ - public function setPayments(array $payments) + public function setGateways(array $gateways) { - $this->payments = $payments; + $this->gateways = $gateways; } /** diff --git a/src/Payum/PayumModule/Registry/RegistryFactory.php b/src/Payum/PayumModule/Registry/RegistryFactory.php index 2bc6f64..34accb8 100644 --- a/src/Payum/PayumModule/Registry/RegistryFactory.php +++ b/src/Payum/PayumModule/Registry/RegistryFactory.php @@ -17,7 +17,7 @@ public function createService(ServiceLocatorInterface $serviceLocator) $options = $serviceLocator->get('payum.options'); $registry = new ServiceLocatorAwareRegistry( - $options->getPayments(), + $options->getGateways(), $options->getStorages(), [] ); @@ -26,8 +26,8 @@ public function createService(ServiceLocatorInterface $serviceLocator) $registry->setServiceLocator($serviceLocator); $getHttpRequestAction = new GetHttpRequestAction($serviceLocator); - foreach ($registry->getPayments() as $payment) { - $payment->addAction($getHttpRequestAction); + foreach ($registry->getGateways() as $gateway) { + $gateway->addAction($getHttpRequestAction); } return $registry; From a70630a271c65f9e505667d533f804a79cdab387 Mon Sep 17 00:00:00 2001 From: Kotlyar Maksim Date: Wed, 29 Apr 2015 14:03:54 +0000 Subject: [PATCH 27/41] master is 1.0-dev --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ef8d513..059bee5 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "0.15.*@dev" + "payum/core": "1.0.*@dev" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", @@ -39,7 +39,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.15-dev" + "dev-master": "1.0-dev" } }, "config": { From f3baacd322f67460d88b1d227c5e7d27a68915a7 Mon Sep 17 00:00:00 2001 From: Zak Date: Thu, 14 May 2015 00:13:21 +0200 Subject: [PATCH 28/41] Update get-it-started.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bonne méthode dans /Payum/Core/Request/BaseGetStatus.php --- docs/get-it-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/get-it-started.md b/docs/get-it-started.md index 1149087..2d68515 100644 --- a/docs/get-it-started.md +++ b/docs/get-it-started.md @@ -152,7 +152,7 @@ class IndexController extends AbstractActionController $gateway->execute($status = new GetHumanStatus($token)); - return new JsonModel(array('status' => $status->getStatus()) + iterator_to_array($status->getModel())); + return new JsonModel(array('status' => $status->getValue()) + iterator_to_array($status->getModel())); } } ``` From 65cd2e14392c0ab2e27e3b202543c67a379dce29 Mon Sep 17 00:00:00 2001 From: Stefano Azzalini Date: Mon, 22 Jun 2015 17:01:09 +0200 Subject: [PATCH 29/41] Use classic array declaration instead of the short one Use this notation to be compatible with php >=5.3.3 --- src/Payum/PayumModule/Registry/RegistryFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Payum/PayumModule/Registry/RegistryFactory.php b/src/Payum/PayumModule/Registry/RegistryFactory.php index 34accb8..e6c99c1 100644 --- a/src/Payum/PayumModule/Registry/RegistryFactory.php +++ b/src/Payum/PayumModule/Registry/RegistryFactory.php @@ -19,7 +19,7 @@ public function createService(ServiceLocatorInterface $serviceLocator) $registry = new ServiceLocatorAwareRegistry( $options->getGateways(), $options->getStorages(), - [] + array() ); //TODO: quick fix. we should avoid early init of services. has to be reworked to be lazy From e684a8f073175bf2acfd48f58a029837f8941c1d Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Mon, 24 Aug 2015 19:15:44 +0300 Subject: [PATCH 30/41] change owner --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 0734589..3661448 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2013 by Forma-Pro +Copyright (C) 2013-2015 Maksim Kotlyar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -16,4 +16,4 @@ 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. \ No newline at end of file +THE SOFTWARE. From e10f9d3218488a11b88b8eb5de6a1b34407496e2 Mon Sep 17 00:00:00 2001 From: P0rnflake Date: Mon, 9 Nov 2015 18:15:30 +0100 Subject: [PATCH 31/41] PR for #25 @see #25 --- src/Payum/PayumModule/Controller/CaptureController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/CaptureController.php b/src/Payum/PayumModule/Controller/CaptureController.php index 8214221..0b83c78 100644 --- a/src/Payum/PayumModule/Controller/CaptureController.php +++ b/src/Payum/PayumModule/Controller/CaptureController.php @@ -19,7 +19,7 @@ public function doAction() $gateway->execute(new Capture($token)); } catch (ReplyInterface $reply) { if ($reply instanceof HttpRedirect) { - $this->redirect()->toUrl($reply->getUrl()); + return $this->redirect()->toUrl($reply->getUrl()); } if ($reply instanceof HttpResponse) { @@ -37,6 +37,6 @@ public function doAction() $this->getHttpRequestVerifier()->invalidate($token); - $this->redirect()->toUrl($token->getAfterUrl()); + return $this->redirect()->toUrl($token->getAfterUrl()); } } From abf721533441a803af01db1a63c3fb22668bc31d Mon Sep 17 00:00:00 2001 From: P0rnflake Date: Mon, 9 Nov 2015 18:18:32 +0100 Subject: [PATCH 32/41] Update AuthorizeController.php @see #25 --- src/Payum/PayumModule/Controller/AuthorizeController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/AuthorizeController.php b/src/Payum/PayumModule/Controller/AuthorizeController.php index 7ad37b2..ffb5279 100644 --- a/src/Payum/PayumModule/Controller/AuthorizeController.php +++ b/src/Payum/PayumModule/Controller/AuthorizeController.php @@ -19,7 +19,7 @@ public function doAction() $gateway->execute(new Authorize($token)); } catch (ReplyInterface $reply) { if ($reply instanceof HttpRedirect) { - $this->redirect()->toUrl($reply->getUrl()); + return $this->redirect()->toUrl($reply->getUrl()); } if ($reply instanceof HttpResponse) { @@ -37,6 +37,6 @@ public function doAction() $this->getHttpRequestVerifier()->invalidate($token); - $this->redirect()->toUrl($token->getAfterUrl()); + return $this->redirect()->toUrl($token->getAfterUrl()); } } From 2b2cf76858d96600ff4e0c22c1437062b06554d7 Mon Sep 17 00:00:00 2001 From: P0rnflake Date: Mon, 9 Nov 2015 18:19:29 +0100 Subject: [PATCH 33/41] Update RefundController.php @see #25 --- src/Payum/PayumModule/Controller/RefundController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payum/PayumModule/Controller/RefundController.php b/src/Payum/PayumModule/Controller/RefundController.php index 297662a..da42785 100644 --- a/src/Payum/PayumModule/Controller/RefundController.php +++ b/src/Payum/PayumModule/Controller/RefundController.php @@ -20,7 +20,7 @@ public function doAction() $gateway->execute(new Refund($token)); } catch (ReplyInterface $reply) { if ($reply instanceof HttpRedirect) { - $this->redirect()->toUrl($reply->getUrl()); + return $this->redirect()->toUrl($reply->getUrl()); } if ($reply instanceof HttpResponse) { @@ -36,6 +36,6 @@ public function doAction() throw new \LogicException('Unsupported reply', null, $reply); } - $this->redirect()->toUrl($token->getAfterUrl()); + return $this->redirect()->toUrl($token->getAfterUrl()); } } From ee530cdd7b0a7371d8ecb4f63b4e7450bf38423d Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Tue, 15 Mar 2016 15:59:02 +0200 Subject: [PATCH 34/41] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8c68e30..5a356e9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # PayumModule +[![Join the chat at https://gitter.im/Payum/Payum](https://badges.gitter.im/Payum/Payum.svg)](https://gitter.im/Payum/Payum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + The modulee integrates [payum](https://github.com/Payum/Payum) into [zend2](http://framework.zend.com/) framework. It already supports [+35 gateways](https://github.com/Payum/Core/blob/master/Resources/docs/supported-gateways.md). Provide nice configuration layer, secured capture controller, storages integration and lots of more features. From 6cbaeb3a2b1449cb3c4165ef9b78c7da73a93e82 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Fri, 3 Feb 2017 22:03:38 +0200 Subject: [PATCH 35/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a356e9..76ea046 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Provide nice configuration layer, secured capture controller, storages integrati ## Resources -* [Documentation](http://payum.org/doc#PayumModule) +* [Documentation](https://github.com/Payum/PayumModule/blob/master/docs/index.md) * [Sandbox](https://github.com/makasim/PayumModuleSandbox) * [Questions](http://stackoverflow.com/questions/tagged/payum) * [Issue Tracker](https://github.com/Payum/PayumModule/issues) From cc48c2c5a449e6902f27ca5819d73ac4e9ab3934 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Wed, 26 Apr 2017 10:43:10 +0300 Subject: [PATCH 36/41] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 76ea046..a228f3a 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ Provide nice configuration layer, secured capture controller, storages integrati * [Issue Tracker](https://github.com/Payum/PayumModule/issues) * [Twitter](https://twitter.com/payumphp) -## Contributing +## Developed by Forma-Pro -PayumModule is an open source, community-driven project. Pull requests are very welcome. +Forma-Pro is a full stack development company which interests also spread to open source development. +Being a team of strong professionals we have an aim an ability to help community by developing cutting edge solutions in the areas of e-commerce, docker & microservice oriented architecture where we have accumulated a huge many-years experience. +Our main specialization is Symfony framework based solution, but we are always looking to the technologies that allow us to do our job the best way. We are committed to creating solutions that revolutionize the way how things are developed in aspects of architecture & scalability. -## Like it? Spread the world! - -Star payum module on [github](https://github.com/Payum/PayumModule) or [packagist](https://packagist.org/packages/payum/payum-module). +If you have any questions and inquires about our open source development, this product particularly or any other matter feel free to contact at opensource@forma-pro.com ## License From f0757ca5ee39599f1f35642146da5752c77aa83b Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Fri, 9 Jun 2017 09:59:34 +0300 Subject: [PATCH 37/41] Create README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a228f3a..26b1437 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Provide nice configuration layer, secured capture controller, storages integrati ## Resources +* [Site](https://payum.forma-pro.com/) * [Documentation](https://github.com/Payum/PayumModule/blob/master/docs/index.md) * [Sandbox](https://github.com/makasim/PayumModuleSandbox) * [Questions](http://stackoverflow.com/questions/tagged/payum) From 10c0bac51d8bf802ee22c844db832315bbec45a3 Mon Sep 17 00:00:00 2001 From: zaibi099 Date: Thu, 2 Nov 2017 18:17:15 +0500 Subject: [PATCH 38/41] Payum Core Version Updated to 1.4.* --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 059bee5..30abe41 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "1.0.*@dev" + "payum/core": "1.4.*" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", From 36ab078a0063d90654a5c3411abbe7791c16fc10 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Fri, 3 Nov 2017 12:47:39 +0200 Subject: [PATCH 39/41] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 30abe41..8d29e29 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": ">=5.3.3", "zendframework/zendframework": "~2.2", - "payum/core": "1.4.*" + "payum/core": "^1.4" }, "suggest": { "payum/paypal-express-checkout-nvp": "If you want to use paypal express checkout nvp gateway", From 69ec150e3ff09460d58e20b21493ccb1ec4f1f94 Mon Sep 17 00:00:00 2001 From: Jaike Date: Tue, 30 Oct 2018 12:20:30 +0100 Subject: [PATCH 40/41] Update copyright license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 3661448..116bf0c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2013-2015 Maksim Kotlyar +Copyright (C) 2013-2018 Maksim Kotlyar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From ecac0586b4573edd686aa899b05021b6995ee355 Mon Sep 17 00:00:00 2001 From: Max Kotliar Date: Tue, 6 Nov 2018 18:58:28 +0200 Subject: [PATCH 41/41] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 26b1437..9ba973e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +

Supporting Payum

+ +Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our customers. If you'd like to join them, please consider: + +- [Become a sponsor](https://www.patreon.com/makasim) +- [Become our client](http://forma-pro.com/) + +--- + # PayumModule [![Join the chat at https://gitter.im/Payum/Payum](https://badges.gitter.im/Payum/Payum.svg)](https://gitter.im/Payum/Payum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)