Пример #1
0
 /**
  * @param \Generated\Shared\Transfer\CheckoutResponseTransfer $checkoutResponseTransfer
  *
  * @return \Generated\Shared\Transfer\QuoteTransfer
  */
 private function getQuoteTransfer(CheckoutResponseTransfer $checkoutResponseTransfer)
 {
     $orderEntity = $this->createOrderEntity();
     $paymentAddressTransfer = new AddressTransfer();
     $email = '*****@*****.**';
     $paymentAddressTransfer->setIso2Code('DE')->setEmail($email)->setFirstName('John')->setLastName('Doe')->setCellPhone('+40 175 0815')->setPhone('+30 0815')->setAddress1('Straße des 17. Juni')->setAddress2('135')->setZipCode('10623')->setSalutation(SpyPaymentPayolutionTableMap::COL_SALUTATION_MR)->setCity('Berlin');
     $payolutionPaymentTransfer = new PayolutionPaymentTransfer();
     $payolutionPaymentTransfer->setEmail($email)->setGender(SpyPaymentPayolutionTableMap::COL_GENDER_MALE)->setDateOfBirth('1970-01-02')->setClientIp('127.0.0.1')->setAccountBrand(PayolutionConstants::BRAND_INVOICE)->setLanguageIso2Code('DE')->setCurrencyIso3Code('EUR')->setAddress($paymentAddressTransfer);
     $quoteTransfer = new QuoteTransfer();
     $customerTransfer = new CustomerTransfer();
     $customerTransfer->setEmail($email);
     $customerTransfer->setIsGuest(true);
     $quoteTransfer->setCustomer($customerTransfer);
     $checkoutResponseTransfer->getSaveOrder()->setIdSalesOrder($orderEntity->getIdSalesOrder());
     $paymentTransfer = new PaymentTransfer();
     $paymentTransfer->setPayolution($payolutionPaymentTransfer);
     $quoteTransfer->setPayment($paymentTransfer);
     foreach ($orderEntity->getItems() as $orderItemEntity) {
         $itemTransfer = new ItemTransfer();
         $itemTransfer->setName($orderItemEntity->getName())->setQuantity($orderItemEntity->getQuantity())->setUnitGrossPrice($orderItemEntity->getGrossPrice())->setFkSalesOrder($orderItemEntity->getFkSalesOrder())->setIdSalesOrderItem($orderItemEntity->getIdSalesOrderItem());
         $checkoutResponseTransfer->getSaveOrder()->addOrderItem($itemTransfer);
     }
     return $quoteTransfer;
 }