Package DE_EPAGES::Payment::API::Object::PaymentMethod
object interface for PaymentMethod.
Base |
DE_EPAGES::Object::API::Object::Object |
Functions
- canDelete
- className
- dbPackage
- featureName
- getLevels
- getMaxPriceValue
- getMinPriceValue
- getPaymentMethodDiscount
- levels
- price
- setLevels
- setMaxPriceValue
- setMinPriceValue
- setPaymentMethodDiscount
- template
- 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 |
$CanDelete = $Object->canDelete($aWarnings); |
Input |
|
Return |
|
className
Returns the class name, used for DAL access.
Syntax |
$ClassName = $PaymentMethod->className; |
Return |
|
dbPackage
Returns the database package, used for DAL access.
Syntax |
$DbPackage = $PaymentMethod->dbPackage; |
Return |
|
featureName
Returns the feature name.
Syntax |
$FeatureName = $PaymentMethod->featureName; |
Return |
|
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 |
|
Return |
|
getMaxPriceValue
Returns the price limit max value of this payment method. Returns undef if the payment method does not have a max value.
Syntax |
$Value = $PaymentMethod->getMaxPriceValue($CurrencyID); |
Example |
$Value = $PaymentMethod->getMaxPriceValue('EUR'); |
Input |
|
Return |
|
getMinPriceValue
Returns the price limit min value of this payment method. Returns undef if the payment method does not have a min value.
Syntax |
$Value = $PaymentMethod->getMinPriceValue($CurrencyID); |
Example |
$Value = $PaymentMethod->getMinPriceValue('EUR'); |
Input |
|
Return |
|
getPaymentMethodDiscount
Returns the discount or fee price value of this payment method. Returns undef if the payment method does not have a value.
Syntax |
$Value = $PaymentMethod->setPaymentMethodDiscount($CurrencyID); |
Example |
$Value = $PaymentMethod->setPaymentMethodDiscount('EUR'); |
Input |
|
Return |
|
levels
Returns all payment level objects of that payment method.
Syntax |
$aPaymentLevels = $Object->levels; |
Return |
|
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 |
|
Return |
|
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 |
|
setMaxPriceValue
Sets the price limit max value of this payment method.
Syntax |
$Paymentmethod->setMaxPriceValue($CurrencyID, $MinValue); |
Example |
$Paymentmethod->setMaxPriceValue('EUR', 50.00); $Paymentmethod->setMaxPriceValue('EUR', undef); |
Input |
|
setMinPriceValue
Sets the price limit min value of this payment method.
Syntax |
$Paymentmethod->setMinPriceValue($CurrencyID, $MinValue); |
Example |
$Paymentmethod->setMinPriceValue('EUR', 50.00); $Paymentmethod->setMinPriceValue('EUR', undef); |
Input |
|
setPaymentMethodDiscount
Sets the discount or fee value of this payment method.
Syntax |
$Paymentmethod->setPaymentMethodDiscount($CurrencyID, $Value); |
Example |
$Paymentmethod->setPaymentMethodDiscount('EUR', 5.00); $Paymentmethod->setPaymentMethodDiscount('EUR', undef); |
Input |
|
template
This function is used to overwrite the given template for the purpose that each payment method can define there own template (visualisation).
Syntax |
$Name = $Object->template($Name, $ObjectPageType); |
Input |
|
Return |
|
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 |
|
Return |
|