Mage_AmazonPayments_CbaController Class Reference

Inheritance diagram for Mage_AmazonPayments_CbaController:

Mage_Core_Controller_Front_Action Mage_Core_Controller_Varien_Action

List of all members.

Public Member Functions

 getCheckout ()
 getCba ()
 successAction ()
 callbackAction ()
 notificationAction ()
 cancelAction ()


Detailed Description

Definition at line 27 of file CbaController.php.


Member Function Documentation

callbackAction (  ) 

When Amazon return callback request for calculation shipping, taxes and etc.

Definition at line 103 of file CbaController.php.

00104     {
00105         $response = '';
00106         $session = $this->getCheckout();
00107 
00108         $_request = Mage::app()->getRequest()->getParams();
00109 
00110         try {
00111             if ($_request) {
00112                 $response = $this->getCba()->handleCallback($_request);
00113             } else {
00114                 $e = new Exception('Inavlid Shipping Address');
00115             }
00116         }
00117         catch (Exception $e) {
00118             // Return Xml with Error
00119             $response = $this->getCba()->callbackXmlError($e);
00120         }
00121         echo $response;
00122         exit(0);
00123     }

cancelAction (  ) 

When a customer has checkout on Amazon and return with Cancel

Definition at line 148 of file CbaController.php.

00149     {
00150         $session = $this->getCheckout();
00151         if ($quoteId = $session->getAmazonQuoteId()) {
00152             $quote = Mage::getModel('sales/quote')->load($quoteId);
00153             $quote->setIsActive(true);
00154             $quote->save();
00155             $session->setQuoteId($quoteId);
00156         }
00157         if ($this->getCba()->getDebug()) {
00158             $_request = Mage::app()->getRequest()->getParams();
00159             $debug = Mage::getModel('amazonpayments/api_debug')
00160                 ->setResponseBody(print_r($_request, 1))
00161                 ->setRequestBody(time() .' - cancel')
00162                 ->save();
00163         }
00164         $this->_redirect('checkout/cart/');
00165     }

getCba (  ) 

Get singleton with Checkout by Amazon order transaction information

Returns:
Mage_AmazonPayments_Model_Payment_CBA

Definition at line 44 of file CbaController.php.

00045     {
00046         return Mage::getSingleton('amazonpayments/payment_cba');
00047     }

getCheckout (  ) 

Get checkout session namespace

Returns:
Mage_Checkout_Model_Session

Definition at line 34 of file CbaController.php.

00035     {
00036         return Mage::getSingleton('checkout/session');
00037     }

notificationAction (  ) 

Definition at line 125 of file CbaController.php.

00126     {
00127         $response = '';
00128         $session = $this->getCheckout();
00129 
00130         $_request = Mage::app()->getRequest()->getParams();
00131 
00132         try {
00133             $this->getCba()
00134                 ->handleNotification($_request);
00135         }
00136         catch (Exception $e) {
00137             // Return Xml with Error
00138             $response = $this->getCba()->callbackXmlError($e);
00139         }
00140         $this->getResponse()
00141             ->setHttpResponseCode(200);
00142     }

successAction (  ) 

When a customer has checkout on Amazon and return with Successful payment

Definition at line 87 of file CbaController.php.

00088     {
00089         #$amazonOrderID = Mage::app()->getRequest()->getParam('amznPmtsOrderIds');
00090         #$referenceId = Mage::app()->getRequest()->getParam('amznPmtsOrderIds');
00091 
00092         $this->getCba()->returnAmazon();
00093 
00094         $this->loadLayout();
00095         #$this->_initLayoutMessages('amazonpayments/session');
00096         $this->renderLayout();
00097     }


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