AfterbuyOrderTrackingReader
in package
Class AfterbuyOrderTrackingReader
Table of Contents
- AFTERBUY_ENDPOINT = 'GetSoldItems'
- CONFIGURATION_NAMESPACE = 'modules/gambio/afterbuy'
- DATE_FORMAT = 'd.m.Y H:i:s'
- $abTrackingLinkShippingMethodsCache : array<string|int, mixed>
- $connection : Connection
- $globalRepository : AfterbuyGlobalRepository
- $orderExistsCache : array<string|int, mixed>
- $sender : AfterbuyRequestSender
- $storage : ConfigurationStorageRepository
- __construct() : mixed
- AfterbuyOrderTrackingReader constructor.
- findTrackingCodesByOrderId() : AfterbuyOrderTrackingCodes|null
- Tries to find a tracking code for the given order.
- getAfterbuyTrackingSyncShippingMethods() : array<string|int, mixed>
- Returns a list of all afterbuy tracking link synchronization configurations.
- getTrackingCodes() : AfterbuyOrderTrackingCodes
- orderExists() : bool
- Checks if an order record exists for the given tracking codes order id.
- trackingLinkExists() : bool
- Checks if a tracking link already exists for the order.
- findAfterbuyOrderId() : string|null
- getElement() : SimpleXMLElement|null
- Tries to get a `SimpleXMLElement` from the given element by key.
- getElementAsString() : string|null
- Tries to return a xml element as string.
- getTrackingCodesFromResponse() : AfterbuyOrderTrackingCodes
- Returns afterbuy tracking codes from the xml response body.
- requestWithDateFilter() : SimpleXmlRequest
- Returns the xml request body for the XML-API endpoint 'GetSoldItems'.
- requestWithOrderFilter() : SimpleXmlRequest
- Returns the xml request body for the XML-API endpoint 'GetSoldItems'.
Constants
AFTERBUY_ENDPOINT
private
mixed
AFTERBUY_ENDPOINT
= 'GetSoldItems'
CONFIGURATION_NAMESPACE
private
mixed
CONFIGURATION_NAMESPACE
= 'modules/gambio/afterbuy'
DATE_FORMAT
private
mixed
DATE_FORMAT
= 'd.m.Y H:i:s'
Properties
$abTrackingLinkShippingMethodsCache
private
array<string|int, mixed>
$abTrackingLinkShippingMethodsCache
= []
$connection
private
Connection
$connection
$globalRepository
private
AfterbuyGlobalRepository
$globalRepository
$orderExistsCache
private
array<string|int, mixed>
$orderExistsCache
= []
$sender
private
AfterbuyRequestSender
$sender
$storage
private
ConfigurationStorageRepository
$storage
Methods
__construct()
AfterbuyOrderTrackingReader constructor.
public
__construct(AfterbuyGlobalRepository $globalRepository, AfterbuyRequestSender $sender, ConfigurationStorageRepositoryBuilder $builder, Connection $connection) : mixed
Parameters
- $globalRepository : AfterbuyGlobalRepository
- $sender : AfterbuyRequestSender
- $builder : ConfigurationStorageRepositoryBuilder
- $connection : Connection
Return values
mixed —findTrackingCodesByOrderId()
Tries to find a tracking code for the given order.
public
findTrackingCodesByOrderId(OrderId $orderId) : AfterbuyOrderTrackingCodes|null
It is required that the afterbuy_orders
table contains a mapping from
the shops order id to Afterbuy order id.
Parameters
- $orderId : OrderId
Tags
Return values
AfterbuyOrderTrackingCodes|null —getAfterbuyTrackingSyncShippingMethods()
Returns a list of all afterbuy tracking link synchronization configurations.
public
getAfterbuyTrackingSyncShippingMethods() : array<string|int, mixed>
When removing the prefix tracking_sync_shipping_methods_
from the array key, you
get the parcel service provider id of the shop system.
The result will be cached, so subsequent calls
Return values
array<string|int, mixed> —getTrackingCodes()
public
getTrackingCodes(string $lastTrackingSyncTime) : AfterbuyOrderTrackingCodes
Parameters
- $lastTrackingSyncTime : string
Tags
Return values
AfterbuyOrderTrackingCodes —orderExists()
Checks if an order record exists for the given tracking codes order id.
public
orderExists(AfterbuyOrderTrackingCode $trackingCode) : bool
Parameters
- $trackingCode : AfterbuyOrderTrackingCode
Return values
bool —trackingLinkExists()
Checks if a tracking link already exists for the order.
public
trackingLinkExists(AfterbuyOrderTrackingCode $trackingCode) : bool
Parameters
- $trackingCode : AfterbuyOrderTrackingCode
Tags
Return values
bool —findAfterbuyOrderId()
private
findAfterbuyOrderId(OrderId $orderId) : string|null
Parameters
- $orderId : OrderId
Return values
string|null —getElement()
Tries to get a `SimpleXMLElement` from the given element by key.
private
getElement(string $key, SimpleXMLElement|null $element) : SimpleXMLElement|null
Returns null if the key is not available.
Parameters
- $key : string
- $element : SimpleXMLElement|null
Return values
SimpleXMLElement|null —getElementAsString()
Tries to return a xml element as string.
private
getElementAsString(string $key, SimpleXMLElement|null $element) : string|null
Returns null if the key is not available.
Parameters
- $key : string
- $element : SimpleXMLElement|null
Return values
string|null —getTrackingCodesFromResponse()
Returns afterbuy tracking codes from the xml response body.
private
getTrackingCodesFromResponse(string $body) : AfterbuyOrderTrackingCodes
Parameters
- $body : string
Return values
AfterbuyOrderTrackingCodes —requestWithDateFilter()
Returns the xml request body for the XML-API endpoint 'GetSoldItems'.
private
requestWithDateFilter(string $lastTrackingSyncDate) : SimpleXmlRequest
Parameters
- $lastTrackingSyncDate : string
Tags
Return values
SimpleXmlRequest —requestWithOrderFilter()
Returns the xml request body for the XML-API endpoint 'GetSoldItems'.
private
requestWithOrderFilter(string $afterbuyOrderId) : SimpleXmlRequest
Parameters
- $afterbuyOrderId : string