Example #1
0
 /**
  * Place an order with authorization or capture action
  *
  * @param Mage_Sales_Model_Order_Payment $payment
  * @param float $amount
  * @return Mage_Paypal_Model_Method_Agreement
  */
 protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
 {
     $order = $payment->getOrder();
     $api = $this->_pro->getApi()->setBillingAgreementId($payment->getBillingAgreementId())->setPaymentAction($this->_pro->getConfig()->paymentAction)->setAmount($amount)->setNotifyUrl(Mage::getUrl('paypal/ipn/'))->setPaypalCart(Mage::getModel('paypal/cart', array($order)))->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled)->setInvNum($order->getIncrementId());
     // call api and import transaction and other payment information
     $api->callDoReferenceTransaction();
     $this->_pro->importPaymentInfo($api, $payment);
     $payment->setAdditionalInformation(CLS_Paypal_Model_Paypaluk_Api_Nvp::RESPONSE_MSG, $api->getResponseMsg())->setPreparedMessage(Mage::helper('cls_paypal')->__('Payflow PNREF: #%s.', $api->getTransactionId()))->setTransactionAdditionalInfo(Mage_PaypalUk_Model_Pro::TRANSPORT_PAYFLOW_TXN_ID, $api->getTransactionId());
     $payment->setTransactionId($api->getPaypalTransactionId())->setIsTransactionClosed(0);
     return $this;
 }
Example #2
0
 /**
  * Place an order with authorization or capture action
  *
  * @param Mage_Sales_Model_Order_Payment $payment
  * @param float $amount
  * @return CLS_Paypal_Model_Paypal_Method_Orderstored_Agreement
  */
 protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
 {
     $order = $payment->getOrder();
     $api = $this->_pro->getApi()->setReferenceId($payment->getBillingAgreementId())->setPaymentAction($this->_pro->getConfig()->paymentAction)->setAmount($amount)->setNotifyUrl(Mage::getUrl('paypal/ipn/'))->setPaypalCart(Mage::getModel('paypal/cart', array($order)))->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled)->setInvNum($order->getIncrementId());
     // call api and import transaction and other payment information
     $api->callDoReferenceTransaction();
     $this->_pro->importPaymentInfo($api, $payment);
     $api->callGetTransactionDetails();
     $this->_pro->importPaymentInfo($api, $payment);
     $payment->setTransactionId($api->getTransactionId())->setIsTransactionClosed(0);
     return $this;
 }