Exemple #1
0
 /**
  * @param \Generated\Shared\Transfer\PayolutionPaymentTransfer $paymentTransfer
  * @param int $idSalesOrder
  *
  * @return \Orm\Zed\Payolution\Persistence\SpyPaymentPayolution
  */
 protected function savePaymentForOrder(PayolutionPaymentTransfer $paymentTransfer, $idSalesOrder)
 {
     $paymentEntity = new SpyPaymentPayolution();
     $addressTransfer = $paymentTransfer->getAddress();
     $formattedStreet = trim(sprintf('%s %s %s', $addressTransfer->getAddress1(), $addressTransfer->getAddress2(), $addressTransfer->getAddress3()));
     $paymentEntity->fromArray($addressTransfer->toArray());
     $paymentEntity->fromArray($paymentTransfer->toArray());
     $paymentEntity->setStreet($formattedStreet)->setCountryIso2Code($addressTransfer->getIso2Code())->setFkSalesOrder($idSalesOrder);
     $paymentEntity->save();
     return $paymentEntity;
 }
 /**
  * @return void
  */
 private function setUpPaymentTestData()
 {
     $this->paymentEntity = (new SpyPaymentPayolution())->setFkSalesOrder($this->getOrderEntity()->getIdSalesOrder())->setAccountBrand(PayolutionConstants::BRAND_INVOICE)->setClientIp('127.0.0.1')->setFirstName('Jane')->setLastName('Doe')->setDateOfBirth('1970-01-02')->setEmail('*****@*****.**')->setGender(SpyPaymentPayolutionTableMap::COL_GENDER_MALE)->setSalutation(SpyPaymentPayolutionTableMap::COL_SALUTATION_MR)->setCountryIso2Code('DE')->setCity('Berlin')->setStreet('Straße des 17. Juni 135')->setZipCode('10623')->setLanguageIso2Code('DE')->setCurrencyIso3Code('EUR');
     $this->paymentEntity->save();
 }
 /**
  * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
  * @param \Orm\Zed\Payolution\Persistence\SpyPaymentPayolution $paymentEntity
  * @param string $paymentCode
  * @param string $uniqueId
  *
  * @return array
  */
 protected function getBaseTransactionRequestForPayment(OrderTransfer $orderTransfer, SpyPaymentPayolution $paymentEntity, $paymentCode, $uniqueId)
 {
     $requestData = $this->getBaseTransactionRequest($orderTransfer->getTotals()->getGrandTotal(), $paymentEntity->getCurrencyIso3Code(), $orderTransfer->getIdSalesOrder());
     $this->addRequestData($requestData, [ApiConstants::TRANSACTION_CHANNEL => $this->getTransactionChannel(), ApiConstants::PAYMENT_CODE => $paymentCode, ApiConstants::IDENTIFICATION_REFERENCEID => $uniqueId]);
     return $requestData;
 }
Exemple #4
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;
 }