本文整理汇总了PHP中Page_Controller::renderWith方法的典型用法代码示例。如果您正苦于以下问题:PHP Page_Controller::renderWith方法的具体用法?PHP Page_Controller::renderWith怎么用?PHP Page_Controller::renderWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page_Controller
的用法示例。
在下文中一共展示了Page_Controller::renderWith方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCart
function testCart()
{
$cart = $this->objFromFixture("Order", "cart");
ShoppingCart::singleton()->setCurrent($cart);
$page = new Page_Controller();
$this->assertEquals("\$8.00", (string) $page->renderWith("CartTestTemplate"));
}
示例2: processPayment
function processPayment($data, $form)
{
// 1) Get secured Eway url
$url = $this->EwayURL();
$response = file_get_contents($url);
if ($response) {
$response = Convert::xml2array($response);
if (isset($response['Result']) && $response['Result'] == 'True' && isset($response['URI']) && $response['URI']) {
// 2) Redirect to the secured Eway url
$page = new Page();
$page->Title = 'Redirection to eWAY...';
$page->Logo = '<img src="' . $this->config()->get('logo') . '" alt="Payments powered by eWAY"/>';
$page->Form = $this->EwayForm($response['URI']);
$controller = new Page_Controller($page);
$form = $controller->renderWith('PaymentProcessingPage');
return new Payment_Processing($form);
}
}
$this->Status = 'Failure';
if ($response && isset($response['Error'])) {
$this->Message = $response['Error'];
}
$this->write();
return $this->redirectToOrder();
}
示例3: processPayment
function processPayment($data, $form)
{
$page = new Page();
$page->Title = "Make payment";
$page->Form = $this->processPaymentForm($data);
$page->Logo = '<img src="payment_securatech/images/paymark_small.png" "payment gateway powered by Securatech" />';
$controller = new Page_Controller($page);
$form = $controller->renderWith("PaymentProcessingPage");
return new Payment_Processing($form);
}
示例4: processPayment
public function processPayment($data, $form)
{
$page = new Page();
$page->Title = 'Redirection to Paystation...';
$page->Logo = '<img src="' . self::$logo . '" alt="Payments powered by Paystation"/>';
$page->Form = $this->PaystationForm();
$controller = new Page_Controller($page);
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
$form = $controller->renderWith('PaymentProcessingPage');
return new Payment_Processing($form);
}
示例5: processPayment
function processPayment($data, $form)
{
// Checks credentials
if (!self::$website_key || !self::$signature_secret_key) {
user_error('You are attempting to make a payment without the necessary credentials set', E_USER_ERROR);
}
$this->Method = Convert::raw2sql($data['BuckarooMethod']);
$this->write();
$page = new Page();
$page->Title = 'Redirection to Buckaroo...';
$page->Logo = '<img src="' . self::$logo . '" alt="Payments powered by Buckaroo" class="logo buckarooLogo"/>';
$page->Form = $this->PaymentForm($data);
$controller = new Page_Controller($page);
$form = $controller->renderWith('PaymentProcessingPage');
return new Payment_Processing($form);
}
示例6: processPayment
function processPayment($data, $form)
{
$page = new Page();
$page->Title = _t("OgonePayment.PROCESSINGPAYMENT", "Processing Payment");
$page->Form = $this->OgoneForm();
$controller = new Page_Controller($page);
$form = $controller->renderWith('PaymentProcessingPage');
return new Payment_Processing($form);
}
示例7: processPayment
function processPayment($data, $form)
{
//sanity checks
if (!isset(self::$supported_currencies[$this->Amount->Currency])) {
user_error("The currency \"" . $this->Amount->Currency . "\" is not supported by ePay.dk", E_USER_ERROR);
}
$page = new Page();
$page->Title = _t('EpaydkPayment.REDIRECTTOEPAY', 'Redirection to ePay...');
$page->Logo = '<img src="' . self::$logo . '" alt="' . _t('EpaydkPayment.POWEREDBYEPAY', "Payments powered by ePay") . '"/>';
$page->Form = $this->getEPayForm();
$controller = new Page_Controller($page);
$renderedpage = $controller->renderWith('PaymentProcessingPage');
return new Payment_Processing($renderedpage);
}
示例8: processPayment
function processPayment($data, $form)
{
$page = new Page();
$page->Title = "Make payment";
$page->Form = $this->PaymateForm($data);
$page->Logo = '<img src="https://www.paymate.com/PayMate/prep/images/paymate_exp_logo.gif" alt="Credit card payments powered by Paymate" title="Credit card payments powered by Paymate" />';
$controller = new Page_Controller($page);
$form = $controller->renderWith("PaymentProcessingPage");
return new Payment_Processing($form);
}
示例9: processPayment
function processPayment($data, $form)
{
$page = new Page();
$page->Title = 'Redirection to PayPal...';
$page->Logo = '<img src="' . self::$logo . '" alt="Payments powered by PayPal"/>';
$page->Form = $this->PayPalForm();
$controller = new Page_Controller($page);
$form = $controller->renderWith('PaymentProcessingPage');
return new Payment_Processing($form);
}
示例10: processPayment
function processPayment($data, $form)
{
//check for correct set up info
if (!self::$paystation_id) {
user_error('No paystation id specified. Use PaystationHostedPayment::set_paystation_id() in your _config.php file.', E_USER_ERROR);
}
if (!self::$gateway_id) {
user_error('No gateway id specified. Use PaystationHostedPayment::set_gateway_id() in your _config.php file.', E_USER_ERROR);
}
//merchant Session: built from (php session id)-(payment id) to ensure uniqueness
$this->MerchantSession = session_id() . "-" . $this->ID;
//set up required parameters
$data = array('paystation' => '_empty', 'pstn_pi' => self::$paystation_id, 'pstn_gi' => self::$gateway_id, 'pstn_ms' => $this->MerchantSession, 'pstn_am' => $this->Amount * 100);
//add optional parameters
//$data['pstn_cu'] = //currency
if (self::$test_mode) {
$data['pstn_tm'] = 't';
}
//test mode
if (self::$merchant_ref) {
$data['pstn_mr'] = self::$merchant_ref;
}
//merchant refernece
//$data['pstn_ct'] = //card type
//$data['pstn_af'] = //ammount format
//Make POST request to Paystation via RESTful service
$paystation = new RestfulService(self::$url, 0);
//REST connection that will expire immediately
$paystation->httpHeader('Accept: application/xml');
$paystation->httpHeader('Content-Type: application/x-www-form-urlencoded');
$data = http_build_query($data);
$response = $paystation->request('', 'POST', $data);
$sxml = $response->simpleXML();
//set up a page for redirection
$page = new Page();
$page->Logo = '<img src="' . self::$logo . '" alt="Payments powered by Paystation"/>';
$controller = new Page_Controller($page);
if ($paymenturl = $sxml->DigitalOrder) {
//TODO: store order details
$page->Title = 'Redirection to Paystation...';
$page->Loading = true;
$page->Message = "redirecting to paystation payment";
$page->ExtraMeta = '<meta http-equiv="Refresh" content="1;url=' . $paymenturl . '"/>';
$this->Status = 'Incomplete';
$this->write();
Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
//Requirements::block(THIRDPARTY_DIR."/jquery/jquery.js");
//Requirements::javascript(Director::protocol()."ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js");
$output = $controller->renderWith('PaymentProcessingPage');
Director::redirect($paymenturl);
//redirect to payment gateway
return new Payment_Processing($output);
}
if (isset($sxml->PaystationErrorCode) && $sxml->PaystationErrorCode > 0) {
//provide useful feedback on failure
$error = $sxml->PaystationErrorCode . " " . $sxml->PaystationErrorMessage;
$this->Message = $error;
$this->Status = 'Failure';
$this->write();
//user_error('Paystation error: $error');
return new Payment_Failure($sxml->PaystationErrorMessage);
}
//else recieved bad xml or transaction falied for an unknown reason
//what should happen here?
return new Payment_Failure("Unknown error");
}
开发者ID:helpfulrobot,项目名称:sunnysideup-payment-paystation-hosted,代码行数:66,代码来源:ImprovedPaystationHostedPayment.php