14 use Magento\Paypal\Model\ConfigFactory;
24 private $currentCustomer;
57 private $startAction =
'paypal/express/start/button/1';
69 ConfigFactory $paypalConfigFactory,
73 $this->currentCustomer = $currentCustomer;
74 $this->paypalData = $paypalData;
75 $this->urlBuilder = $urlBuilder;
76 $this->escaper = $escaper;
77 $this->config = $paypalConfigFactory->create();
86 $customerId = $this->currentCustomer->getCustomerId();
87 if ($this->paypalData->shouldAskToCreateBillingAgreement($this->config,
$customerId)) {
89 'askToCreate' =>
true,
90 'confirmUrl' => $this->escaper->escapeUrl(
91 $this->urlBuilder->getUrl(
93 [\
Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT => 1]
96 'confirmMessage' => $this->escaper->escapeJs(
97 __(
'Would you like to sign a billing agreement to streamline further purchases with PayPal?')
__construct(CurrentCustomer $currentCustomer, Data $paypalData, ConfigFactory $paypalConfigFactory, UrlInterface $urlBuilder, Escaper $escaper)