54 \
Magento\Customer\Model\Session $customerSession,
60 $this->_customerSession = $customerSession;
61 $this->_agreementCollection = $agreementCollection;
62 parent::__construct($context,
$data);
63 $this->_isScopePrivate =
true;
73 parent::_prepareLayout();
75 \
Magento\Theme\Block\Html\Pager::class
78 )->setIsOutputRequired(
81 $this->
setChild(
'pager', $pager)->setBackUrl($this->
getUrl(
'customer/account/'));
93 if ($this->_billingAgreements ===
null) {
94 $this->_billingAgreements = $this->_agreementCollection->create()->addFieldToFilter(
96 $this->_customerSession->getCustomerId()
118 ? $this->
formatDate($item->getData($key), \IntlDateFormatter::SHORT,
true)
122 $value = $this->
getUrl(
'paypal/billing_agreement/view', [
'agreement' => $item->getAgreementId()]);
124 case 'payment_method_label':
145 if (!$this->_paymentMethods) {
146 foreach ($this->_helper->getBillingAgreementMethods() as $paymentMethod) {
147 $this->_paymentMethods[$paymentMethod->getCode()] = $paymentMethod->getTitle();
160 $paymentMethodOptions = [];
161 foreach ($this->_helper->getBillingAgreementMethods() as $paymentMethod) {
162 if ($paymentMethod->getConfigData(
'allow_billing_agreement_wizard') == 1) {
163 $paymentMethodOptions[$paymentMethod->getCode()] = $paymentMethod->getTitle();
166 return $paymentMethodOptions;
176 $this->setCreateUrl($this->
getUrl(
'paypal/billing_agreement/startWizard'));
177 return parent::_toHtml();
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Paypal\Model\ResourceModel\Billing\Agreement\CollectionFactory $agreementCollection, \Magento\Paypal\Helper\Data $helper, array $data=[])
formatDate( $date=null, $format=\IntlDateFormatter::SHORT, $showTime=false, $timezone=null)
getItemValue(\Magento\Paypal\Model\Billing\Agreement $item, $key)
getWizardPaymentMethodOptions()
escapeHtml($data, $allowedTags=null)
getUrl($route='', $params=[])