public function testGetResponseObject()
 {
     $gatewayTransactionResponse = [];
     $result = new \Magento\Framework\DataObject();
     $this->transparent->expects($this->once())->method('getDebugReplacePrivateDataKeys')->willReturn(['key1', 'key2']);
     $this->transparent->expects($this->once())->method('getDebugFlag')->willReturn(true);
     $this->transparent->expects($this->once())->method('mapGatewayResponse')->with($gatewayTransactionResponse, $result)->willReturn($result);
     $this->loggerMock->expects($this->once())->method('debug')->with($gatewayTransactionResponse, ['key1', 'key2'], true);
     $this->assertEquals($result, $this->model->getResponseObject($gatewayTransactionResponse));
 }
예제 #2
0
 /**
  * @return ResultInterface
  */
 public function execute()
 {
     $parameters = [];
     try {
         $response = $this->transaction->getResponseObject($this->getRequest()->getPostValue());
         $this->responseValidator->validate($response, $this->transparent);
         $this->transaction->savePaymentInQuote($response);
     } catch (LocalizedException $exception) {
         $parameters['error'] = true;
         $parameters['error_msg'] = $exception->getMessage();
     }
     $this->coreRegistry->register(Iframe::REGISTRY_KEY, $parameters);
     $resultLayout = $this->resultLayoutFactory->create();
     $resultLayout->addDefaultHandle();
     $resultLayout->getLayout()->getUpdate()->load(['transparent_payment_response']);
     return $resultLayout;
 }