当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Sales_Model_Order_Payment::getOrder方法代码示例

本文整理汇总了PHP中Mage_Sales_Model_Order_Payment::getOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Payment::getOrder方法的具体用法?PHP Mage_Sales_Model_Order_Payment::getOrder怎么用?PHP Mage_Sales_Model_Order_Payment::getOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Sales_Model_Order_Payment的用法示例。


在下文中一共展示了Mage_Sales_Model_Order_Payment::getOrder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _place

 public function _place(Mage_Sales_Model_Order_Payment $payment, $amount)
 {
     $order = $payment->getOrder();
     $items = Mage::helper('iugu')->getItemsFromOrder($payment->getOrder());
     $payer = Mage::helper('iugu')->getPayerInfoFromOrder($payment->getOrder());
     $data = new Varien_Object();
     $data->setMethod(Inovarti_Iugu_Model_Api::PAYMENT_METHOD_BOLETO)->setEmail($order->getCustomerEmail())->setItems($items)->setPayer($payer)->setNotificationUrl(Mage::getUrl('iugu/notification'));
     // Discount
     if ($order->getBaseDiscountAmount()) {
         $data->setDiscountCents(Mage::helper('iugu')->formatAmount(abs($order->getBaseDiscountAmount())));
     }
     // Tax
     if ($order->getBaseTaxAmount()) {
         $data->setTaxCents($this->formatAmount($order->getBaseTaxAmount()));
     }
     $result = Mage::getSingleton('iugu/api')->charge($data);
     if ($result->getErrors()) {
         $messages = array();
         if (is_array($result->getErrors())) {
             foreach ($result->getErrors() as $field => $errors) {
                 foreach ($errors as $error) {
                     $messages[] = $field . ': ' . $error . '.';
                 }
             }
         } else {
             $messages[] = $result->getErrors();
         }
         Mage::throwException(implode("\n", $messages));
     }
     // iugu info
     $payment->setIuguInvoiceId($result->getInvoiceId())->setIuguUrl($result->getUrl())->setIuguPdf($result->getPdf());
     return $this;
 }
开发者ID:thiagormartins,项目名称:iugu-magento,代码行数:33,代码来源:Boleto.php

示例2: determineIsPartial

 /**
  * Checks if partial capture
  *
  * @param Mage_Sales_Model_Order_Payment $payment
  * @param float $amount
  * @return bool
  */
 public function determineIsPartial($payment, $amount)
 {
     $grandTotal = $payment->getOrder()->getGrandTotal();
     if ($grandTotal != $amount) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:nomade-it,项目名称:MagentoPostFinance,代码行数:16,代码来源:Capture.php

示例3: _place

 public function _place(Mage_Sales_Model_Order_Payment $payment, $amount)
 {
     $order = $payment->getOrder();
     $customer = Mage::helper('pagarme')->getCustomerInfoFromOrder($payment->getOrder());
     $data = new Varien_Object();
     $data->setPaymentMethod(Inovarti_Pagarme_Model_Api::PAYMENT_METHOD_BOLETO)->setAmount(Mage::helper('pagarme')->formatAmount($amount))->setBoletoExpirationDate($this->_generateExpirationDate())->setCustomer($customer)->setPostbackUrl(Mage::getUrl('pagarme/transaction_boleto/postback'));
     $pagarme = Mage::getModel('pagarme/api');
     $transaction = $pagarme->charge($data);
     if ($transaction->getErrors()) {
         $messages = array();
         foreach ($transaction->getErrors() as $error) {
             $messages[] = $error->getMessage() . '.';
         }
         Mage::throwException(implode("\n", $messages));
     }
     // pagar.me info
     $payment->setPagarmeTransactionId($transaction->getId())->setPagarmeBoletoUrl($transaction->getBoletoUrl())->setPagarmeBoletoBarcode($transaction->getBoletoBarcode())->setPagarmeBoletoExpirationDate($transaction->getBoletoExpirationDate());
     return $this;
 }
开发者ID:hiuryanderson,项目名称:pagarme-magento,代码行数:19,代码来源:Boleto.php

示例4: getOrderId

 /**
  * Order ID getter
  * Attempts to get ID from set order payment object, if any, or from data by key 'order_id'
  * @return int|null
  */
 public function getOrderId()
 {
     $orderId = $this->_getData('order_id');
     if ($orderId) {
         return $orderId;
     }
     if ($this->_paymentObject) {
         return $this->_paymentObject->getOrder() ? $this->_paymentObject->getOrder()->getId() : $this->_paymentObject->getParentId();
     }
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:15,代码来源:Transaction.php

示例5: _placeOrder

 /**
  * 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;
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:18,代码来源:Agreement.php

示例6: _placeOrder

 /**
  * 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;
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:19,代码来源:Agreement.php

示例7: _place

 public function _place(Mage_Sales_Model_Order_Payment $payment, $amount)
 {
     try {
         $order = $payment->getOrder();
         $azpay = new AZPay($this->_merchantId, $this->_merchantKey);
         $azpay->curl_timeout = 60;
         $azpay->config_order['reference'] = $order->getRealOrderId();
         $azpay->config_order['totalAmount'] = Mage::helper('azpay')->formatAmount($amount);
         $azpay->config_options['urlReturn'] = Mage::getUrl('azpay/transaction_boleto/postback');
         /*$azpay->config_boleto['acquirer'] = $this->getConfigData('operator');
           $azpay->config_boleto['expire'] = $this->_generateExpirationDate();
           $azpay->config_boleto['nrDocument'] = substr($order->getRealOrderId(), 1);
           $azpay->config_boleto['amount'] = Mage::helper('azpay')->formatAmount($amount);
           $azpay->config_boleto['instructions'] = $this->getConfigData('instructions');*/
         $azpay->config_online_debit['acquirer'] = $this->getConfigData('operator');
         $billingAddress = $order->getBillingAddress();
         if ($order->getCustomerTaxvat()) {
             $azpay->config_billing['customerIdentity'] = $order->getCustomerTaxvat();
         } else {
             $azpay->config_billing['customerIdentity'] = $order->getRealOrderId();
         }
         $azpay->config_billing['name'] = $order->getCustomerName();
         $azpay->config_billing['address'] = $billingAddress->getStreet(1) . ',' . $billingAddress->getStreet(2);
         $azpay->config_billing['address2'] = $billingAddress->getStreet(3) ? $billingAddress->getStreet(3) : '';
         $azpay->config_billing['city'] = $billingAddress->getCity();
         $azpay->config_billing['state'] = $billingAddress->getRegionCode();
         $azpay->config_billing['postalCode'] = Zend_Filter::filterStatic($billingAddress->getPostcode(), 'Digits');
         $azpay->config_billing['phone'] = Mage::helper('azpay')->splitTelephone($billingAddress->getTelephone());
         $azpay->config_billing['email'] = $order->getCustomerEmail();
         $azpay->config_options['urlReturn'] = Mage::getUrl('azpay/transaction_boleto/postback');
         // Execute
         $azpay->online_debit()->execute();
         $azpay->getXml();
         // usado para salvar o XML gerado no log
         // Log
         if ($this->getConfigData('log')) {
             Mage::log($azpay, null, "azpay_boleto.log");
         }
     } catch (AZPay_Error $e) {
         Mage::log($e->getMessage(), null, "azpay_boleto_error.log");
         $error = $azpay->responseError();
         return Mage::throwException("Ocorreu um problema com o seu pedido. Tente novamente ou entre em contato conosco informando este código: " . $error['status_message']);
     }
     // Response
     $gateway_response = $azpay->response();
     $paymentDetails['azpayboletourl'] = (string) $gateway_response->processor->Transfer->urlTransfer;
     $payment->setAdditionalData(serialize($paymentDetails));
     // azpay info
     $payment->setAzpayTransactionId($gateway_response->transactionId)->setAzpayBoletoUrl((string) $gateway_response->processor->Transfer->urlTransfer);
     return $this;
 }
开发者ID:AZPay,项目名称:Magento-Azpay,代码行数:51,代码来源:Boleto.php

示例8: getVaultParams

 /**
  * @param Mage_Sales_Model_Order_Payment $payment
  * @return 	array
  */
 protected function getVaultParams($payment)
 {
     $params = array();
     $params['card_number'] = $payment->getCcNumber();
     $params['card_expiry_month'] = $payment->getCcExpMonth() < 10 ? '0' . $payment->getCcExpMonth() : $payment->getCcExpMonth();
     $params['card_expiry_year'] = $payment->getCcExpYear();
     $params['cvc'] = $payment->getCcCid();
     $params['multi_use'] = 1;
     //Add card holder
     $billing = $payment->getOrder()->getBillingAddress();
     $defaultOwner = $billing->getFirstname() && $billing->getLastname() ? $billing->getFirstname() . ' ' . $billing->getLastname() : $billing->getEmail();
     $params['card_holder'] = $payment->getCcOwner() ? $payment->getCcOwner() : $defaultOwner;
     $this->_debug($params);
     return $params;
 }
开发者ID:hipay,项目名称:hipay-fullservice-sdk-magento1,代码行数:19,代码来源:Cc.php

示例9: setOrder

 /**
  * Set order instance for transaction depends on transaction behavior
  * If $order equals to true, method isn't loading new order instance.
  *
  * @param Mage_Sales_Model_Order|null|boolean $order
  * @return Mage_Sales_Model_Order_Payment_Transaction
  */
 public function setOrder($order = null)
 {
     if (null === $order || $order === true) {
         if (null !== $this->_paymentObject && $this->_paymentObject->getOrder()) {
             $this->_order = $this->_paymentObject->getOrder();
         } elseif ($this->getOrderId() && $order === null) {
             $this->_order = Mage::getModel('sales/order')->load($this->getOrderId());
         } else {
             $this->_order = false;
         }
     } elseif (!$this->getId() || $this->getOrderId() == $order->getId()) {
         $this->_order = $order;
     } else {
         Mage::throwException(Mage::helper('sales')->__('Set order for existing transactions not allowed'));
     }
     return $this;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:24,代码来源:Transaction.php

示例10: _placeOrder

 /**
  * 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();
     $billingAgreement = Mage::getModel('sales/billing_agreement')->load($payment->getAdditionalInformation(Mage_Sales_Model_Payment_Method_Billing_AgreementAbstract::TRANSPORT_BILLING_AGREEMENT_ID));
     $api = $this->_pro->getApi()->setReferenceId($billingAgreement->getReferenceId())->setPaymentAction($this->_pro->getConfig()->paymentAction)->setAmount($amount)->setNotifyUrl(Mage::getUrl('paypal/ipn/'))->setPaypalCart(Mage::getModel('paypal/cart', array($order)))->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled);
     // 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);
     if ($api->getBillingAgreementId()) {
         $order->addRelatedObject($billingAgreement);
         $billingAgreement->setIsObjectChanged(true);
         $billingAgreement->addOrderRelation($order);
     }
     return $this;
 }
开发者ID:njaeger,项目名称:magento_github,代码行数:25,代码来源:Agreement.php

示例11: _buildRequest

 /**
  * Build the request with necessary parameters for doAuthorisation() and doTransaction()
  *
  * @param Mage_Sales_Model_Order_Payment $payment
  * @param $amount
  * @return Eway_Rapid31_Model_Request_Direct
  */
 protected function _buildRequest(Mage_Sales_Model_Order_Payment $payment, $amount)
 {
     // Empty Varien_Object's data
     $this->unsetData();
     $methodInstance = $payment->getMethodInstance();
     $infoInstance = $methodInstance->getInfoInstance();
     $order = $payment->getOrder();
     $billing = $order->getBillingAddress();
     $shipping = $order->getShippingAddress();
     $this->setCustomerIP(Mage::helper('core/http')->getRemoteAddr());
     if (Mage::helper('ewayrapid')->isBackendOrder()) {
         $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_MOTO);
     } else {
         $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_PURCHASE);
     }
     $this->setDeviceID('Magento ' . Mage::getEdition() . ' ' . Mage::getVersion());
     $this->setShippingMethod('Other');
     $paymentParam = Mage::getModel('ewayrapid/field_payment');
     $paymentParam->setTotalAmount($amount)->setCurrencyCode($order->getBaseCurrencyCode());
     $this->setPayment($paymentParam);
     $customerParam = Mage::getModel('ewayrapid/field_customer');
     $customerParam->setTitle($billing->getPrefix())->setFirstName($billing->getFirstname())->setLastName($billing->getLastname())->setCompanyName($billing->getCompany())->setJobDescription('')->setStreet1($billing->getStreet1())->setStreet2($billing->getStreet2())->setCity($billing->getCity())->setState($billing->getRegion())->setPostalCode($billing->getPostcode())->setCountry(strtolower($billing->getCountryModel()->getIso2Code()))->setEmail($billing->getEmail())->setPhone($billing->getTelephone())->setMobile('')->setComments('')->setFax($billing->getFax())->setUrl('');
     $cardDetails = Mage::getModel('ewayrapid/field_cardDetails');
     $cardDetails->setName($infoInstance->getCcOwner())->setNumber($infoInstance->getCcNumber())->setExpiryMonth($infoInstance->getCcExpMonth())->setExpiryYear($infoInstance->getCcExpYear())->setCVN($infoInstance->getCcCid());
     $customerParam->setCardDetails($cardDetails);
     $this->setCustomer($customerParam);
     $shippingParam = Mage::getModel('ewayrapid/field_shippingAddress');
     $shippingParam->setFirstName($shipping->getFirstname())->setLastName($shipping->getLastname())->setStreet1($shipping->getStreet1())->setStreet2($shipping->getStreet2())->setCity($shipping->getCity())->setState($shipping->getRegion())->setPostalCode($shipping->getPostcode())->setCountry(strtolower($shipping->getCountryModel()->getIso2Code()))->setEmail($shipping->getEmail())->setPhone($shipping->getTelephone())->setFax($shipping->getFax());
     $this->setShippingAddress($shippingParam);
     if ($methodInstance->getConfigData('transfer_cart_items')) {
         $orderItems = $order->getAllVisibleItems();
         $lineItems = array();
         foreach ($orderItems as $orderItem) {
             /* @var Mage_Sales_Model_Order_Item $orderItem */
             $lineItem = Mage::getModel('ewayrapid/field_lineItem');
             $lineItem->setSKU($orderItem->getSku());
             $lineItem->setDescription(substr($orderItem->getName(), 0, 26));
             $lineItem->setQuantity($orderItem->getQtyOrdered());
             $lineItem->setUnitCost(round($orderItem->getBasePrice() * 100));
             $lineItem->setTax(round($orderItem->getBaseTaxAmount() * 100));
             $lineItem->setTotal(round($orderItem->getBaseRowTotalInclTax() * 100));
             $lineItems[] = $lineItem;
         }
         $this->setItems($lineItems);
     }
     return $this;
 }
开发者ID:programmerrahul,项目名称:vastecom,代码行数:54,代码来源:Direct.php

示例12: _placeOrder

 /**
  * 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();
     $billingAgreement = Mage::getModel('sales/billing_agreement')->load($payment->getAdditionalInformation(Mage_Sales_Model_Payment_Method_Billing_AgreementAbstract::TRANSPORT_BILLING_AGREEMENT_ID));
     $api = $this->_pro->getApi()->setReferenceId($billingAgreement->getReferenceId())->setPaymentAction($this->_pro->getConfig()->paymentAction)->setAmount($amount)->setNotifyUrl(Mage::getUrl('paypal/ipn/'));
     // add line items
     if ($this->_pro->getConfig()->lineItemsEnabled) {
         list($items, $totals) = Mage::helper('paypal')->prepareLineItems($order);
         if (Mage::helper('paypal')->areCartLineItemsValid($items, $totals, $amount)) {
             $api->setLineItems($items)->setLineItemTotals($totals);
         }
     }
     // 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);
     if ($api->getBillingAgreementId()) {
         $billingAgreement->addOrderRelation($order->getId());
     }
     return $this;
 }
开发者ID:jweiss,项目名称:Magento-Example,代码行数:30,代码来源:Agreement.php

示例13: prepareInvoice

 /**
  * Prepares the invoice object to be sent to BitPay's API. This method sets
  * all the other info that we have to rely on other objects for.
  *
  * @param Bitpay\Invoice                  $invoice
  * @param  Mage_Sales_Model_Order_Payment $payment
  * @param  float                          $amount
  * @return Bitpay\Invoice
  */
 private function prepareInvoice($invoice, $payment, $amount)
 {
     if (false === isset($invoice) || true === empty($invoice) || false === isset($payment) || true === empty($payment) || false === isset($amount) || true === empty($amount)) {
         $this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::prepareInvoice(): missing or invalid invoice, payment or amount parameter.');
         throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::prepareInvoice(): missing or invalid invoice, payment or amount parameter.');
     } else {
         $this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::prepareInvoice(): entered function with good invoice, payment and amount parameters.');
     }
     $invoice->setOrderId($payment->getOrder()->getIncrementId());
     $invoice->setPosData(json_encode(array('id' => $payment->getOrder()->getIncrementId())));
     $invoice = $this->addCurrencyInfo($invoice, $payment->getOrder());
     $invoice = $this->addPriceInfo($invoice, $amount);
     $invoice = $this->addBuyerInfo($invoice, $payment->getOrder());
     return $invoice;
 }
开发者ID:sanjay-wagento,项目名称:magento-plugin,代码行数:24,代码来源:Bitcoin.php

示例14: _placeOrder

 /**
  * Place an order with authorization or capture action
  *
  * @param Mage_Sales_Model_Order_Payment $payment
  * @param float $amount
  * @return Mage_Paypal_Model_Express
  */
 protected function _placeOrder(Mage_Sales_Model_Order_Payment $payment, $amount)
 {
     $order = $payment->getOrder();
     // prepare api call
     $token = $payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_TOKEN);
     $api = $this->_pro->getApi()->setToken($token)->setPayerId($payment->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID))->setAmount($amount)->setPaymentAction($this->_pro->getConfig()->paymentAction)->setNotifyUrl(Mage::getUrl('paypal/ipn/'))->setInvNum($order->getIncrementId())->setCurrencyCode($order->getBaseCurrencyCode())->setPaypalCart(Mage::getModel('paypal/cart', array($order)))->setIsLineItemsEnabled($this->_pro->getConfig()->lineItemsEnabled);
     // call api and get details from it
     $api->callDoExpressCheckoutPayment();
     $this->_importToPayment($api, $payment);
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:18,代码来源:Express.php

示例15: _placeOfflineTransaction

 /**
  *
  * Requests coming from admin are offline transactions. These don't need to be sent via the PinPayments gateway
  * as they've already been processed.  Simply record the transaction ID supplied by the admin.
  *
  * @param Mage_Sales_Model_Order_Payment $payment
  * @param $amount
  * @param $transactionId
  */
 protected function _placeOfflineTransaction($payment, $amount)
 {
     $payment->setAmount($amount);
     $payment->getOrder()->setCustomerNote("Creating offline PinPayments transaction");
     $transactionId = $payment->getAdditionalInformation('offline_transaction_id');
     $payment->setCcTransId($transactionId);
     $payment->setTransactionId($transactionId);
 }
开发者ID:andrew-dwyer,项目名称:PINpayments,代码行数:17,代码来源:PaymentMethod.php


注:本文中的Mage_Sales_Model_Order_Payment::getOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。