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

Package DE_EPAGES::Order::API::Object::LineItemPayment

object interface for LineItemPayment.

Base
DE_EPAGES::Order::API::Object::LineItem

Functions

checkAmount
className
dbPackage
executePayment
hirePurchase
prepareOrder
recalculate

checkAmount

This functions allows a payment line item to check if the ordered amount differs from the amount defined in the transaction. Overwrite this function for security checks in external payment or checkout methods.

Syntax
$result = $PaymentLineItem->checkAmount;
Return
$result (boolean)
true if the ordered amount matches the transasctional amount

className

Returns the class name, used for DAL access.

Syntax
$ClassName = $LineItemPayment->className;
Return
$ClassName (String)
class name

dbPackage

Returns the database package, used for DAL access.

Syntax
$DbPackage = $LineItemPayment->dbPackage;
Return
$DbPackage (String)
database package name

executePayment

This function allows a payment line item to initiate the payment process. Override this function to interrupt the basket processing, for example to display additional pages for collection payment information. The default implementation does nothing. Called by DE_EPAGES::Order::Hooks::Basket::OnBasket2OrderExecutePayment Called by DE_EPAGES::Order::Hooks::Order::OnOrderExecutePayment

Syntax
$PaymentLineItem->executePayment($hValues);
Example
sub executePayment {
    my $self = shift;
    my ($hParams)= @_;

    my $Object = defined $hParams->{'Order'} ? $hParams->{'Order'} : $hParams->{'Basket'};
    my $Servlet = $hParams->{'Servlet'};

    # display the credit card form
    $Servlet->vars('ObjectID', $Object->id);
    Error('INVALID_FORM', {
        'ViewVars'=> {
            'FormError' => 0,
        },
        'ViewAction' => 'ViewCreditCardForm',
    });

    return;
}
Input
$hValues (ref.hash)
environment information
  • Basket - basket object
  • Servlet - servlet handling the current request
  • Order - order object (optional)

hirePurchase

This function allows a payment line item to initiate hire purchase (or payment in rates). The default implementation checks if hire purchase is posssible for the current basket with the slected payment method ($self->get('IsHirePurchaseAllowed')) and if hire purchase has not already been activated for the basket ($self->get('IsHirePurchaseOK')). It displays the hire purchase form using the ViewPaymentHirePurchase action. Override this function to display a custom hire purchase form. Called by DE_EPAGES::Order::Hooks::Basket::OnBasket2OrderHirePurchase

Syntax
$PaymentLineItem->hirePurchase($hValues);
Input
$hValues (ref.hash)
environment information
  • Basket - basket object
  • Servlet - servlet handling the current request

prepareOrder

This functions allows a payment line item to prepare a basket for the payment process. The default implementation does nothing. Called by DE_EPAGES::Order::Hooks::Basket::OnBasket2OrderPayment

Syntax
$PaymentLineItem->prepareOrder($hValues);
Input
$hValues (ref.hash)
environment information
  • Basket - basket object
  • Servlet - servlet handling the current request

recalculate

Standard payment lineitems call the PaymentMethod function DE_EPAGES::Order::API::Object::ContainerPaymentMethod::recalculateLineItem to recalculate the item. Resets the HirePurchase attributes if the line item container ShippingSubTotal is changed.

Syntax
$LineItemPayment->recalculate($Container, $hValues);
Input
$Container (object)
lineitemcontainer
$hValues (ref.hash)
values which will be changed