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


PHP Mage_Paypal_Model_Config::getExpressCheckoutCompleteUrl方法代码示例

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


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

示例1: placeOrder

 /**
  * Place the order when customer returned from paypal
  * Until this moment all quote data must be valid
  *
  * @param string $token
  * @param string $shippingMethodCode
  * @return Mage_Sales_Model_Order
  */
 public function placeOrder($token, $shippingMethodCode = null)
 {
     if ($shippingMethodCode) {
         $this->updateShippingMethod($shippingMethodCode);
     }
     if (!$this->_quote->getCustomerId()) {
         $this->_quote->setCustomerIsGuest(true)->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)->setCustomerEmail($this->_quote->getBillingAddress()->getEmail());
     }
     $this->_ignoreAddressValidation();
     $order = Mage::getModel('sales/service_quote', $this->_quote)->submit();
     $this->_quote->save();
     // commence redirecting to finish payment, if paypal requires it
     if ($order->getPayment()->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_REDIRECT)) {
         $this->_redirectUrl = $this->_config->getExpressCheckoutCompleteUrl($token);
     }
     switch ($order->getState()) {
         // even after placement paypal can disallow to authorize/capture, but will wait until bank transfers money
         case Mage_Sales_Model_Order::STATE_PENDING_PAYMENT:
             // TODO
             break;
             // regular placement, when everything is ok
         // regular placement, when everything is ok
         case Mage_Sales_Model_Order::STATE_PROCESSING:
         case Mage_Sales_Model_Order::STATE_COMPLETE:
             $order->sendNewOrderEmail();
             break;
     }
     return $order;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:37,代码来源:Checkout.php

示例2: place

 /**
  * Place the order and recurring payment profiles when customer returned from paypal
  * Until this moment all quote data must be valid
  *
  * @param string $token
  * @param string $shippingMethodCode
  */
 public function place($token, $shippingMethodCode = null)
 {
     if ($shippingMethodCode) {
         $this->updateShippingMethod($shippingMethodCode);
     }
     $isNewCustomer = false;
     switch ($this->getCheckoutMethod()) {
         case Mage_Checkout_Model_Type_Onepage::METHOD_GUEST:
             $this->_prepareGuestQuote();
             break;
         case Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER:
             $this->_prepareNewCustomerQuote();
             $isNewCustomer = true;
             break;
         default:
             $this->_prepareCustomerQuote();
             break;
     }
     $this->_ignoreAddressValidation();
     $this->_quote->collectTotals();
     $parameters = array('quote' => $this->_quote);
     $service = Mage::getModel('Mage_Sales_Model_Service_Quote', $parameters);
     $service->submitAll();
     $this->_quote->save();
     if ($isNewCustomer) {
         try {
             $this->_involveNewCustomer();
         } catch (Exception $e) {
             Mage::logException($e);
         }
     }
     $this->_recurringPaymentProfiles = $service->getRecurringPaymentProfiles();
     // TODO: send recurring profile emails
     $order = $service->getOrder();
     if (!$order) {
         return;
     }
     $this->_billingAgreement = $order->getPayment()->getBillingAgreement();
     // commence redirecting to finish payment, if paypal requires it
     if ($order->getPayment()->getAdditionalInformation(Mage_Paypal_Model_Express_Checkout::PAYMENT_INFO_TRANSPORT_REDIRECT)) {
         $this->_redirectUrl = $this->_config->getExpressCheckoutCompleteUrl($token);
     }
     switch ($order->getState()) {
         // even after placement paypal can disallow to authorize/capture, but will wait until bank transfers money
         case Mage_Sales_Model_Order::STATE_PENDING_PAYMENT:
             // TODO
             break;
             // regular placement, when everything is ok
             // regular placement, when everything is ok
         // regular placement, when everything is ok
         // regular placement, when everything is ok
         case Mage_Sales_Model_Order::STATE_PROCESSING:
         case Mage_Sales_Model_Order::STATE_COMPLETE:
         case Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW:
             $order->sendNewOrderEmail();
             break;
     }
     $this->_order = $order;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:66,代码来源:Checkout.php


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