phpDocumentor

KlarnaHubOrderExtender extends KlarnaHubOrderExtender_parent
in package

Class KlarnaHubOrderExtender

Table of Contents

$hubAssetHelper  : HubAssetHelper
$klarnaHubModuleCodes  : array<string|int, mixed>
$order  : array<string|int, mixed>
$queryBuilder  : CI_DB_query_builder
proceed()  : mixed
Proceed with the execution of the extender.
_addKlarnaHubOrderDetailsScript()  : KlarnaHubOrderExtender
Loads the Gambio Hub order details JavaScript file.
_calculateDiscountTotal()  : float
Calculates total sum of discount order lines.
_calculateSurchargeTotal()  : float
Calculates total sum of surcharge order lines.
_createKlarnaHubOrder()  : KlarnaHubOrder
Returns a Klarna order instance.
_getAdditionalAmounts()  : array<string|int, mixed>|null
Returns additional amounts cached in gm configuration table.
_getOrderSubtotal()  : float
Returns the order subtotal value.
_prepareReduceInvoiceAmountData()  : array<string|int, mixed>
Prepares and returns the reduce invoice amount request payload.
_processDiscountChanges()  : array<string|int, mixed>
Processes discount changes and returns the updated configuration if needed.
_processShippingChanges()  : mixed
Process any shipping changes.
_recalculateOrderAmount()  : KlarnaHubOrderExtender
Recalculates order amount.
_renderRecalculationFailure()  : mixed
Renders recalculation failure content.
_renderRecalculationSuccess()  : mixed
Renders recalculation success content.
_unsetAdditionalAmounts()  : mixed
Removes additional amounts cached in gm configuration table.
buildOrderLine()  : array<string|int, mixed>
getOrderTotalData()  : array<string|int, mixed>

Properties

$klarnaHubModuleCodes

protected array<string|int, mixed> $klarnaHubModuleCodes = ['KlarnaHub', 'KlarnaPaylaterHub', 'KlarnaPaynowHub', 'KlarnaSliceitHub', 'KlarnaBanktransferHub']

Methods

_addKlarnaHubOrderDetailsScript()

Loads the Gambio Hub order details JavaScript file.

protected _addKlarnaHubOrderDetailsScript() : KlarnaHubOrderExtender

The script will adjust the order details page for Gambio Hub compatibility. Check the order_details.js for further information.

Return values
KlarnaHubOrderExtender

Returns same instance for chained method calls.

_createKlarnaHubOrder()

Returns a Klarna order instance.

protected _createKlarnaHubOrder(array<string|int, mixed> $klarnaHubConfigurationArray) : KlarnaHubOrder
Parameters
$klarnaHubConfigurationArray : array<string|int, mixed>
Return values
KlarnaHubOrder

_getAdditionalAmounts()

Returns additional amounts cached in gm configuration table.

protected _getAdditionalAmounts() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

_getOrderSubtotal()

Returns the order subtotal value.

protected _getOrderSubtotal() : float
Return values
float

_prepareReduceInvoiceAmountData()

Prepares and returns the reduce invoice amount request payload.

protected _prepareReduceInvoiceAmountData(KlarnaHubOrder $klarnaHubOrder, float $subtotal, float $surchargeTotal, float $discountTotal, array<string|int, mixed> $additionalAmounts) : array<string|int, mixed>
Parameters
$klarnaHubOrder : KlarnaHubOrder

Contains Klarna related logic.

$subtotal : float

Current shop order subtotal value.

$surchargeTotal : float

Surcharge total required for the calculation.

$discountTotal : float

Discount total required for the calculation.

$additionalAmounts : array<string|int, mixed>

Klarna order additional amounts such as shipping and voucher.

Return values
array<string|int, mixed>

_processDiscountChanges()

Processes discount changes and returns the updated configuration if needed.

protected _processDiscountChanges(string $orderReference, string $referenceName, float $newDiscountAmount, array<string|int, mixed> $klarnaHubConfigurationArray) : array<string|int, mixed>
Parameters
$orderReference : string

The order reference in the database.

$referenceName : string

The name of the discount.

$newDiscountAmount : float

New voucher amount.

$klarnaHubConfigurationArray : array<string|int, mixed>

Klarna hub configuration data.

Return values
array<string|int, mixed>

_processShippingChanges()

Process any shipping changes.

protected _processShippingChanges(float $newShippingCosts) : mixed
Parameters
$newShippingCosts : float
Return values
mixed

_renderRecalculationFailure()

Renders recalculation failure content.

protected _renderRecalculationFailure() : mixed
Return values
mixed

_renderRecalculationSuccess()

Renders recalculation success content.

protected _renderRecalculationSuccess() : mixed
Return values
mixed

_unsetAdditionalAmounts()

Removes additional amounts cached in gm configuration table.

protected _unsetAdditionalAmounts() : mixed
Return values
mixed

buildOrderLine()

protected buildOrderLine(string $referenceName, string $orderReference, float $newDiscountAmount) : array<string|int, mixed>
Parameters
$referenceName : string
$orderReference : string
$newDiscountAmount : float
Return values
array<string|int, mixed>

getOrderTotalData()

protected getOrderTotalData(string $orderReference, string $referenceName, float $newDiscountAmount) : array<string|int, mixed>
Parameters
$orderReference : string
$referenceName : string
$newDiscountAmount : float
Return values
array<string|int, mixed>

Search results