/** * Open product on frontend and click Checkout with PayPal button. * * @return void */ public function run() { $product = reset($this->products); $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $parentWindow = $this->catalogProductView->getViewBlock()->braintreePaypalCheckout(); $this->catalogProductView->getBraintreePaypalBlock()->process($parentWindow); }