コード例 #1
0
ファイル: Saver.php プロジェクト: spryker/Payolution
 /**
  * @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;
 }
コード例 #2
0
 /**
  * @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();
 }