Hi... I am trying to integrate dwolla payment gateway in my project, I have uploaded DwollaSwagger files(third party library) inside 'lib/internal/dwolla/' folder, I am trying to call DwollaSwagger.php class from my Block but getting errors like this
main.CRITICAL: Error: Class 'Demo\Dwolla\Block\Demo\DwollaSwagger' not found in app/code/Demo/Dwolla/Block/Demo/Customer.php:30
My block class:
<?php declare(strict_types=1); namespace Demo\Dwolla\Block\Demo; require(BP.'/lib/internal/dwolla/dwollaswagger/DwollaSwagger.php'); class Customer extends \Magento\Framework\View\Element\Template { protected $request; protected $dir; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Request\Http $request, \Magento\Framework\Filesystem\DirectoryList $dir, array $data = [] ) { $this->request = $request; $this->dir = $dir; parent::__construct($context, $data); } public function getTokenID(){ $DwollaSwagger = new DwollaSwagger(); DwollaSwagger\Configuration::$username = 'xxxxxxxxxxxxxxxxxxx'; DwollaSwagger\Configuration::$password = 'xxxxxxxxxxxxxxxxxxx'; // For Sandbox $apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com"); $tokensApi = new DwollaSwagger\TokensApi($apiClient); $appToken = $tokensApi->token(); return $appToken; } } ?>
Lib folder:
@AvalonAccess wrote:Hi... I am trying to integrate dwolla payment gateway in my project, I have uploaded DwollaSwagger files(third party library) inside 'lib/internal/dwolla/' folder, I am trying to call DwollaSwagger.php class from my Block but getting errors like this
main.CRITICAL: Error: Class 'Demo\Dwolla\Block\Demo\DwollaSwagger' not found in app/code/Demo/Dwolla/Block/Demo/Customer.php:30
My block class:
<?php declare(strict_types=1); namespace Demo\Dwolla\Block\Demo; require(BP.'/lib/internal/dwolla/dwollaswagger/DwollaSwagger.php'); class Customer extends \Magento\Framework\View\Element\Template { protected $request; protected $dir; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Request\Http $request, \Magento\Framework\Filesystem\DirectoryList $dir, array $data = [] ) { $this->request = $request; $this->dir = $dir; parent::__construct($context, $data); } public function getTokenID(){ $DwollaSwagger = new DwollaSwagger(); DwollaSwagger\Configuration::$username = 'xxxxxxxxxxxxxxxxxxx'; DwollaSwagger\Configuration::$password = 'xxxxxxxxxxxxxxxxxxx'; // For Sandbox $apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com"); $tokensApi = new DwollaSwagger\TokensApi($apiClient); $appToken = $tokensApi->token(); return $appToken; } } ?>Lib folder:
Dwolla's drop-in component library comes with a collection of low-code components that solve for a variety of functions. Get started now!