Example #1
0
 /**
  * Instantiate state and set it to state object
  * 
  * @param string $paymentAction
  * @param Varien_Object $stateObject
  */
 public function initialize($paymentAction, $stateObject)
 {
     $stateObject->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT);
     $stateObject->setStatus('pending_payment');
     $stateObject->setIsNotified(false);
     $stateObject->save();
 }
Example #2
0
 /**
  * Instantiate state and set it to state object
  *
  * @param string $paymentAction
  * @param Varien_Object $stateObject
  * @SuppressWarnings("unused")
  */
 public function initialize($action, $stateObject)
 {
     if ($status = $this->getConfigData('order_status')) {
         $stateObject->setStatus($status);
         $state = $this->_getAssignedState($status);
         $stateObject->setState($state);
         $stateObject->setIsNotified(true);
     }
     return $this;
 }
 /**
  * set the state and status of order
  * will be executed instead of authorize()
  * 
  * @param string $paymentAction
  * @param Varien_Object $stateObject
  * @return Paymentnetwork_Pnsofortueberweisung_Model_Pnsofort
  */
 public function initialize($paymentAction, $stateObject)
 {
     $holdingStatus = Mage::getStoreConfig('payment/sofort/pnsofort_order_status_holding', $this->getStore());
     if ($holdingStatus == 'unchanged') {
         return $this;
     }
     $stateObject->setState(Mage_Sales_Model_Order::STATE_HOLDED);
     $stateObject->setStatus($holdingStatus);
     $stateObject->setIsNotified(false);
     return $this;
 }
 /**
  * Instantiate state and set it to state object
  *
  * @param       string            $paymentAction
  * @param       Varien_Object     $stateObject
  */
 public function initialize($paymentAction, $stateObject)
 {
     $stateObject->setData('payment_action', $paymentAction);
     $stateObject->setState(MageOrder::STATE_PENDING_PAYMENT);
     $stateObject->setStatus('pending_payment');
     $stateObject->setIsNotified(false);
     $stateObject->save();
     if (empty($this->_code)) {
         throw new RuntimeException('Internal model code must be setted');
     }
     if (empty($this->_formBlockType)) {
         throw new RuntimeException('Name for the block with additional payment method information must be setted');
     }
     if (empty($this->_initialApiMethod)) {
         throw new RuntimeException('Initial API method for model payment flow must be setted');
     }
 }
 /**
  * Instantiate state and set it to state object
  *
  * @param string $paymentAction
  * @param Varien_Object $stateObject
  */
 public function initialize($paymentAction, $stateObject)
 {
     switch ($paymentAction) {
         case Mage_Paypal_Model_Config::PAYMENT_ACTION_AUTH:
         case Mage_Paypal_Model_Config::PAYMENT_ACTION_SALE:
             $payment = $this->getInfoInstance();
             $order = $payment->getOrder();
             $order->setCanSendNewEmailFlag(false);
             $payment->setAmountAuthorized($order->getTotalDue());
             $payment->setBaseAmountAuthorized($order->getBaseTotalDue());
             $this->_generateSecureSilentPostHash($payment);
             $request = $this->_buildTokenRequest($payment);
             $response = $this->_postRequest($request);
             $this->_processTokenErrors($response, $payment);
             $order = $payment->getOrder();
             $order->setCanSendNewEmailFlag(false);
             $stateObject->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT);
             $stateObject->setStatus('pending_payment');
             $stateObject->setIsNotified(false);
             break;
         default:
             break;
     }
 }
Example #6
0
 /**
  * Instantiate state and set it to state object
  *
  * @param string $paymentAction
  * @param Varien_Object $stateObject
  */
 public function initialize($paymentAction, $stateObject)
 {
     switch ($paymentAction) {
         case Mage_Paypal_Model_Config::PAYMENT_ACTION_AUTH:
         case Mage_Paypal_Model_Config::PAYMENT_ACTION_SALE:
             $payment = $this->getInfoInstance();
             $order = $payment->getOrder();
             $order->setCanSendNewEmailFlag(false);
             $payment->setAmountAuthorized($order->getTotalDue());
             $payment->setBaseAmountAuthorized($order->getBaseTotalDue());
             $this->_setPaymentFormUrl($payment);
             $stateObject->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT);
             $stateObject->setStatus('pending_payment');
             $stateObject->setIsNotified(false);
             break;
         default:
             break;
     }
 }
Example #7
0
 /**
  * Method that will be executed instead of authorize or capture
  * if flag isInitilizeNeeded set to true
  *
  * @param   string $paymentAction
  * @param   Varien_Object $stateObject
  * @return  Mage_Payment_Model_Abstract
  */
 public function initialize($paymentAction, $stateObject)
 {
     $state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
     $stateObject->setState($state);
     $stateObject->setStatus(self::ORDER_STATUS);
     $stateObject->setIsNotified(false);
 }
Example #8
0
 /**
  * Instantiate state and set it to state object
  *
  * @param string $paymentAction
  * @param Varien_Object $stateObject
  */
 public function initialize($paymentAction, $stateObject)
 {
     switch ($paymentAction) {
         case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE:
         case Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE:
             $payment = $this->getInfoInstance();
             $order = $payment->getOrder();
             $order->setCanSendNewEmailFlag(false);
             $payment->setAmountAuthorized($order->getTotalDue());
             $payment->setBaseAmountAuthorized($order->getBaseTotalDue());
             $stateObject->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT);
             $stateObject->setStatus('pending_payment');
             $stateObject->setIsNotified(false);
             break;
         default:
             break;
     }
 }
Example #9
0
 /**
  * This method is called during order creation to initialize the payment.
  *
  * @param string $paymentAction
  * @param Varien_Object $stateObject
  * @return Customweb_SaferpayCw_Model_Method
  */
 public function initialize($paymentAction, $stateObject)
 {
     $stateObject->setStatus(self::SAFERPAYCW_STATUS_PENDING);
     $stateObject->setState(self::STATE_PENDING);
     $stateObject->setIsNotified(false);
     return $this;
 }