ePages 6.10 - DE_EPAGES/Order/API/Object/ContainerPaymentMethod.pm

Package DE_EPAGES::Order::API::Object::ContainerPaymentMethod

object interface for PaymentMethod to handle features hire purchase and payment discounts.

Base
DE_EPAGES::Payment::API::Object::PaymentMethod

Functions

addToContainer
canAddToBasket
lineItem
recalculateLineItem

addToContainer

Adds payment and tax line item to container.

Syntax
$LineItem = $PaymentMethod->addToContainer($Container);
Input
$Container (object)
line item container
Return
$LineItem (object)
line item

canAddToBasket

Tests if a payment method can be added to the basket with the given currency. Uses function DE_EPAGES::Payment::API::Object::PaymentMethod::price to evaluate if payment methode has a price (price can be 0). Possible for methods, which costs, but have no price in the given currency.

Syntax
$PaymentMethod->canAddToBasket($hVars);
Input
$hVars (ref.hash)
vars of container and basket
Return
$Can (boolean)
can added to the basket

lineItem

Collect information for line item.

Syntax
my $hInfo = $PaymentMethod->lineItem($Container);
Input
$Container (object)
line item container
Return
$hInfo (ref.hash)
payment line item info, keys
  • BasePrice - shipping sub total of container - float
  • LineItemPrice - additional price for hire purchase - float
  • Name - name of payment method
  • PaymentMethod - self - object
  • Quantity - quantity is 1 - float
  • TaxClass - tax class of payment - object
  • TaxRate - tax rate - float

recalculateLineItem

Called to recalc the line item. And adds a payment discount if possible.

Syntax
$PaymentMethod->recalculateLineItem($LineItem);
Input
$LineItem (object)
line item