impact-factoring/management-client
最新稳定版本:2.0.3
Composer 安装命令:
composer require impact-factoring/management-client
包简介
A Laravel client for consuming Impact Factoring Management API
README 文档
README
Overview
The ImpactFactoringManagementClient is a PHP client designed to interact with the Impact Factoring Management API. It simplifies managing resources like operating companies, funders, funder compartments, and bank accounts. The client offers methods to fetch and manipulate these resources and ensures seamless API communication with predefined request and response handling.
Contribution
Please keep this README up to date.
Installation
Use Composer to install the package:
composer require impact-factoring/management-client
Configuration
The client autoconfigures based on environment variables:
APP_ENV: Determines if the client runs in production mode. Client will receive dummy data if APP_ENV is other than "production"IMPACT_FACTORING_MANAGEMENT_API_TOKEN: Authentication token for API requests.IMPACT_FACTORING_MANAGEMENT_API_BASE_URL: Base URL for the API.
Set these variables in your environment to streamline usage.
Features
- Fetch details of Operating Companies, Funders, Funder Compartments, and Bank Accounts.
- Reserve and release bank account reservations.
- Centralized configuration for API communication, including authentication and environment-specific settings.
Method Summary
| Method | Description |
|---|---|
getOperatingCompanies(): ?OperatingCompanyResource[] | Fetch all operating companies. |
getOperatingCompanyById(int $operatingCompanyId): ?OperatingCompanyResource | Fetch a single operating company. |
getFunders(int $operatingCompanyId): ?FunderResource[] | Fetch funders associated with an operating company. |
getFunderById(int $funderId): ?FunderResource | Fetch a single funder |
getFunderCompartments(int $funderId): ?FunderCompartmentResource[] | Fetch compartments for a specific funder |
getFunderCompartmentById(int $funderCompartmentId): ?FunderCompartmentResource | Fetch a single funder compartment |
getAvailableBankAccounts(int $compartmentId): ?BankAccountResource[] | Fetch available bank accounts for a funder compartment. |
getBankAccountById(int $bankAccountId): ?BankAccountResource | Fetch a single bank account |
reserveBankAccount(int $accountId): bool | Reserve a bank account |
releaseBankAccountReservation(int $accountId): bool | Release a bank account reservation. |
getCustomerNumberById(int $customerNumberId): ?CustomerNumberResource | Fetch a single customer number by ID. |
getAvailableCustomerNumbers(): ?CustomerNumberResource[] | Fetch all available customer numbers |
reserveCustomerNumbers(int $amount): CustomerNumberResource[] | Reserve a given amount of customer numbers |
releaseCustomerNumberReservation(int $customerNumberId): bool | Release a reservation of a customer number. |
Usage
Initializing the Client
Create a new instance of ImpactFactoringManagementClient:
use ImpactFactoring\Management\Client\ImpactFactoringManagementClient;
$client = new ImpactFactoringManagementClient();
Fetching Resources
Operating Companies:
Fetch all active operating companies
$operatingCompanies = $client->getOperatingCompanies();
Fetch a single operating company by ID
$operatingCompanie = $client->getOperatingCompanyById($operatingCompanyId);
Funders:
Fetch active funders assigned to a specific operating company.
$funders = $client->getFunders($operatingCompanyId);
Fetch a single funder by ID.
$funder = $client->getFunderById($funderId);
Funder Compartments:
Fetch active funder compartment assigned to a specific funder
$compartments = $client->getFunderCompartments($funderId);
Fetch a single funder compartment by ID
$compartment = $client->getFunderCompartmentById($funderCompartmentId);
Bank Accounts:
Fetch available bank accounts assigned to a specified funder compartment
$bankAccounts = $client->getAvailableBankAccounts($funderCompartmentId);
Fetch a single bank account by ID
$bankAccount = $client->getBankAccountById($bankAccountId);
Customer Numbers:
Fetch a single customer number by ID
$customerNumber = $client->getCustomerNumberById($customerNumberId);
Fetch all available customer numbers
$customerNumbers = $client->getAvailableCustomerNumbers();
Resources
OperatingCompanyResource
| Method | Description |
|---|---|
getId(): int | Retrieve the ID of the operating company. |
getCompanyName(): ?string | Retrieve the name of the operating company. |
getAddress(): ?string | Retrieve the address where the operating company is based |
getZipCode(): ?string | Retrieve the zipcode where the operating company is based |
getCity(): ?string | Retrieve the city where the operating company is based |
getCountry(): ?string | Retrieve the country where the operating company is based |
getCompanyRegistrationNumber(): ?string | Retrieve the company's business registration number (KvK). |
getCompanyVatNumber(): ?string | Retrieve the company's VAT number. |
getPhone(): ?string | Retrieve the company's general contact phone number. |
getEmail(): ?string | Retrieve the company's general contact email-address. |
getBankAccountNumber(): ?string | Retrieve the company's general IBAN account number. |
getBic(): ?string | Retrieve BIC associated with the general IBAN account number. |
getActive(): ?string | Retrieve the company's current state. |
FunderResource
| Method | Description |
|---|---|
getId(): int | Retrieve the ID of the funder. |
getName(): ?string | Retrieve the name of the funder. |
getActive(): ?string | Retrieve the current state of the funder. |
FunderCompartmentResource
| Method | Description |
|---|---|
getId(): int | Retrieve the ID of the funder compartment. |
getName(): ?string | Retrieve the name of the funder compartment. |
getActive(): ?string | Retrieve the current state of the funder compartment. |
BankAccountResource
| Method | Description |
|---|---|
getId(): int | Retrieve the ID of the bank account. |
getIban(): ?string | Retrieve the IBAN of the bank account. |
CustomerNumberResource
| Method | Description |
|---|---|
getId(): int | Retrieve the ID of the customer number. |
getCustomerNumber(): ?string | Retrieve the generated customer number. |
Reserve and release bank accounts
It's mandatory to reserve a bank account after the bank account is picked. The bank account should be released if there is no use for it anymore.
Reserve:
$isReserved = $client->reserveBankAccount($bankAccountId);
Release:
$isReleased = $client->releaseBankAccountReservation($bankAccountId);
Reserve and release customer numbers
Once the request to reserve customer numbers has been completed, the given customer numbers are already reserved. If, for any reason, the customer number isn't used anymore, you can release the reservation of that customer number.
Reserve:
$customerNumbers = $client->reserveCustomerNumbers($amount);
Release:
$isReleased = $client->releaseCustomerNumberReservation($customerNumberId);
Development
This package contains a Docker Compose file. Use the following Composer scripts to run and debug in an isolated environment
Usage
Initial composer install
composer docker-install
To test the package (powered by: Orchestra Testbench)
composer test
Run a debug container
composer debug
impact-factoring/management-client 适用场景与选型建议
impact-factoring/management-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 317 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 11 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 impact-factoring/management-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 impact-factoring/management-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 317
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-20