コード例 #1
0
ファイル: Detail.php プロジェクト: shabbirvividads/magento2
 /**
  * Render block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     $this->setTxnIdHtml($this->escapeHtml($this->_txn->getTxnId()));
     $this->setParentTxnIdUrlHtml($this->escapeHtml($this->getUrl('sales/transactions/view', ['txn_id' => $this->_txn->getParentId()])));
     $this->setParentTxnIdHtml($this->escapeHtml($this->_txn->getParentTxnId()));
     $this->setOrderIncrementIdHtml($this->escapeHtml($this->_txn->getOrder()->getIncrementId()));
     $this->setTxnTypeHtml($this->escapeHtml($this->_txn->getTxnType()));
     $this->setOrderIdUrlHtml($this->escapeHtml($this->getUrl('sales/order/view', ['order_id' => $this->_txn->getOrderId()])));
     $this->setIsClosedHtml($this->_txn->getIsClosed() ? __('Yes') : __('No'));
     $createdAt = strtotime($this->_txn->getCreatedAt()) ? $this->formatDate($this->_txn->getCreatedAt(), \IntlDateFormatter::MEDIUM, true) : __('N/A');
     $this->setCreatedAtHtml($this->escapeHtml($createdAt));
     return parent::_toHtml();
 }
コード例 #2
0
ファイル: Detail.php プロジェクト: aiesh/magento2
 /**
  * Render block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     $this->setTxnIdHtml($this->escapeHtml($this->_txn->getTxnId()));
     $this->setParentTxnIdUrlHtml($this->escapeHtml($this->getUrl('sales/transactions/view', array('txn_id' => $this->_txn->getParentId()))));
     $this->setParentTxnIdHtml($this->escapeHtml($this->_txn->getParentTxnId()));
     $this->setOrderIncrementIdHtml($this->escapeHtml($this->_txn->getOrder()->getIncrementId()));
     $this->setTxnTypeHtml($this->escapeHtml($this->_txn->getTxnType()));
     $this->setOrderIdUrlHtml($this->escapeHtml($this->getUrl('sales/order/view', array('order_id' => $this->_txn->getOrderId()))));
     $this->setIsClosedHtml($this->_txn->getIsClosed() ? __('Yes') : __('No'));
     $createdAt = strtotime($this->_txn->getCreatedAt()) ? $this->formatDate($this->_txn->getCreatedAt(), \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM, true) : __('N/A');
     $this->setCreatedAtHtml($this->escapeHtml($createdAt));
     return parent::_toHtml();
 }
コード例 #3
0
 /**
  * @param Transaction $transaction
  * @return array
  */
 private function getPreparedTransactionData(Transaction $transaction)
 {
     $additionalInfo = [];
     foreach ($transaction->getAdditionalInformation() as $value) {
         $additionalInfo[] = $value;
     }
     $expectedData = ['transaction_id' => (int) $transaction->getId()];
     if ($transaction->getParentId() !== null) {
         $expectedData['parent_id'] = (int) $transaction->getParentId();
     }
     $expectedData = array_merge($expectedData, ['order_id' => (int) $transaction->getOrderId(), 'payment_id' => (int) $transaction->getPaymentId(), 'txn_id' => $transaction->getTxnId(), 'parent_txn_id' => $transaction->getParentTxnId() ? (string) $transaction->getParentTxnId() : '', 'txn_type' => $transaction->getTxnType(), 'is_closed' => (int) $transaction->getIsClosed(), 'additional_information' => ['data'], 'created_at' => $transaction->getCreatedAt(), 'child_transactions' => []]);
     return $expectedData;
 }
コード例 #4
0
ファイル: Express.php プロジェクト: pradeep-wagento/magento2
 /**
  * Check transaction for expiration in PST
  *
  * @param Transaction $transaction
  * @param int $period
  * @return bool
  */
 protected function _isTransactionExpired(Transaction $transaction, $period)
 {
     $period = intval($period);
     if (0 == $period) {
         return true;
     }
     $transactionClosingDate = new \DateTime($transaction->getCreatedAt(), new \DateTimeZone('GMT'));
     $transactionClosingDate->setTimezone(new \DateTimeZone('US/Pacific'));
     /**
      * 11:49:00 PayPal transactions closing time
      */
     $transactionClosingDate->setTime(11, 49, 00);
     $transactionClosingDate->modify('+' . $period . ' days');
     $currentTime = new \DateTime(null, new \DateTimeZone('US/Pacific'));
     if ($currentTime > $transactionClosingDate) {
         return true;
     }
     return false;
 }