ePages 6.11.0 - DE_EPAGES/Payment/API/Object/PaymentMethod.pm

Package DE_EPAGES::Payment::API::Object::PaymentMethod

object interface for PaymentMethod.

Base
DE_EPAGES::Object::API::Object::Object

Functions

canDelete
className
dbPackage
featureName
getLevels
levels
price
setLevels
usableAtStorefront

canDelete

Test if the object can be deleted. In case of the default payment method a warning is added. The default payment method can't be deleted.

Syntax
$Object->canDelete($aWarnings);
Input
$aWarnings (array.ref)
array of Warning Objects

className

Returns the class name, used for DAL access.

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

dbPackage

Returns the database package, used for DAL access.

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

featureName

Returns the feature name.

Syntax
$FeatureName = $PaymentMethod->featureName;
Return
$FeatureName (String)
feature name (undef means no feature count)

getLevels

Return the payment levels for the given currency in the requested tax model.

Syntax
$ahLevels = $Object->getLevels($CurrencyID, $TaxModel);
$ahLevels = $Object->getLevels($CurrencyID, $TaxModel, $ExtraPrecision);
Input
$CurrencyID (char(3))
currency id
$TaxModel (int)
tax model (1=gross/including tax, 0=net/without tax)
$ExtraPrecision (boolean)
(optional, default=0) extra precision for net prices
in back-office
Return
$ahLevels (int)
list of hashes, keys:
BaseValue, LowerBound, UpperBound, Multiplier, PaymentLevelID

levels

Returns all payment level objects of that payment method.

Syntax
$aPaymentLevels = $Object->levels;
Return
$aPaymentLevels (ref.array.object)
list of payment level opbjects

price

Returns the payment price by the given requirements. Needs to be implemented for a new payment method.

Syntax
$PaymentPrice = $Object->price( $hVars );
Example
$PaymentPrice = $PaymentMethod->price( {
    CurrencyID => 'USD',
    TaxModel   => $PaymentMethod->getSite()->get('TaxModel')
} );
Input
$hVars (ref.hash)
  • CurrencyID - alpha currency code (ISO 4217) - char(3)
  • TaxModel - gross or net price - int
Return
$PaymentPrice (money)
price of payment

setLevels

Sets all payment levels for the given currency. Deletes payment levels that are not included in the list. Calculates net prices from gross prices if $TaxModel is TAX_MODEL_GROSS.

Syntax
$Object->setLevels($CurrencyID, $TaxModel, $ahLevels);
Input
$CurrencyID (char(3))
currency id
$TaxModel (int)
tax model (1=gross/including tax, 0=net/without tax)
$ahLevels (int)
list of hashes, keys:
BaseValue, LowerBound, UpperBound, Multiplier

usableAtStorefront

Tests if a payment method with the given currency is visible in the storefront. Uses function DE_EPAGES::Payment::API::Object::PaymentMethod::price to evaluate if payment methode has a price (price can be 0).

Syntax
$Usable = $PaymentMethod->usableAtStorefront($hVars);
Input
$hVars (ref.hash)
  • CurrencyID - alpha currency code (ISO 4217) - char(3)
  • TaxModel - gross or net price - int
Return
$Usable (boolean)
true if payment method is usable in the storefront