83 \
Magento\Customer\Model\Session $customerSession,
84 \
Magento\Sales\Model\Order\Config $orderConfig,
90 $this->_orderCollectionFactory = $orderCollectionFactory;
91 $this->_customerSession = $customerSession;
92 $this->_orderConfig = $orderConfig;
94 $this->_agreementResource = $agreementResource;
95 parent::__construct($context,
$data);
96 $this->_isScopePrivate =
true;
106 if ($this->_relatedOrders ===
null) {
109 $this->_relatedOrders = $this->_orderCollectionFactory->create()->addFieldToSelect(
113 (
int)$this->_customerSession->getCustomerId()
116 [
'in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
121 $this->_agreementResource->addOrdersFilter($this->_relatedOrders, $billingAgreementId);
138 case 'order_increment_id':
142 $value = $this->
formatDate($order->getCreatedAt(), \IntlDateFormatter::SHORT,
true);
144 case 'shipping_address':
146 $order->getShippingAddress()->getName()
159 $value = $this->
getUrl(
'sales/order/view', [
'order_id' => $order->getId()]);
175 parent::_prepareLayout();
177 $pager = $this->
getLayout()->createBlock(
178 \
Magento\Theme\Block\Html\Pager::class
181 )->setIsOutputRequired(
197 if ($this->_billingAgreementInstance ===
null) {
198 $this->_billingAgreementInstance = $this->_coreRegistry->registry(
'current_billing_agreement');
210 if (!$this->_paymentMethods) {
211 foreach ($this->_helper->getBillingAgreementMethods() as $paymentMethod) {
212 $this->_paymentMethods[$paymentMethod->getCode()] = $paymentMethod->getTitle();
226 $this->setBackUrl($this->
getUrl(
'*/billing_agreement/'));
234 '*/billing_agreement/cancel',
240 $this->setPaymentMethodTitle($paymentMethodTitle);
244 $this->setAgreementCreatedAt(
245 $createdAt ? $this->
formatDate($createdAt, \IntlDateFormatter::SHORT,
true) :
__(
'N/A')
248 $this->setAgreementUpdatedAt($this->
formatDate($updatedAt, \IntlDateFormatter::SHORT,
true));
253 return parent::_toHtml();
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\Order\Config $orderConfig, \Magento\Paypal\Helper\Data $helper, \Magento\Paypal\Model\ResourceModel\Billing\Agreement $agreementResource, array $data=[])
formatDate( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)
_getBillingAgreementInstance()
getOrderItemValue(\Magento\Sales\Model\Order $order, $key)
escapeHtml($data, $allowedTags=null)
getUrl($route='', $params=[])
$_billingAgreementInstance