Exemple #1
0
 /**
  * @param \Spryker\Zed\Payone\Business\Api\Request\Container\AbstractRequestContainer $container
  *
  * @return void
  */
 protected function applyStandardParameter(AbstractRequestContainer $container)
 {
     if ($container->getPortalid() === null) {
         $container->setPortalid($this->standardParameter->getPortalId());
     }
     if ($container->getAid() === null) {
         $container->setAid($this->standardParameter->getAid());
     }
     if ($container->getMid() === null) {
         $container->setMid($this->standardParameter->getMid());
     }
     if ($container->getEncoding() === null) {
         $container->setEncoding($this->standardParameter->getEncoding());
     }
     if ($container->getMode() === null) {
         $container->setMode($this->modeDetector->getMode());
     }
     if ($container->getLanguage() === null) {
         $container->setLanguage($this->standardParameter->getLanguage());
     }
     if ($container->getApiVersion() === null) {
         $container->setApiVersion($this->standardParameter->getApiVersion());
     }
     if ($container->getResponsetype() === null) {
         $container->setResponsetype($this->standardParameter->getResponseType());
     }
 }
Exemple #2
0
 /**
  * @param \Spryker\Zed\Payone\Business\Api\Request\Container\AbstractRequestContainer $container
  *
  * @return void
  */
 protected function setStandardParameter(AbstractRequestContainer $container)
 {
     $container->setApiVersion(PayoneApiConstants::API_VERSION_3_9);
     $container->setEncoding($this->standardParameter->getEncoding());
     $container->setKey($this->hashGenerator->hash($this->standardParameter->getKey()));
     $container->setMid($this->standardParameter->getMid());
     $container->setPortalid($this->standardParameter->getPortalId());
     $container->setMode($this->modeDetector->getMode());
 }
 /**
  * @param \Spryker\Shared\Payone\Dependency\TransactionStatusUpdateInterface $request
  *
  * @return bool|\Spryker\Zed\Payone\Business\Api\TransactionStatus\TransactionStatusResponse
  */
 protected function validate(TransactionStatusUpdateInterface $request)
 {
     $systemHashedKey = $this->hashGenerator->hash($this->standardParameter->getKey());
     if ($request->getKey() !== $systemHashedKey) {
         return $this->createErrorResponse('Payone transaction status update: Given and internal key do not match!');
     }
     if ((int) $request->getAid() !== (int) $this->standardParameter->getAid()) {
         return $this->createErrorResponse('Payone transaction status update: Invalid Aid! System: ' . $this->standardParameter->getAid() . ' Request: ' . $request->getAid());
     }
     if ((int) $request->getPortalid() !== (int) $this->standardParameter->getPortalId()) {
         return $this->createErrorResponse('Payone transaction status update: Invalid Portalid! System: ' . $this->standardParameter->getPortalId() . ' Request: ' . $request->getPortalid());
     }
     return true;
 }