當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataObject::setStatus方法代碼示例

本文整理匯總了PHP中Magento\Framework\DataObject::setStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataObject::setStatus方法的具體用法?PHP DataObject::setStatus怎麽用?PHP DataObject::setStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\DataObject的用法示例。


在下文中一共展示了DataObject::setStatus方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initialize

 /**
  * Instantiate state and set it to state object
  *
  * @param string $paymentAction
  * @param \Magento\Framework\DataObject $stateObject
  * @return void
  */
 public function initialize($paymentAction, $stateObject)
 {
     switch ($paymentAction) {
         case \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH:
         case \Magento\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->getConfig());
             $this->_processTokenErrors($response, $payment);
             $order = $payment->getOrder();
             $order->setCanSendNewEmailFlag(false);
             $stateObject->setState(\Magento\Sales\Model\Order::STATE_PENDING_PAYMENT);
             $stateObject->setStatus('pending_payment');
             $stateObject->setIsNotified(false);
             break;
         default:
             break;
     }
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:31,代碼來源:Payflowlink.php

示例2: processSuccessResult

 /**
  * Processes successful authorize/clone result
  *
  * @param \Magento\Framework\DataObject $payment
  * @param \Braintree_Result_Successful $result
  * @param float $amount
  * @return \Magento\Framework\DataObject
  */
 protected function processSuccessResult(\Magento\Framework\DataObject $payment, \Braintree_Result_Successful $result, $amount)
 {
     $additionalInformation = $this->getExtraTransactionInformation($result->transaction);
     $payment->setStatus(self::STATUS_APPROVED)->setCcTransId($result->transaction->id)->setLastTransId($result->transaction->id)->setTransactionId($result->transaction->id)->setIsTransactionClosed(false)->setAdditionalInformation($additionalInformation)->setAmount($amount)->setShouldCloseParentTransaction(false);
     return $payment;
 }
開發者ID:IlyaGluschenko,項目名稱:test001,代碼行數:14,代碼來源:PayPal.php

示例3: initialize

 /**
  * Instantiate state and set it to state object
  *
  * @param string $paymentAction
  * @param \Magento\Framework\DataObject $stateObject
  * @return void
  */
 public function initialize($paymentAction, $stateObject)
 {
     switch ($paymentAction) {
         case \Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH:
         case \Magento\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(\Magento\Sales\Model\Order::STATE_PENDING_PAYMENT);
             $stateObject->setStatus('pending_payment');
             $stateObject->setIsNotified(false);
             break;
         default:
             break;
     }
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:26,代碼來源:Hostedpro.php

示例4: processSuccessResult

 /**
  * Processes successful authorize/clone result
  *
  * @param \Magento\Framework\DataObject $payment
  * @param \Braintree_Result_Successful $result
  * @param string $amount
  * @return \Magento\Framework\DataObject
  */
 protected function processSuccessResult(\Magento\Framework\DataObject $payment, \Braintree_Result_Successful $result, $amount)
 {
     /** @var \Magento\Sales\Model\Order\Payment $payment */
     $payment->setStatus(self::STATUS_APPROVED)->setCcTransId($result->transaction->id)->setLastTransId($result->transaction->id)->setTransactionId($result->transaction->id)->setIsTransactionClosed(false)->setCcLast4($result->transaction->creditCardDetails->last4)->setAdditionalInformation($this->getExtraTransactionInformation($result->transaction))->setAmount($amount)->setShouldCloseParentTransaction(false);
     if ($this->isFinalCapture($payment->getParentId(), $amount)) {
         $payment->setShouldCloseParentTransaction(true);
     }
     if (isset($result->transaction->creditCard['token']) && $result->transaction->creditCard['token']) {
         $payment->setTransactionAdditionalInfo('token', $result->transaction->creditCard['token']);
     }
     return $payment;
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:20,代碼來源:PaymentMethod.php


注:本文中的Magento\Framework\DataObject::setStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。