Example #1
0
 /**
  * @param mixed $request
  *
  * @throws \Payum\Core\Exception\RequestNotSupportedException if the action dose not support the request.
  */
 public function execute($request)
 {
     RequestNotSupportedException::assertSupports($this, $request);
     $details = ArrayObject::ensureArrayObject($request->getModel());
     $setPayU = new SetPayU($request->getToken());
     $setPayU->setModel($details);
     $this->gateway->execute($setPayU);
 }
Example #2
0
 /**
  * @param mixed $request
  *
  * @throws \Payum\Core\Exception\RequestNotSupportedException if the action dose not support the request.
  */
 public function execute($request)
 {
     /** @var $request Notify */
     RequestNotSupportedException::assertSupports($this, $request);
     $setPayU = new SetPayU($request->getToken());
     $setPayU->setModel($request->getModel());
     $this->gateway->execute($setPayU);
     $status = new GetHumanStatus($request->getToken());
     $status->setModel($request->getModel());
     $this->gateway->execute($status);
 }
Example #3
0
 /**
  * @test
  * @expectedException \Accesto\Component\Payum\PayU\Exception\PayUException
  */
 public function shouldThrowExceptionAfterFailure()
 {
     $createResponse = new \stdClass();
     $createResponse->status = new \stdClass();
     $createResponse->status->statusCode = 'Error';
     $createResponse->orderId = 1;
     $createResponse->redirectUri = 'example.com';
     $action = $this->setupSetPayUAction($createResponse);
     $t = new Token();
     $t->setGatewayName('payu');
     $t->setDetails(new \ArrayObject());
     $request = new SetPayU($t);
     $request->setModel(new ArrayObject());
     $action->execute($request);
 }