/**
  * Return billing agreement code for method
  *
  * @param string $code
  * @return null|string
  */
 protected function getBillingAgreementCode($code)
 {
     $pre = __METHOD__ . ' : ';
     $this->_logger->debug($pre . 'bof');
     $customerId = $this->currentCustomer->getCustomerId();
     $this->config->setMethod($code);
     $this->_logger->debug($pre . 'eof');
     // always return null
     return $this->payfastHelper->shouldAskToCreateBillingAgreement($this->config, $customerId);
 }
Example #2
0
 /**
  * Check whether payment method can be used
  *
  * @param \Magento\Quote\Api\Data\CartInterface|Quote|null $quote
  *
  * @return bool
  */
 public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
 {
     return parent::isAvailable($quote) && $this->_config->isMethodAvailable();
 }