/**
  * @param \Spryker\Shared\Transfer\AbstractTransfer|\Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
  *
  * @return \Spryker\Shared\Transfer\AbstractTransfer
  */
 public function getData(AbstractTransfer $quoteTransfer)
 {
     if ($quoteTransfer->getPayment() === null) {
         $paymentTransfer = new PaymentTransfer();
         $paymentTransfer->setPayolution(new PayolutionPaymentTransfer());
         $paymentTransfer->setPayolutionInvoice(new PayolutionPaymentTransfer());
         $quoteTransfer->setPayment($paymentTransfer);
     }
     return $quoteTransfer;
 }
예제 #2
0
 /**
  * @return \Generated\Shared\Transfer\QuoteTransfer
  */
 private function getQuoteTransfer()
 {
     $quoteTransfer = new QuoteTransfer();
     $totalsTransfer = new TotalsTransfer();
     $totalsTransfer->setGrandTotal(10000)->setSubtotal(10000);
     $quoteTransfer->setTotals($totalsTransfer);
     $addressTransfer = new AddressTransfer();
     $addressTransfer->setFirstName('John')->setLastName('Doe')->setSalutation('Mr')->setCity('Berlin')->setIso2Code('DE')->setAddress1('Straße des 17. Juni')->setAddress2('135')->setZipCode('10623');
     $quoteTransfer->setBillingAddress($addressTransfer);
     $paymentTransfer = new PayolutionPaymentTransfer();
     $paymentTransfer->setGender('Male')->setDateOfBirth('1970-01-01')->setClientIp('127.0.0.1')->setAccountBrand(ApiConstants::BRAND_INVOICE)->setAddress($addressTransfer);
     $payment = new PaymentTransfer();
     $payment->setPayolution($paymentTransfer);
     $quoteTransfer->setPayment($payment);
     return $quoteTransfer;
 }
 /**
  * @return \Generated\Shared\Transfer\QuoteTransfer
  */
 private function getCheckoutRequestTransfer()
 {
     $itemTransfer = new ItemTransfer();
     $itemTransfer->setSku('1234567890')->setQuantity(1)->setUnitGrossPriceWithProductOptions(10000)->setName('Socken');
     $billingAddressTransfer = new AddressTransfer();
     $billingAddressTransfer->setIso2Code('DE')->setEmail('*****@*****.**')->setFirstName('John')->setLastName('Doe')->setAddress1('Straße des 17. Juni')->setAddress2('135')->setZipCode('10623')->setCity('Berlin');
     $shippingAddressTransfer = new AddressTransfer();
     $shippingAddressTransfer->setIso2Code('DE')->setEmail('*****@*****.**')->setFirstName('John')->setLastName('Doe')->setAddress1('Fraunhoferstraße')->setAddress2('120')->setZipCode('80469')->setCity('München');
     $paymentAddressTransfer = (new AddressTransfer())->setFirstName('John')->setLastName('Doe')->setSalutation('Mr')->setEmail('*****@*****.**')->setCity('Berlin')->setIso2Code('DE')->setAddress1('Straße des 17. Juni')->setAddress2('135')->setZipCode('10623');
     $payolutionPaymentTransfer = (new PayolutionPaymentTransfer())->setGender('Male')->setDateOfBirth('1970-01-01')->setClientIp('127.0.0.1')->setAccountBrand(PayolutionConstants::BRAND_INVOICE)->setAddress($paymentAddressTransfer);
     $quoteTransfer = new QuoteTransfer();
     $totalsTransfer = new TotalsTransfer();
     $totalsTransfer->setGrandTotal(10000)->setSubtotal(10000);
     $quoteTransfer->setTotals($totalsTransfer);
     $paymentTransfer = new PaymentTransfer();
     $paymentTransfer->setPaymentSelection('no_payment');
     $paymentTransfer->setPayolution($payolutionPaymentTransfer);
     $quoteTransfer->setPayment($paymentTransfer);
     $quoteTransfer->setShippingAddress($shippingAddressTransfer)->setBillingAddress($billingAddressTransfer);
     return $quoteTransfer;
 }
예제 #4
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;
 }
 /**
  * @return void
  */
 public function testPreCheckPayment()
 {
     $this->markTestSkipped('Payolution request is too slow');
     $this->setBaseTestData();
     $totalsTransfer = new TotalsTransfer();
     $totalsTransfer->setGrandTotal(10000);
     $quoteTransfer = new QuoteTransfer();
     $quoteTransfer->setTotals($totalsTransfer);
     $addressTransfer = (new AddressTransfer())->setCity('Berlin')->setZipCode('10623')->setAddress1('Straße des 17. Juni 135')->setFirstName('John')->setLastName('Doe')->setSalutation('Mr')->setEmail('*****@*****.**')->setIso2Code('DE');
     $payolutionPaymentTransfer = (new PayolutionPaymentTransfer())->setGender('Male')->setDateOfBirth('1970-01-01')->setClientIp('127.0.0.1')->setAccountBrand(ApiConstants::BRAND_INVOICE)->setAddress($addressTransfer)->setLanguageIso2Code('DE')->setCurrencyIso3Code('EUR');
     $paymentTransfer = new PaymentTransfer();
     $paymentTransfer->setPayolution($payolutionPaymentTransfer);
     $quoteTransfer->setPayment($paymentTransfer);
     $facade = $this->payolutionFacade;
     $response = $facade->preCheckPayment($quoteTransfer);
     $this->assertInstanceOf(PayolutionTransactionResponseTransfer::class, $response);
 }