diff --git a/src/Action/NotifyAction.php b/src/Action/NotifyAction.php index 8f295e5..e1fdf53 100644 --- a/src/Action/NotifyAction.php +++ b/src/Action/NotifyAction.php @@ -32,8 +32,8 @@ public function execute($request) $details = ArrayObject::ensureArrayObject($request->getModel()); - if (method_exists($this->api, 'fetchTransaction')) { - $response = $this->api->fetchTransaction($details->toUnsafeArray())->send(); + if (method_exists($this->api, 'completePurchase')) { + $response = $this->api->completePurchase($details->toUnsafeArray())->send(); } else if (method_exists($this->api, 'acceptNotification')) { $response = $this->api->acceptNotification($details->toUnsafeArray())->send(); } @@ -55,7 +55,7 @@ public function supports($request) return $request instanceof Notify && $request->getModel() instanceof \ArrayAccess && ( - method_exists($this->api, 'fetchTransaction') || + method_exists($this->api, 'completePurchase') || method_exists($this->api, 'acceptNotification') ) ; diff --git a/tests/Action/NotifyActionTest.php b/tests/Action/NotifyActionTest.php index 6472545..fe4c770 100644 --- a/tests/Action/NotifyActionTest.php +++ b/tests/Action/NotifyActionTest.php @@ -9,7 +9,7 @@ use Payum\Core\Request\Notify; use Payum\Core\Tests\GenericActionTest; use Payum\OmnipayBridge\Action\NotifyAction; -use Payum\OmnipayBridge\Tests\MollieGateway; +use Payum\OmnipayBridge\Tests\OffsiteGateway; /** * @author Steffen Brem @@ -23,7 +23,7 @@ class NotifyActionTest extends GenericActionTest protected function setUp() { $this->action = new $this->actionClass(); - $this->action->setApi(new MollieGateway()); + $this->action->setApi(new OffsiteGateway()); } /** @@ -48,8 +48,8 @@ public function shouldSetStatusCapturedWhenSuccessful() $action = new NotifyAction(); - $gateway = new MollieGateway(); - $gateway->returnFetchTransaction = $requestMock; + $gateway = new OffsiteGateway(); + $gateway->returnOnCompletePurchase = $requestMock; $action->setApi($gateway); try { @@ -85,8 +85,8 @@ public function shouldSetStatusFailedWhenNotSuccessful() $action = new NotifyAction(); - $gateway = new MollieGateway(); - $gateway->returnFetchTransaction = $requestMock; + $gateway = new OffsiteGateway(); + $gateway->returnOnCompletePurchase = $requestMock; $action->setApi($gateway); try { diff --git a/tests/MollieGateway.php b/tests/MollieGateway.php deleted file mode 100644 index 675fa4f..0000000 --- a/tests/MollieGateway.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ -class MollieGateway extends AbstractGateway -{ - public $returnFetchTransaction; - - public function getName() {} - - public function fetchTransaction() - { - return $this->returnFetchTransaction; - } -}