本文整理汇总了PHP中Am_Request::getInt方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Request::getInt方法的具体用法?PHP Am_Request::getInt怎么用?PHP Am_Request::getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Am_Request
的用法示例。
在下文中一共展示了Am_Request::getInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInt
/** @return int the same as get param but with intval(...) applied */
function getInt($key, $default = 0)
{
return $this->_request->getInt($key, $default);
}
示例2: expressCheckoutAction
public function expressCheckoutAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
{
$token = $request->getFiltered('token');
if (!$token) {
throw new Am_Exception_InputError("No required [token] provided, internal error");
}
$log = $this->getDi()->invoiceLogRecord;
$log->title = "";
$log->paysys_id = $this->getId();
if ($request->getInt('do')) {
$invoice = current($this->getDi()->invoiceTable->findByData(self::PAYPAL_EXPRESS_TOKEN, $token));
if (!$invoice) {
throw new Am_Exception_InternalError("Could not find invoice by token [{$token}]");
}
$this->_setInvoice($invoice);
$log->setInvoice($invoice);
if ($invoice->first_total > 0) {
// bill initial amount @todo free trial
$log->title .= " doExpressCheckout";
$apireq = new Am_Paysystem_PaypalApiRequest($this);
$apireq->doExpressCheckout($invoice, $token, $request->getFiltered('PayerID'));
$vars = $apireq->sendRequest($log);
$transaction = new Am_Paysystem_Transaction_PayPalExpress_DoExpressCheckout($this, $vars);
$transaction->setInvoice($invoice);
$transaction->process();
}
if ($invoice->rebill_times) {
$log->title .= " createRecurringPaymentProfile";
$apireq = new Am_Paysystem_PaypalApiRequest($this);
$apireq->createRecurringPaymentProfile($invoice, null, $token, $request->getFiltered('PayerID'));
$vars = $apireq->sendRequest($log);
if ($vars['ACK'] != 'Success') {
$this->logError("Not Success response to CreateRecurringPaymentProfile request", $vars);
} else {
$invoice->data()->set(self::PAYPAL_PROFILE_ID, $vars['PROFILEID'])->update();
if ($invoice->first_total <= 0) {
$transaction = new Am_Paysystem_Transaction_PayPalExpress_CreateRecurringPaymentProfile($this, $vars);
$transaction->setInvoice($invoice);
$transaction->process();
}
}
}
return Am_Controller::redirectLocation($this->getReturnUrl());
} else {
$log->title .= " getExpressCheckoutDetails";
$apireq = new Am_Paysystem_PaypalApiRequest($this);
$apireq->getExpressCheckoutDetails($token);
$vars = $apireq->sendRequest($log);
$invoiceId = filterId(get_first(@$vars['INVNUM'], @$vars['L_PAYMENTREQUEST_0_INVNUM'], $this->getDi()->session->paypal_invoice_id));
if (!$invoiceId || !($invoice = $this->getDi()->invoiceTable->findBySecureId($invoiceId, 'paypal'))) {
throw new Am_Exception_InputError("Could not find invoice related to given payment. Internal error. Your account was not billed, please try again");
}
$log->setInvoice($invoice);
$log->update();
$this->_setInvoice($invoice);
/* @var $invoice Invoice */
if ($invoice->isPaid()) {
return Am_Controller::redirectLocation($this->getReturnUrl());
}
$invoice->data()->set(self::PAYPAL_EXPRESS_TOKEN, $token)->update();
$view = new Am_View();
$view->invoice = $invoice;
$view->url = $this->getPluginUrl(self::PAYPAL_EXPRESS_CHECKOUT);
$view->hidden = array('do' => '1', 'token' => $request->getFiltered('token'), 'PayerID' => $request->getFiltered('PayerID'));
$view->display("payment-confirm.phtml");
}
}
示例3: setFromRequest
public function setFromRequest(Am_Request $request)
{
if (is_string($search = $request->get('search'))) {
$this->query->unserialize($search);
} else {
if ($id = $request->getInt('_u_search_load')) {
$this->query->load($id);
} else {
$this->query->setFromRequest($request);
}
}
}
示例4: adminCancelAction
public function adminCancelAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
{
if (!$this->getDi()->authAdmin->getUserId()) {
throw new Am_Exception_AccessDenied("Only admin access allowed");
}
$invoice_id = $request->getInt('invoice_id');
$invoice = $this->getDi()->invoiceTable->load($invoice_id);
if ($invoice->paysys_id != $this->getId()) {
throw new Am_Exception_InternalError("Trying to cancel transaction - not 2CO one");
}
$result = new Am_Paysystem_Result();
$payment = current($invoice->getPaymentRecords());
try {
$this->cancelInvoice($payment, $result);
} catch (Exception $e) {
$result->setFailed($e->getMessage());
}
$view = $this->getDi()->view;
$view->title = ___("Subscription Cancelled");
$view->content = $result->isSuccess() ? ___("Success") : implode("<br />\n", $result->getErrorMessages());
$response->setBody($view->render('admin/layout.phtml'));
}