Mage_AmazonPayments_Block_Cba_Redirect Class Reference

Inheritance diagram for Mage_AmazonPayments_Block_Cba_Redirect:

Mage_Core_Block_Abstract Varien_Object

List of all members.

Protected Member Functions

 _toHtml ()


Detailed Description

Definition at line 34 of file Redirect.php.


Member Function Documentation

_toHtml (  )  [protected]

Shopping cart form to CBA in case XML-based cart

Returns:
string

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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:30 2009 for Magento by  doxygen 1.5.8