14 use Magento\Paypal\Model\ConfigFactory;
68 ConfigFactory $paypalConfigFactory,
74 $this->_paypalData = $paypalData;
75 $this->_paypalConfigFactory = $paypalConfigFactory;
76 $this->_localeResolver = $localeResolver;
77 $this->_config =
null;
78 $this->_isScopePrivate =
true;
80 parent::__construct($context,
$data);
90 $this->_config = $this->_paypalConfigFactory->create()
92 $mark = $this->_getMarkTemplate();
93 $mark->setPaymentAcceptanceMarkHref(
94 $this->_config->getPaymentMarkWhatIsPaypalUrl($this->_localeResolver)
95 )->setPaymentAcceptanceMarkSrc(
96 $this->_config->getPaymentMarkImageUrl($this->_localeResolver->getLocale())
101 parent::_construct();
103 $this->setRedirectMessage(
__(
'You will be redirected to the PayPal website.'));
121 protected function _getMarkTemplate()
124 $mark = $this->_layout->createBlock(\
Magento\Framework\View\Element\Template::class);
125 $mark->setTemplate(
'Magento_Paypal::payment/mark.phtml');
138 'Magento_Paypal::payment/redirect.phtml' 139 )->setRedirectMessage(
140 __(
'You will be redirected to the PayPal website when you place an order.')
144 )->setMethodLabelAfterHtml(
156 $customerId = $this->currentCustomer->getCustomerId();
157 return $this->_paypalData->shouldAskToCreateBillingAgreement($this->_config,
$customerId)
const PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT