|
5 лет назад | |
---|---|---|
.. | ||
src | 5 лет назад | |
.travis.yml | 5 лет назад | |
README.md | 5 лет назад | |
composer.json | 5 лет назад |
The Vertex API Library provides data models for storing information related to Vertex requests and responses, mappers for converting these data models to a format compatible with the PHP SOAP extension, and services for calling the Vertex API endpoints.
The Vertex API Library provides backwards-compatibility in line with Magento 2 versioning constraints.
As such, classes that can be relied upon are marked with an @api
annotation.
Vertex\Data
Vertex\Exception
ConfigurationException
- thrown when the configuration is known to be invalidValidationException
- thrown when mapping a request has failed due to known value constraintsApiException
- thrown when the API returns an error. This exception is subclassed for more specific errors
AuthenticationException
- thrown when Vertex responds that authentication data is incorrectConnectionFailureException
- thrown when the library fails to connect to the Vertex SOAP APIVertex\Mapper
Vertex\Mapper\MapperFactory
provides methods for retrieving a mapper based on the class it should be mapping and
the version of Vertex it needs to map for. It is configured through the constructorVertex\Services\*\
Vertex\Services\Invoice
records an invoice in the Vertex Tax LogVertex\Services\Quote
requests a quotation for tax costsVertex\Services\TaxAreaLookup
attempts to validate an address and provide relevant jurisdictions where is taxed.Vertex\Utility\FaultConverter
determine if a SoapFault matches their conditions for being thrown and
return the proper exception if soVertex\Utility\SoapClientFactory
contains the default options for communicating with the Vertex SOAP APIVertex\Utility\SoapFaultConverterFactory
creates a PooledSoapFaultConverter
for converting any SoapFault into
one of the library's exceptionsVertex\Utility\SoapFaultConverterInterface
provides the contract all SoapFault Converters must adhere to in order
to be useful.Vertex\Utility\VersionDeterminer
provides the version of the Vertex API based on the WSDL URLThe Vertex API Library comes with Unit and Integration tests.
composer test:unit
runs the unit test suitecomposer test:integration
runs the integration test suiteThe Vertex API Library expects that a consumer of the library will assemble the Request and data models necessary for it by hand. The consumer will then call one of the Service methods.
The service method will utilize MapperFactory
to retrieve the mapper for its Request Interface, and then use the
result with a SoapClient created through the use of the SoapClientFactory
.
If the response received from Vertex is an Exception (SoapFault), the service will run the fault through the
SoapFault converter returned from SoapFaultConverterFactory
. If this converter returns an exception, the service
will throw it. If it does not, the service will throw an ApiException
.
If the response received is not an Exception, the service will run it through the mapper for its Response Interface and return this result to the caller.