ePages 7.37.0 - DE_EPAGES/Order/API/LineItemContainer.pm

Package DE_EPAGES::Order::API::LineItemContainer

The line item container

@EXPORT_OK
CheckSavePayment
CheckSaveShipping
SavePayment
SaveShipping
UpdateTaxModel

Functions

CheckSavePayment
CheckSaveShipping
SavePayment
SaveShipping
UpdateTaxModel

CheckSavePayment

Checks if the default payment method of a lineitemcontainer is in the list of valid maymentss. If not it will be replaced by a valid one.

Syntax
CheckSavePayment($Container);
Input
$Container (object)
line item container

CheckSaveShipping

Checks if the default shipping method of a lineitemcontainer is in the list of valid shippings. If not it will be replaced by a valid one.

Syntax
CheckSaveShipping($Container);
Input
$Container (object)
line item container

SavePayment

Set the new payment method for container. Adds a Warning 'PaymentMethodChanged' if another payment method is used, because the $NewPaymentMethod is not avaible (not visible, no price, ...). If $NewPaymentMethod is undefined, then the current payment method is re-validated. The warning 'PaymentMethodChanged' is added if the current payment is no longer available.

Syntax
SavePayment($Container, $NewPaymentMethod);
Input
$Container (object)
line item container
$NewPaymentMethod (object)
payment method (optional)

SaveShipping

Set the new shipping method for container. Adds a Warning 'ShippingMethodChanged' if another Shipping method is used, because the $NewShippingMethod is not avaible (not visible, no price, ...). If $NewShippingMethod is undefined, then the current shipping method is re-validated. The warning 'ShippingMethodChanged' is added if the current shipping is no longer available.

Syntax
SaveShipping($Container, $NewShippingMethod);
Input
$Container (object)
line item container
$NewShippingMethod (object)
shipping method (optional)

UpdateTaxModel

Updates the tax model of the LineItemContainer based on the billing address. Set tax model to net, when country of billing address in eu and vatid is valid. Set the container TaxModel to gross is shop is VAT released

Syntax
UpdateTaxModel($LineItemContainer);
Input
$LineItemContainer (object)
lineitemcontainer
Return
$NewTaxModel (int)
new tax model if tax model was changed, otherwise undef