/**
  * @return void
  */
 public function testRefundPayment()
 {
     $this->markTestSkipped('Payolution request is too slow');
     $this->setBaseTestData();
     $this->setPaymentTestData();
     $orderTransfer = $this->createOrderTransferMock();
     $facade = $this->payolutionFacade;
     $facade->preAuthorizePayment($orderTransfer, $this->paymentEntity->getIdPaymentPayolution());
     $facade->capturePayment($orderTransfer, $this->paymentEntity->getIdPaymentPayolution());
     /** @var \Orm\Zed\Payolution\Persistence\SpyPaymentPayolutionTransactionStatusLog $preAuthorizationStatusLogEntity */
     $preAuthorizationStatusLogEntity = $this->paymentEntity->getSpyPaymentPayolutionTransactionStatusLogs()->getFirst();
     $responseTransfer = $facade->refundPayment($orderTransfer, $this->paymentEntity->getIdPaymentPayolution());
     $this->assertInstanceOf(PayolutionTransactionResponseTransfer::class, $responseTransfer);
     /** @var \Orm\Zed\Payolution\Persistence\SpyPaymentPayolutionTransactionRequestLog $reAuthorizationRequestLogEntity */
     $this->paymentEntity->clearSpyPaymentPayolutionTransactionRequestLogs();
     $refundRequestLogEntity = $this->paymentEntity->getSpyPaymentPayolutionTransactionRequestLogs()->getLast();
     $this->assertEquals($preAuthorizationStatusLogEntity->getIdentificationUniqueid(), $refundRequestLogEntity->getReferenceId());
 }
Пример #2
0
 /**
  * @param array $requestData
  * @param \Orm\Zed\Payolution\Persistence\SpyPaymentPayolution $paymentEntity
  *
  * @return \Generated\Shared\Transfer\PayolutionTransactionResponseTransfer
  */
 protected function sendLoggedRequest(array $requestData, SpyPaymentPayolution $paymentEntity)
 {
     $this->logApiRequest($requestData, $paymentEntity->getIdPaymentPayolution());
     $responseTransfer = $this->sendRequest($requestData);
     $this->logApiResponse($responseTransfer, $paymentEntity->getIdPaymentPayolution());
     return $responseTransfer;
 }