/** * @return $this */ public function sendPurchaseRequest() { $gateway = new Gateway(); $purchaseResponse = $gateway->purchase($this->getPurchaseRequest())->send(); $this->setPurchaseResponse($purchaseResponse); if ($purchaseResponse->isSuccessful()) { $this->setIsPurchased(1); } return $this; }