public function actionPaypalReturn() { $e = new ExpressCheckout(); if (isset($_REQUEST['token'])) { $paymentDetails = $e->getPaymentDetails($_REQUEST['token']); if ($paymentDetails['ACK'] == "Success") { $ack = $e->doPayment($paymentDetails); $this->render("paypal_success", array('ack' => $ack)); } else { $this->render("paypal_error", array('ack' => $ack)); } } }