Download the PHP package bnpl-partners/factoring004 without Composer
On this page you can find all versions of the php package bnpl-partners/factoring004. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package factoring004
Factoring004 SDK
- Requirements
- Version compatibility
- Installation
- Authentication
- Usage
- PreApp endpoint
- Delivery endpoints
- Full return endpoints
- Partial return endpoints
- Error handling
- Advanced usage
- Create api instance
- PreApp endpoint
- Delivery endpoints
- Return endpoints
- Error handling
- Exception Hierarchy
- Customization
- PSR HTTP clients
- Transport layer
- Resources
Requirements
- PHP >=5.6
- JSON extension
- PSR-17, PSR-18 implementations (optional and PHP >=7.x only)
Version compatibility
Package version | PHP version | Note |
---|---|---|
3.x | >= 7.4 | Latest version. Supported. |
2.x | >= 5.6 < 7.4 | Legacy version. Supported. |
1.x | >= 5.6 < 7.4 | Legacy version. Unsupported. Please upgrade to 2.x. |
0.x | >= 7.4 | Unstable and unsupported version. Please upgrade to 3.x. |
Installation
Authentication
Create an instance of BnplPartners\Factoring004\OAuth\OAuthTokenManager
.
Generate access token
Refresh access token
Cache access token
Cached Token Refresh Policy
There are two policies to refresh a cached token.
Always Retrieve
This is default behaviour. In this case any expired tokens always will refresh.
If you need to refresh token instead of retrieve, you will have to call CacheOAuthTokenManager::refreshToken()
method.
Always Refresh
Expired tokens always will refresh.
You won't need to refresh it manually by CacheOAuthTokenManager::refreshToken()
method.
Clear cached tokens
If you need to clear cache, you will clear cache manually.
If you get an authentication error, you will clear cache manually.
Usage
We recommend to use the class BnplPartners\Factoring004\Order\OrderManager
to call our endpoints.
Create an instance
PreApp endpoint
Delivery endpoints
Send OTP
Check OTP
Without OTP
Full return endpoints
Send OTP
Check OTP
Without OTP
Partial return endpoints
Send OTP
Check OTP
Without OTP
Cancel endpoint
Error handling
All methods can throw an instance of BnplPartners\Factoring004\Exception\PackageException
.
Advanced Usage
These classes are low level API, described in the section.
Create api instance
PreApp endpoint
Create preApp
Get preapp status
Get status by preapp id
Get status by order id
Delivery endpoints
Send OTP
Check OTP
Without OTP
Refund endpoints
Send OTP Return
Check OTP Return
Without OTP
Cancel
Error handling
Whenever api returns an error client will throw an instance of BnplPartners\Factoring004\Exception\ApiException
.
Exception Hierarchy
PackageException
ApiException
AuthenticationException
ValidationException
ErrorResponseException
UnexpectedResponseException
EndpointUnavailableException
TransportException
NetworkException
DataSerializationException
Customization
PSR HTTP clients
First install any PSR-17 and PSR-18 packages. See PSR-17 packages and PSR-18 packages.
For instance, we install popular Guzzle HTTP client. Since version 7 it has already implemented PSR-17 and PSR-18.
For Guzzle 6 you may use GuzzleTransport
or PsrTransport
with additional PSR-17 and PSR-18 adapters. See bellow.
Install PSR-17 and PSR-18 adapters for Guzzle 6.
Transport layer
Transport is an abstraction layer over HTTP clients.
For Guzzle 6 and 7
For PSR-17 and PSR-18 client.
For Guzzle 6 client with PSR-17 and PSR-18 adapters.
For other PSR-17 and PSR-18 clients.
You can create your own transport. Just implement BnplPartners\Factoring004\Transport\TransportInterface
.
Send requests
Resources
Each resource is a set of grouped endpoints.
Test
All versions of factoring004 with dependencies
ext-json Version *
psr/http-factory Version ^1.0
psr/http-client Version ^1.0
myclabs/php-enum Version ^1.8
psr/simple-cache Version >=1.0
guzzlehttp/guzzle Version >=6.0
psr/log Version >=1.1