21 '<a target="_blank" href="https://www%1$s.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%2$s">%2$s</a>';
53 private $paymentMethodList;
58 private $paymentMethodInstanceFactory;
70 \
Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory,
74 $this->_paymentData = $paymentData;
75 $this->_agreementFactory = $agreementFactory;
76 $this->methodCodes = $methodCodes;
78 parent::__construct($context);
90 if (
null === self::$_shouldAskToCreateBillingAgreement) {
91 self::$_shouldAskToCreateBillingAgreement =
false;
93 if ($this->_agreementFactory->create()->needToCreateForCustomer(
$customerId)) {
94 self::$_shouldAskToCreateBillingAgreement =
true;
98 return self::$_shouldAskToCreateBillingAgreement;
110 $activeMethods = array_map(
112 return $this->getPaymentMethodInstanceFactory()->create(
$method);
134 public function getHtmlTransactionId(
$methodCode, $txnId)
139 $sandboxFlag = (
$config->getValue(
'sandboxFlag') ?
'.sandbox' :
'');
140 return sprintf(self::HTML_TRANSACTION_ID, $sandboxFlag, $txnId);
153 if ($this->paymentMethodList ===
null) {
155 PaymentMethodListInterface::class
158 return $this->paymentMethodList;
167 private function getPaymentMethodInstanceFactory()
169 if ($this->paymentMethodInstanceFactory ===
null) {
171 InstanceFactory::class
174 return $this->paymentMethodInstanceFactory;
getBillingAgreementMethods($store=null, $quote=null)
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Payment\Helper\Data $paymentData, \Magento\Paypal\Model\Billing\AgreementFactory $agreementFactory, \Magento\Paypal\Model\ConfigFactory $configFactory, array $methodCodes)
const HTML_TRANSACTION_ID
getPaymentMethodList($sorted=true, $asLabelValue=false, $withGroups=false, $store=null)
static $_shouldAskToCreateBillingAgreement
shouldAskToCreateBillingAgreement(\Magento\Paypal\Model\Config $config, $customerId)