url = $url; $this->mathRandom = $mathRandom; $this->transparent = $transparent; } /** * Get the Secure Token from Paypal for TR * * @param Quote $quote * * @return DataObject * @throws \Exception */ public function requestToken(Quote $quote) { $this->transparent->setStore($quote->getStoreId()); $request = $this->transparent->buildBasicRequest(); $request->setTrxtype(Payflowpro::TRXTYPE_AUTH_ONLY); $request->setVerbosity('HIGH'); $request->setAmt(0); $request->setCreatesecuretoken('Y'); $request->setSecuretokenid($this->mathRandom->getUniqueHash()); $request->setReturnurl($this->url->getUrl('paypal/transparent/response')); $request->setErrorurl($this->url->getUrl('paypal/transparent/response')); $request->setCancelurl($this->url->getUrl('paypal/transparent/cancel')); $request->setDisablereceipt('TRUE'); $request->setSilenttran('TRUE'); $this->transparent->fillCustomerContacts($quote, $request); $result = $this->transparent->postRequest($request, $this->transparent->getConfig()); return $result; } }