00001 <?php
00002
00003 class Mage_Paypal_Block_Standard_Redirect extends Mage_Core_Block_Abstract
00004 {
00005 protected function _toHtml()
00006 {
00007 $standard = Mage::getModel('paypal/standard');
00008
00009 $form = new Varien_Data_Form();
00010 $form->setAction($standard->getPaypalUrl())
00011 ->setId('paypal_standard_checkout')
00012 ->setName('paypal_standard_checkout')
00013 ->setMethod('POST')
00014 ->setUseContainer(true);
00015 foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) {
00016 $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
00017 }
00018 $html = '<html><body>';
00019 $html.= $this->__('You will be redirected to Paypal in a few seconds.');
00020 $html.= $form->toHtml();
00021 $html.= '<script type="text/javascript">document.getElementById("paypal_standard_checkout").submit();</script>';
00022 $html.= '</body></html>';
00023
00024 return $html;
00025 }
00026 }