/**
  * Continue Pay Pal checkout.
  *
  * @return array|null
  */
 public function run()
 {
     $this->selectCustomerAddress($this->customer);
     $this->paypalPage->getReviewBlock()->continueCheckout();
     $successBlock = $this->checkoutOnepageSuccess->getSuccessBlock();
     return ['orderId' => $successBlock->isVisible() ? $successBlock->getGuestOrderId() : null];
 }
Example #2
0
 /**
  * Place order after checking order totals on review step.
  *
  * @return array
  */
 public function run()
 {
     $orderReviewBlock = $this->paypalExpressReview->getReviewBlock();
     if ('-' !== $this->shippingMethod) {
         $orderReviewBlock->selectShippingMethod($this->shippingMethod);
     }
     $orderReviewBlock->placeOrder();
     return ['orderId' => $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId()];
 }
 /**
  * Place order after checking order totals on review step.
  *
  * @return array
  */
 public function run()
 {
     $reviewBlock = $this->checkoutOnepage->getReviewBlock();
     if ($this->hasAlert) {
         return ['alertText' => $reviewBlock->handleSubmittingOrderInformation()];
     } else {
         $reviewBlock->clickContinue();
         return ['orderId' => $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId()];
     }
 }
Example #4
0
 /**
  * Place order after checking order totals on review step.
  *
  * @return mixed
  */
 public function run()
 {
     $orderId = null;
     if ($this->positiveCase) {
         $this->checkoutOnepage->getReviewBlock()->clickContinue();
         $orderId = $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId();
     }
     return ['orderId' => $orderId, 'order' => $this->createOrderFixture($orderId)];
 }
 /**
  * Continue Pay Pal checkout.
  *
  * @return array|null
  */
 public function run()
 {
     $this->reviewBlock = $this->paypalPage->getReviewBlock()->isVisible() ? $this->paypalPage->getReviewBlock() : $this->paypalPage->getOldReviewBlock();
     $this->selectCustomerAddress($this->customer);
     $this->reviewBlock->continueCheckout();
     $this->paypalExpressReview->getReviewBlock()->isPlaceOrderVisible();
     $orderId = $this->paypalExpressReview->getReviewBlock()->isPlaceOrderVisible() ? null : $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId();
     return ['orderId' => $orderId];
 }
 /**
  * Fill credit card in i-frame step.
  *
  * @return array
  */
 public function run()
 {
     $this->checkoutOnepage->getReviewBlock()->clickContinue();
     $this->browser->switchToFrame(new Locator($this->iFrameSelector));
     $methodName = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $this->payment['method']))) . 'Form';
     $form = $this->checkoutOnepage->{$methodName}();
     $element = $this->browser->find('body');
     $form->fill($this->payment['cc'], $element);
     $form->clickPayNow($element);
     return ['orderId' => $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId()];
 }
 /**
  * Assert that success message is correct.
  *
  * @param CheckoutOnepageSuccess $checkoutOnepageSuccess
  * @return void
  */
 public function processAssert(CheckoutOnepageSuccess $checkoutOnepageSuccess)
 {
     \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $checkoutOnepageSuccess->getTitleBlock()->getTitle());
 }