Jacek Kowalski
2026-03-31 797f70689539add5d9a891f8234a29b29a79cf3d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
 
namespace SIPL\UCRM\wFirma;
 
class wFirmaApiFactory {
    protected UcrmHelper $ucrmHelper;
 
    function __construct(UcrmHelper $ucrmHelper) {
        $this->ucrmHelper = $ucrmHelper;
    }
 
    function create(): \Webit\WFirmaSDK\Entity\ModuleApiFactory {
        $config = $this->ucrmHelper->getConfig();
        $wFirmaAuth = new \Webit\WFirmaSDK\Auth\ApiKeysAuth($config['wfirma_access_key'], $config['wfirma_secret_key'], $config['wfirma_app_key']);
 
        $wFirmaEntityApiFactory = new \Webit\WFirmaSDK\Entity\EntityApiFactory();
        $wFirmaEntityApi = $wFirmaEntityApiFactory->create($wFirmaAuth);
 
        return new \Webit\WFirmaSDK\Entity\ModuleApiFactory($wFirmaEntityApi);
    }
}