Skip to content

Commit

Permalink
check for hosted fields username and password
Browse files Browse the repository at this point in the history
  • Loading branch information
vegimcarkaxhija committed Sep 26, 2024
1 parent ba510f7 commit 192ab9d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Model/Method/Creditcards.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,28 @@ public function __construct(
$this->serviceParameters = $serviceParameters;
}

/**
* {@inheritdoc}
*/
public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
{
/**
* If there are no giftcards chosen, we can't be available
*/
/**
* @var \Buckaroo\Magento2\Model\ConfigProvider\Method\Giftcards $ccConfig
*/
$gcConfig = $this->configProviderMethodFactory->get('creditcards');

if ($gcConfig->getHostedFieldsUsername() === null || $gcConfig->getHostedFieldsPassword() === null) {
return false;
}
/**
* Return the regular isAvailable result
*/
return parent::isAvailable($quote);
}

public function assignData(\Magento\Framework\DataObject $data)
{
parent::assignData($data);
Expand Down

0 comments on commit 192ab9d

Please sign in to comment.