Jacek Kowalski
2023-07-01 73807e6eca56610b6aa48edf1917f8d54ce24de1
Support App Key authentication to wFirma.pl API
4 files modified
18 ■■■■■ changed files
README.md 2 ●●● patch | view | raw | blame | history
composer.json 2 ●●● patch | view | raw | blame | history
manifest.json 12 ●●●●● patch | view | raw | blame | history
src/wFirmaApiFactory.php 2 ●●● patch | view | raw | blame | history
README.md
@@ -1,4 +1,4 @@
Prerequisites:
- wFirma account with no 2FA enabled,
- wFirma access key, secret key and app key,
- separate invoice numbering scheme with no checking created in wFirma,
- tax included pricing set in UCRM.
composer.json
@@ -13,6 +13,6 @@
        "php": ">=8.1",
        "ext-json": "*",
        "ubnt/ucrm-plugin-sdk": "^0.9.0",
        "webit/w-firma-api": "^2.3"
        "webit/w-firma-api": "^2.6.0"
    }
}
manifest.json
@@ -18,12 +18,16 @@
    },
    "configuration": [
        {
            "key": "wfirma_username",
            "label": "wFirma.pl username"
            "key": "wfirma_access_key",
            "label": "wFirma.pl Access Key"
        },
        {
            "key": "wfirma_password",
            "label": "wFirma.pl password"
            "key": "wfirma_secret_key",
            "label": "wFirma.pl Secret Key"
        },
        {
            "key": "wfirma_app_key",
            "label": "wFirma App Key"
        },
        {
            "key": "wfirma_series_invoice",
src/wFirmaApiFactory.php
@@ -11,7 +11,7 @@
    function create(): \Webit\WFirmaSDK\Entity\ModuleApiFactory {
        $config = $this->ucrmHelper->getConfig();
        $wFirmaAuth = new \Webit\WFirmaSDK\Auth\BasicAuth($config['wfirma_username'], $config['wfirma_password']);
        $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);