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


PHP float::getOrder方法代码示例

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


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

示例1: _processPartialAuthorizationResponse

 /**
  * Set split_tender_id to quote payment if needed
  *
  * @param \Magento\Framework\Object $response
  * @param float $orderPayment
  * @throws \Magento\Payment\Model\Info\Exception
  * @return bool
  */
 protected function _processPartialAuthorizationResponse($response, $orderPayment)
 {
     if (!$response->getSplitTenderId()) {
         return false;
     }
     $quotePayment = $orderPayment->getOrder()->getQuote()->getPayment();
     $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_DECLINED);
     $exceptionMessage = null;
     try {
         switch ($response->getResponseCode()) {
             case self::RESPONSE_CODE_APPROVED:
                 $this->_registerCard($response, $orderPayment);
                 $this->_clearAssignedData($quotePayment);
                 $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_SUCCESS);
                 return true;
             case self::RESPONSE_CODE_HELD:
                 if ($response->getResponseReasonCode() != self::RESPONSE_REASON_CODE_PARTIAL_APPROVE) {
                     return false;
                 }
                 if ($this->getCardsStorage($orderPayment)->getCardsCount() + 1 >= self::PARTIAL_AUTH_CARDS_LIMIT) {
                     $this->cancelPartialAuthorization($orderPayment);
                     $this->_clearAssignedData($quotePayment);
                     $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_CARDS_LIMIT_EXCEEDED);
                     $quotePayment->setAdditionalInformation($orderPayment->getAdditionalInformation());
                     $exceptionMessage = __('You have reached the maximum number of credit cards ' . 'allowed to be used for the payment.');
                     break;
                 }
                 $orderPayment->setAdditionalInformation($this->_splitTenderIdKey, $response->getSplitTenderId());
                 $this->_registerCard($response, $orderPayment);
                 $this->_clearAssignedData($quotePayment);
                 $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_SUCCESS);
                 $quotePayment->setAdditionalInformation($orderPayment->getAdditionalInformation());
                 $exceptionMessage = null;
                 break;
             case self::RESPONSE_CODE_DECLINED:
             case self::RESPONSE_CODE_ERROR:
                 $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_DECLINED);
                 $quotePayment->setAdditionalInformation($orderPayment->getAdditionalInformation());
                 $exceptionMessage = $this->_wrapGatewayError($response->getResponseReasonText());
                 break;
             default:
                 $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_LAST_DECLINED);
                 $quotePayment->setAdditionalInformation($orderPayment->getAdditionalInformation());
                 $exceptionMessage = $this->_wrapGatewayError(__('Something went wrong while authorizing the partial payment.'));
         }
     } catch (\Exception $e) {
         $exceptionMessage = $e->getMessage();
     }
     throw new \Magento\Payment\Model\Info\Exception($exceptionMessage);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:58,代码来源:Authorizenet.php


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