coriolis / sell-and-sign
查询 sell and sign API 的组件
1.1.2
2021-05-12 15:38 UTC
Requires
- jms/serializer: ^3.12
- phpunit/phpunit: ^8.5
- symfony/http-client: ^4.1
- symfony/var-dumper: ^4.1
README
此软件包为您提供与 SellAndSign 组 REST API 交互的一些功能 https://www.sellandsign.com
使用 composer 安装
composer require coriolis/sell-and-sign
功能
ContractLoader
- getContracts > 允许您检索所有可用的合同
- getContract > 允许您通过其 ID 检索合同
- getContractorsAbout > 允许您检索合同的所有签署者
- closeTransaction > 用于关闭合同的交易
FileLoader
- getFilesForContract
- loadFile
- getEvidences
- getContractFileSigned
- getCurrentDocumentForContract
MemberLoader
- getMembers
ContractLoader
use QH\Sellandsign\{ Configuration, ContractLoader, DTO\Request }; use Symfony\Component\HttpClient\HttpClient; //init the configuration $configuration = (new Configuration) ->setApiUrl("THE_API_URL") ->setHttpclient(HttpClient::create()) ->setToken("THE_TOEKN") ->setLicenseId("THE_LICENSE_ID"); $contractLoader = new ContractLoader($configuration); /** * Retrive all contract */ //You must provide an instance of Request $request = new Request; //this class offers you certain method to specify filters $contracts = $contractLoader->getContracts($request); //return an instance of ContractCollection /** * Retrieve a contract */ $contract = $contractLoader->getContract(1234); // return an instance of Contract or null
FileLoader
use QH\Sellandsign\{ Configuration, FileLoader }; use Symfony\Component\HttpClient\HttpClient; //init the configuration $configuration = (new Configuration) ->setApiUrl("THE_API_URL") ->setHttpclient(HttpClient::create()) ->setToken("THE_TOEKN") ->setLicenseId("THE_LICENSE_ID"); $fileLoader = new FileLoader($configuration); $fileContent = $this->fileLoader->getCurrentDocumentForContract(1234); //return the content of the file in string //You can write a file with the content $filename = "someName.pdf"; $pathOfDirectory = "/path/of/directory/"; $file = fopen($pathOfDirectory . $filename , 'w'); fwrite($file, $fileContent); fclose($fileHandler);
MemberLoader
use QH\Sellandsign\{ Configuration, MemberLoader, DTO\MemberRequest }; use Symfony\Component\HttpClient\HttpClient; //init the configuration $configuration = (new Configuration) ->setApiUrl("THE_API_URL") ->setHttpclient(HttpClient::create()) ->setToken("THE_TOEKN") ->setLicenseId("THE_LICENSE_ID"); $memberLoader = new MemberLoader($configuration); $request = new MemberRequest(); $members = $memberLoader->getMembers($request); //return an instance of MemberCollection //You can do a search, for example a search on an email //it will be necessary to modify the request $request = new MemberRequest(); $request->setSearchString("your-email@example.com"); $members = $memberLoader->getMembers($request); //return an instance of MemberCollection