Protected Member Functions | |
_toHtml () |
Definition at line 34 of file Redirect.php.
_toHtml | ( | ) | [protected] |
Shopping cart form to CBA in case XML-based cart
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 41 of file Redirect.php.
00042 { 00043 $cba = Mage::getModel('amazonpayments/payment_cba'); 00044 /* @var $cba Mage_AmazonPayments_Model_Payment_Cba */ 00045 00046 $form = new Varien_Data_Form(); 00047 $form->setAction($cba->getAmazonRedirectUrl()) 00048 ->setId('amazonpayments_cba') 00049 ->setName('amazonpayments_cba') 00050 ->setMethod('POST') 00051 ->setUseContainer(true); 00052 00053 $formFields = $cba->getCheckoutXmlFormFields(); 00054 $values = ''; 00055 $i = 1; 00056 foreach ($formFields as $field=>$value) { 00057 $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value)); 00058 $values .= ($i++ > 1) ? '&' : ''; 00059 $values .= "{$field}={$value}"; 00060 } 00061 $html = '<html><body>'; 00062 $html.= $this->__('You will be redirected to Checkout by Amazon in a few seconds.'); 00063 $html.= $form->toHtml(); 00064 $html.= '<script type="text/javascript">document.getElementById("amazonpayments_cba").submit();</script>'; 00065 $html.= '</body></html>'; 00066 00067 return $html; 00068 }