AfterbuyRequestSender
in package
Class AfterbuyRequestSender
Table of Contents
- HTTP_CONTENT_TYPE = 'application/xml'
- HTTP_URL = 'https://api.afterbuy.de/afterbuy/ABInterface.aspx'
- REQUEST_TIMEOUT = 5
- $client : Client
- $logger : AfterbuyLogger
- $responseValidator : AfterbuyXmlResponseValidator
- __construct() : mixed
- AfterbuyRequestSender constructor.
- send() : array<string|int, mixed>
- Sends the request to the Afterbuy-API.
- logRequest() : void
- Logs the request to the Afterbuy XML-API.
- logResponse() : void
- Logs the response from the Afterbuy XML-API.
Constants
HTTP_CONTENT_TYPE
private
mixed
HTTP_CONTENT_TYPE
= 'application/xml'
HTTP_URL
private
mixed
HTTP_URL
= 'https://api.afterbuy.de/afterbuy/ABInterface.aspx'
REQUEST_TIMEOUT
private
mixed
REQUEST_TIMEOUT
= 5
Properties
$client
private
Client
$client
$logger
private
AfterbuyLogger
$logger
$responseValidator
private
AfterbuyXmlResponseValidator
$responseValidator
Methods
__construct()
AfterbuyRequestSender constructor.
public
__construct(Client $client, AfterbuyXmlResponseValidator $responseValidator, AfterbuyLogger $logger) : mixed
Parameters
- $client : Client
- $responseValidator : AfterbuyXmlResponseValidator
- $logger : AfterbuyLogger
Return values
mixed —send()
Sends the request to the Afterbuy-API.
public
send(AfterbuyXmlRequest $request[, OrderId $orderId = null ]) : array<string|int, mixed>
This method also validates the Afterbuy-Response and throws an exception in case of an error. All details are logged in the validator.
Parameters
- $request : AfterbuyXmlRequest
- $orderId : OrderId = null
Tags
Return values
array<string|int, mixed> —logRequest()
Logs the request to the Afterbuy XML-API.
private
logRequest(AfterbuyXmlRequest $request[, OrderId|null $orderId = null ]) : void
Parameters
- $request : AfterbuyXmlRequest
- $orderId : OrderId|null = null
Return values
void —logResponse()
Logs the response from the Afterbuy XML-API.
private
logResponse(AfterbuyXmlRequest $request, string $responseBody[, OrderId|null $orderId = null ]) : void
Parameters
- $request : AfterbuyXmlRequest
- $responseBody : string
- $orderId : OrderId|null = null