AfterbuyOrderSender
in package
Table of Contents
- AFTERBUY_URL = 'https://api.afterbuy.de/afterbuy/ShopInterfaceUTF8.aspx'
- FEEDBACKDATUM = '0'
- GENERIC_OT_ARTNR = '99999999'
- KUNDENERKENNUNG = '1'
- REQUEST_TIMEOUT = 5
- VERSANDERMITTLUNG_AB = 1
- $b2bStatusIds : mixed
- $configuration : mixed
- $logger : mixed
- $order : OrderInterface
- $orderId : mixed
- $orderStatus : mixed
- $orderTotalConfiguration : mixed
- $orderTotalIgnore : array<string|int, mixed>
- $partnerID : mixed
- $partnerPass : mixed
- $paymentMapping : mixed
- $userID : mixed
- __construct() : mixed
- AfterbuyOrderSender constructor.
- addOrderTotalConfiguration() : mixed
- addPaymentMapping() : mixed
- orderIsPaid() : bool
- Checks if the order is to be considered paid in full.
- prepareData() : mixed
- processOrder() : mixed
- callAfterbuyXmlApi() : void
- convertPrice() : mixed
- getAttributeModel() : mixed
- getProductUrl() : string
- getTaxRate() : mixed
- mapPayment() : mixed
- sendData() : mixed
- checkPaypalHubDetails() : void
- checkPaypalHubPayment() : void
- extendRootIdAndProductNumber() : void
- Extends $data by adding the 'ArtikelStammID_$pos', 'Artikelnr_$pos' and 'AlternArtikelNr1_$pos' fields.
- getCombiId() : int|null
- Returns the product combi id of the stored order item or null if the item does not represent a variant.
- getContextForClassMember() : array<string|int, mixed>
- Creates an array containing the class members.
- getContextForThrowable() : array<string|int, mixed>
- Creates a context array from any throwable.
- mapAfterbuyToShopOrderId() : void
- Maps Afterbuy order ids to shop order ids.
- removeNonDigits() : string
- Removes all non-digits from the given string.
- strContains() : bool
- Checks if $haystack contains $needle.
- updateOrderStatus() : void
- Updates the order status with given information using the `OrderWriteService::updateOrderStatus`.
Constants
AFTERBUY_URL
protected
mixed
AFTERBUY_URL
= 'https://api.afterbuy.de/afterbuy/ShopInterfaceUTF8.aspx'
FEEDBACKDATUM
protected
mixed
FEEDBACKDATUM
= '0'
GENERIC_OT_ARTNR
protected
mixed
GENERIC_OT_ARTNR
= '99999999'
KUNDENERKENNUNG
protected
mixed
KUNDENERKENNUNG
= '1'
REQUEST_TIMEOUT
protected
mixed
REQUEST_TIMEOUT
= 5
VERSANDERMITTLUNG_AB
protected
mixed
VERSANDERMITTLUNG_AB
= 1
Properties
$b2bStatusIds
protected
mixed
$b2bStatusIds
$configuration
protected
mixed
$configuration
$logger
protected
mixed
$logger
$order
protected
OrderInterface
$order
$orderId
protected
mixed
$orderId
$orderStatus
protected
mixed
$orderStatus
$orderTotalConfiguration
protected
mixed
$orderTotalConfiguration
$orderTotalIgnore
protected
array<string|int, mixed>
$orderTotalIgnore
$partnerID
protected
mixed
$partnerID
$partnerPass
protected
mixed
$partnerPass
$paymentMapping
protected
mixed
$paymentMapping
$userID
protected
mixed
$userID
Methods
__construct()
AfterbuyOrderSender constructor.
public
__construct( $orderId) : mixed
Configuration will fall back on values from the old configuration page if GXModuleConfigurationStorage does not contain values from the new configuration.
Parameters
Return values
mixed —addOrderTotalConfiguration()
public
addOrderTotalConfiguration(mixed $moduleCode, mixed $artikelNr, mixed $artikelName[, mixed $factor = 1 ], mixed $taxRate) : mixed
Parameters
- $moduleCode : mixed
- $artikelNr : mixed
- $artikelName : mixed
- $factor : mixed = 1
- $taxRate : mixed
Return values
mixed —addPaymentMapping()
public
addPaymentMapping(mixed $moduleCode, mixed $afterbuyName, mixed $afterbuyId) : mixed
Parameters
- $moduleCode : mixed
- $afterbuyName : mixed
- $afterbuyId : mixed
Return values
mixed —orderIsPaid()
Checks if the order is to be considered paid in full.
public
orderIsPaid() : bool
An order is paid if the order status configured as order_status_paid is found in the order’s status history.
Return values
bool —prepareData()
public
prepareData() : mixed
Return values
mixed —processOrder()
public
processOrder() : mixed
Tags
Return values
mixed —callAfterbuyXmlApi()
protected
callAfterbuyXmlApi() : void
Return values
void —convertPrice()
protected
convertPrice(mixed $price[, mixed $currencyFactor = 1.0 ]) : mixed
Parameters
- $price : mixed
- $currencyFactor : mixed = 1.0
Return values
mixed —getAttributeModel()
protected
getAttributeModel(mixed $productsId, StoredOrderItemAttribute $orderItemAttribute) : mixed
Parameters
- $productsId : mixed
- $orderItemAttribute : StoredOrderItemAttribute
Return values
mixed —getProductUrl()
protected
getProductUrl(int $productsId, string $productName) : string
Parameters
- $productsId : int
- $productName : string
Return values
string —getTaxRate()
protected
getTaxRate(mixed $taxClassId, CustomerCountryInterface $country, CustomerCountryZoneInterface $zone) : mixed
Parameters
- $taxClassId : mixed
- $country : CustomerCountryInterface
- $zone : CustomerCountryZoneInterface
Return values
mixed —mapPayment()
protected
mapPayment(mixed $paymentCode) : mixed
Parameters
- $paymentCode : mixed
Return values
mixed —sendData()
protected
sendData( $data) : mixed
Parameters
Tags
Return values
mixed —checkPaypalHubDetails()
private
checkPaypalHubDetails(array<string|int, mixed> $details, array<string|int, mixed> &$data) : void
Parameters
- $details : array<string|int, mixed>
- $data : array<string|int, mixed>
Return values
void —checkPaypalHubPayment()
private
checkPaypalHubPayment(array<string|int, mixed> &$data) : void
Parameters
- $data : array<string|int, mixed>
Return values
void —extendRootIdAndProductNumber()
Extends $data by adding the 'ArtikelStammID_$pos', 'Artikelnr_$pos' and 'AlternArtikelNr1_$pos' fields.
private
extendRootIdAndProductNumber(array<string|int, mixed> &$data, StoredOrderItem $orderItem, string $productSyncType, int $pos) : void
Parameters
- $data : array<string|int, mixed>
- $orderItem : StoredOrderItem
- $productSyncType : string
- $pos : int
Return values
void —getCombiId()
Returns the product combi id of the stored order item or null if the item does not represent a variant.
private
getCombiId(StoredOrderItem $orderItem) : int|null
Parameters
- $orderItem : StoredOrderItem
Return values
int|null —getContextForClassMember()
Creates an array containing the class members.
private
getContextForClassMember() : array<string|int, mixed>
Useful for the $context while logging.
Return values
array<string|int, mixed> —getContextForThrowable()
Creates a context array from any throwable.
private
getContextForThrowable(Throwable $throwable) : array<string|int, mixed>
Serializes the throwable to an array.
Parameters
- $throwable : Throwable
Return values
array<string|int, mixed> —mapAfterbuyToShopOrderId()
Maps Afterbuy order ids to shop order ids.
private
mapAfterbuyToShopOrderId(string $xmlResponse) : void
This method takes the whole XML-Response of the Afterbuy Shop-API response, parse it and checks if the Afterbuy and Shop order ids are available. If so, the mapped ids are stored in the 'afterbuy_orders' database table.
Parameters
- $xmlResponse : string
Return values
void —removeNonDigits()
Removes all non-digits from the given string.
private
removeNonDigits(string $string) : string
Parameters
- $string : string
Return values
string —strContains()
Checks if $haystack contains $needle.
private
strContains(string $haystack, string $needle) : bool
Copied for convenience from Symfony polyfill src/vendor/symfony/polyfill-php80/Php80.php
.
Parameters
- $haystack : string
- $needle : string
Return values
bool —updateOrderStatus()
Updates the order status with given information using the `OrderWriteService::updateOrderStatus`.
private
updateOrderStatus(int $orderId, int $orderStatusId, string $comment) : void
Parameters
- $orderId : int
- $orderStatusId : int
- $comment : string