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

Package DE_EPAGES::Order::API::Object::LineItemPaymentExternal

contains functions used by external payments

Base
DE_EPAGES::Order::API::Object::LineItemPayment

Functions

checkAmount
executePayment
updateOnExecute

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

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)

updateOnExecute

This functions sets amount and currency.

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