コード例 #1
0
ファイル: QueueController.php プロジェクト: asarturas/magento
 /**
  * Event queue ajax grid
  */
 public function gridAction()
 {
     try {
         $this->loadLayout()->renderLayout();
         return;
     } catch (Mage_Core_Exception $e) {
         $this->_getSession()->addError($e->getMessage());
     } catch (Exception $e) {
         Adyen_Payment_Exception::logException($e);
     }
     $this->_redirect('*/*/');
 }
コード例 #2
0
ファイル: Observer.php プロジェクト: miltoncff/magento
 /**
  * @event controller_action_predispatch
  * @param Varien_Event_Observer $observer
  */
 public function addMethodsToConfig(Varien_Event_Observer $observer)
 {
     if (Mage::app()->getStore()->isAdmin()) {
         $store = Mage::getSingleton('adminhtml/session_quote')->getStore();
     } else {
         $store = Mage::app()->getStore();
     }
     if (Mage::getStoreConfigFlag('payment/adyen_oneclick/active', $store)) {
         try {
             $this->_addOneClickMethodsToConfig($store);
             $store->setConfig('payment/adyen_oneclick/active', 0);
         } catch (Exception $e) {
             Adyen_Payment_Exception::logException($e);
         }
     }
 }
コード例 #3
0
ファイル: Observer.php プロジェクト: Maikel-Koek/magento
 /**
  * @event controller_action_predispatch
  * @param Varien_Event_Observer $observer
  */
 public function addMethodsToConfig(Varien_Event_Observer $observer)
 {
     if (Mage::app()->getStore()->isAdmin()) {
         $store = Mage::getSingleton('adminhtml/session_quote')->getStore();
     } else {
         $store = Mage::app()->getStore();
     }
     // by default disable adyen_ideal only if IDeal is in directoryLookup result show this payment method
     $store->setConfig('payment/adyen_ideal/active', 0);
     if (Mage::getStoreConfigFlag('payment/adyen_hpp/active', $store)) {
         try {
             $this->_addHppMethodsToConfig($store);
         } catch (Exception $e) {
             $store->setConfig('payment/adyen_hpp/active', 0);
             Adyen_Payment_Exception::logException($e);
         }
     }
 }
コード例 #4
0
 public function insAction()
 {
     try {
         // if version is in the notification string show the module version
         $response = $this->getRequest()->getParams();
         if (isset($response['version'])) {
             $helper = Mage::helper('adyen');
             $this->getResponse()->setBody($helper->getExtensionVersion());
             return $this;
         }
         if (isset($response['magento_version'])) {
             $version = Mage::getVersion();
             $this->getResponse()->setBody($version);
             return $this;
         }
         $notificationMode = isset($response['live']) ? $response['live'] : "";
         if ($notificationMode != "" && $this->_validateNotificationMode($notificationMode)) {
             // add HTTP POST attributes as an array so it is the same as JSON and SOAP result
             foreach ($response as $key => $value) {
                 if (strpos($key, '_') !== false) {
                     $results = explode('_', $key);
                     $size = count($results);
                     if ($size == 2) {
                         $response[$results[0]][$results[1]] = $value;
                     } elseif ($size == 3) {
                         $response[$results[0]][$results[1]][$results[2]] = $value;
                     }
                 }
             }
             // create amount array so it is the same as JSON SOAP response
             $response['amount'] = array('value' => $response['value'], 'currency' => $response['currency']);
             $status = $this->processNotification($response);
             if ($status == "401") {
                 $this->_return401();
                 return;
             } else {
                 $this->getResponse()->clearHeader('Content-Type')->setHeader('Content-Type', 'text/html')->setBody("[accepted]");
                 return;
             }
         } else {
             if ($notificationMode == "") {
                 $this->_return401();
                 return;
             }
             Mage::throwException(Mage::helper('adyen')->__('Mismatch between Live/Test modes of Magento store and the Adyen platform.'));
             return;
         }
     } catch (Exception $e) {
         Adyen_Payment_Exception::logException($e);
     }
     return $this;
 }
コード例 #5
0
ファイル: Oneclick.php プロジェクト: asarturas/magento
 /**
  * @param Adyen_Payment_Model_Billing_Agreement $billingAgreement
  * @param Mage_Sales_Model_Quote_Payment        $paymentInfo
  *
  * @return $this
  */
 public function initBillingAgreementPaymentInfo(Adyen_Payment_Model_Billing_Agreement $billingAgreement, Mage_Sales_Model_Quote_Payment $paymentInfo)
 {
     try {
         $recurringDetailReference = $billingAgreement->getReferenceId();
         $paymentInfo->setMethod('adyen_oneclick_' . $recurringDetailReference);
         $paymentInfo->setAdditionalInformation('recurring_detail_reference', $recurringDetailReference);
         // set the ccType needed for Sepa, Sofort and Ideal
         $agreementData = $billingAgreement->getAgreementData();
         if (isset($agreementData['variant'])) {
             $paymentInfo->setCcType($agreementData['variant']);
         }
     } catch (Exception $e) {
         Adyen_Payment_Exception::logException($e);
     }
     return $this;
 }