Skip to content

Latest commit

 

History

History
2227 lines (1156 loc) · 50.4 KB

class.PaymentModuleCore.md

File metadata and controls

2227 lines (1156 loc) · 50.4 KB

Class PaymentModuleCore

Contents

Properties

Methods

Properties

$currencies

public mixed $currencies = true

$currencies_mode

public mixed $currencies_mode = 'checkbox'

$currentOrder

public integer $currentOrder

$_INSTANCE

protected \protected $_INSTANCE = array()

$_confirmations

protected \protected $_confirmations = array()

$_errors

protected \protected $_errors = array()

$_generate_config_xml_mode

protected \protected $_generate_config_xml_mode = false

$_lang

protected array $_lang = array()

$_path

protected string $_path = null

$active

public boolean $active = false

$author

public string $author

$cache_permissions

protected \protected $cache_permissions = array()

$classInModule

public array $classInModule = array()

$context

protected \Context $context

$database_version

public mixed $database_version

$dependencies

public array $dependencies = array()

$description

public string $description

$displayName

public string $displayName

$exceptionsCache

protected mixed $exceptionsCache = null

$id

public integer $id = null

$identifier

protected \protected $identifier = 'id_module'

$l_cache

protected \protected $l_cache = array()

$limited_countries

public array $limited_countries = array()

$local_path

protected string $local_path = null

$modules_cache

protected \protected $modules_cache

$name

public string $name

$need_instance

public integer $need_instance = 1

$ps_versions_compliancy

public array $ps_versions_compliancy = array('min' => '1.4', 'max' => '1.6')

$registered_version

public string $registered_version

$smarty

protected \Smarty_Data $smarty

$tab

public string $tab = null

$table

protected \protected $table = 'module'

$version

public float $version

$warning

public string $warning

Methods

__construct

mixed ModuleCore::__construct(string $name, \Context $context)

Constructor

Arguments

  • $name string - Module unique name
  • $context Context

_clearCache

mixed ModuleCore::_clearCache($template, $cache_id, $compile_id)

Arguments

  • $template mixed
  • $cache_id mixed
  • $compile_id mixed

_generateConfigXml

mixed ModuleCore::_generateConfigXml()

_getApplicableTemplateDir

mixed ModuleCore::_getApplicableTemplateDir($template)

Arguments

  • $template mixed

_getFormatedAddress

String PaymentModuleCore::_getFormatedAddress(\Address $the_address, $line_sep, $fields_style)

Arguments

  • $the_address Address
  • $line_sep mixed
  • $fields_style mixed

_getTxtFormatedAddress

String PaymentModuleCore::_getTxtFormatedAddress($the_address)

Arguments

  • $the_address mixed

_isTemplateOverloaded

mixed ModuleCore::_isTemplateOverloaded($template)

Arguments

  • $template mixed

_isTemplateOverloadedStatic

mixed ModuleCore::_isTemplateOverloadedStatic($module_name, $template)

Arguments

  • $module_name mixed
  • $template mixed

addCheckboxCountryRestrictionsForModule

mixed PaymentModuleCore::addCheckboxCountryRestrictionsForModule(array $shops)

Add checkbox country restrictions for a new module

Arguments

  • $shops array

addCheckboxCurrencyRestrictionsForModule

mixed PaymentModuleCore::addCheckboxCurrencyRestrictionsForModule(array $shops)

Add checkbox currency restrictions for a new module

Arguments

  • $shops array

addCurrencyPermissions

boolean PaymentModuleCore::addCurrencyPermissions(integer $id_currency, array $id_module_list)

Allows specified payment modules to be used by a specific currency

Arguments

  • $id_currency integer
  • $id_module_list array

addOverride

boolean ModuleCore::addOverride(string $classname)

Add all methods in a module override to the override class

Arguments

  • $classname string

addRadioCurrencyRestrictionsForModule

mixed PaymentModuleCore::addRadioCurrencyRestrictionsForModule(array $shops)

Add radio currency restrictions for a new module

Arguments

  • $shops array

adminDisplayInformation

mixed ModuleCore::adminDisplayInformation(string $msg)

add a info message to display at the top of the admin page

Arguments

  • $msg string

adminDisplayWarning

mixed ModuleCore::adminDisplayWarning(string $msg)

add a warning message to display at the top of the admin page

Arguments

  • $msg string

cleanPositions

mixed ModuleCore::cleanPositions($id_hook, $shop_list)

Arguments

  • $id_hook mixed
  • $shop_list mixed

configXmlStringFormat

mixed ModuleCore::configXmlStringFormat($string)

Arguments

  • $string mixed

disable

mixed ModuleCore::disable(boolean $forceAll)

Desactivate current module.

Arguments

  • $forceAll boolean - If true, disable module for all shop

disableByName

true ModuleCore::disableByName(array|string $name)

This function disable module $name. If an $name is an array, this will disable all of them

Arguments

  • $name array|string

display

mixed ModuleCore::display($file, $template, $cacheId, $compileId)

Arguments

  • $file mixed
  • $template mixed
  • $cacheId mixed
  • $compileId mixed

displayConfirmation

mixed ModuleCore::displayConfirmation($string)

Arguments

  • $string mixed

displayError

mixed ModuleCore::displayError($error)

Arguments

  • $error mixed

displayFlags

mixed ModuleCore::displayFlags(array $languages, integer $default_language, string $ids, string $id, boolean $return, boolean $use_vars_instead_of_ids)

Display flags in forms for translations

Arguments

  • $languages array - All languages available
  • $default_language integer - Default language id
  • $ids string - Multilingual div ids in form
  • $id string - Current div id]
  • $return boolean - define the return way : false for a display, true for a return
  • $use_vars_instead_of_ids boolean - use an js vars instead of ids seperate by "¤"

editExceptions

boolean ModuleCore::editExceptions($id_hook, array $excepts)

Edit exceptions for module->Hook

Arguments

  • $id_hook mixed
  • $excepts array - List of shopID and file name

enable

mixed ModuleCore::enable(boolean $forceAll)

Activate current module.

Arguments

  • $forceAll boolean - If true, enable module for all shop

enableByName

true ModuleCore::enableByName(array|string $name)

This function enable module $name. If an $name is an array, this will enable all of them

Arguments

  • $name array|string

findTranslation

mixed ModuleCore::findTranslation($name, $string, $source)

Arguments

  • $name mixed
  • $string mixed
  • $source mixed

formatProductAndVoucherForEmail

mixed PaymentModuleCore::formatProductAndVoucherForEmail($content)

Arguments

  • $content mixed

getAuthorizedModules

mixed ModuleCore::getAuthorizedModules($group_id)

Get Unauthorized modules for a client group

Arguments

  • $group_id mixed

getConfirmations

array ModuleCore::getConfirmations()

Get module messages confirmation

getCurrency

\Currency PaymentModuleCore::getCurrency($current_id_currency)

Arguments

  • $current_id_currency mixed

getErrors

array ModuleCore::getErrors()

Get module errors

getExceptions

mixed ModuleCore::getExceptions($hookID, $dispatch)

Arguments

  • $hookID mixed
  • $dispatch mixed

getInstalledPaymentModules

array PaymentModuleCore::getInstalledPaymentModules()

List all installed and active payment modules

getInstanceById

\Module ModuleCore::getInstanceById(integer $id_module)

Return an instance of the specified module

Arguments

  • $id_module integer - Module ID

getInstanceByName

\Module ModuleCore::getInstanceByName(string $module_name)

Return an instance of the specified module

Arguments

  • $module_name string - Module name

getLocalPath

string ModuleCore::getLocalPath()

Get local path for module

getModuleIdByName

integer ModuleCore::getModuleIdByName($name)

Get id module by name

Arguments

  • $name mixed

getModuleName

mixed ModuleCore::getModuleName($module)

Arguments

  • $module mixed

getModuleNameFromClass

boolean|string ModuleCore::getModuleNameFromClass(mixed $currentClass)

This function is used to determine the module name of an AdminTab which belongs to a module, in order to keep translation related to a module in its directory (instead of $_LANGADM)

Arguments

  • $currentClass mixed - the

getModulesDirOnDisk

array ModuleCore::getModulesDirOnDisk()

Return modules directory list

getModulesInstalled

array ModuleCore::getModulesInstalled(integer $position)

Return installed modules

Arguments

  • $position integer - Take only positionnables modules

getModulesOnDisk

array ModuleCore::getModulesOnDisk(boolean $useConfig, $loggedOnAddons, $id_employee)

Return available modules

Arguments

  • $useConfig boolean - in order to use config.xml file in module dir
  • $loggedOnAddons mixed
  • $id_employee mixed

getNonNativeModuleList

array ModuleCore::getNonNativeModuleList()

Return non native module

getPathUri

string ModuleCore::getPathUri()

Get uri path for module

getPaymentModules

array ModuleCore::getPaymentModules()

Returns the list of the payment module associated to the current customer

getPermission

boolean ModuleCore::getPermission(array $variable, object $employee)

Check employee permission for module

Arguments

  • $variable array - (action)
  • $employee object

getPermissionStatic

boolean ModuleCore::getPermissionStatic(integer $id_module, array $variable, object $employee)

Check employee permission for module (static method)

Arguments

  • $id_module integer
  • $variable array - (action)
  • $employee object

getPosition

mixed ModuleCore::getPosition($id_hook)

Arguments

  • $id_hook mixed

getTemplatePath

string ModuleCore::getTemplatePath(string $template)

Get realpath of a template of current module (check if template is overriden too)

Arguments

  • $template string

getUpgradeStatus

boolean ModuleCore::getUpgradeStatus($module_name)

Return the status of the upgraded module

Arguments

  • $module_name mixed

hookExec

string ModuleCore::hookExec(string $hook_name, array $hookArgs, $id_module)

Execute modules for specified hook

Arguments

  • $hook_name string - Hook Name
  • $hookArgs array - Parameters for the functions
  • $id_module mixed

hookExecPayment

mixed ModuleCore::hookExecPayment()

initUpgradeModule

boolean ModuleCore::initUpgradeModule($module)

Init the upgrade module

Arguments

  • $module mixed

install

mixed PaymentModuleCore::install()

installOverrides

boolean ModuleCore::installOverrides()

Install overrides files for the module

isCached

mixed ModuleCore::isCached($template, $cacheId, $compileId)

Arguments

  • $template mixed
  • $cacheId mixed
  • $compileId mixed

isEnabled

mixed ModuleCore::isEnabled($module_name)

Arguments

  • $module_name mixed

isHookableOn

boolean ModuleCore::isHookableOn(string $hook_name)

Check if the module is transplantable on the hook in parameter

Arguments

  • $hook_name string

isInstalled

mixed ModuleCore::isInstalled($module_name)

Arguments

  • $module_name mixed

isRegisteredInHook

mixed ModuleCore::isRegisteredInHook($hook)

Arguments

  • $hook mixed

l

string ModuleCore::l(string $string, boolean|string $specific, $id_lang)

Get translation for a given module text

Note: $specific parameter is mandatory for library files. Otherwise, translation key will not match for Module library when module is loaded with eval() Module::getModulesOnDisk()

Arguments

  • $string string - String to translate
  • $specific boolean|string - filename to use in translation key
  • $id_lang mixed

loadUpgradeVersionList

boolean ModuleCore::loadUpgradeVersionList($module_name, $module_version, $registered_version)

Load the available list of upgrade of a specified module with an associated version

Arguments

  • $module_name mixed
  • $module_version mixed
  • $registered_version mixed

needUpgrade

boolean ModuleCore::needUpgrade($module)

Check if a module need to be upgraded.

This method modify the module_cache adding an upgrade list file

Arguments

  • $module mixed

preCall

mixed PaymentModuleCore::preCall($module_name)

Arguments

  • $module_name mixed

registerExceptions

boolean ModuleCore::registerExceptions(integer $id_hook, array $excepts, array $shop_list)

Add exceptions for module->Hook

Arguments

  • $id_hook integer - Hook id
  • $excepts array - List of file name
  • $shop_list array - List of shop

registerHook

boolean ModuleCore::registerHook(string $hook_name, array $shop_list)

Connect module to a hook

Arguments

  • $hook_name string - Hook name
  • $shop_list array - List of shop linked to the hook (if null, link hook to all shops)

removeOverride

boolean ModuleCore::removeOverride(string $classname)

Remove all methods in a module override from the override class

Arguments

  • $classname string

runUpgradeModule

array ModuleCore::runUpgradeModule()

Run the upgrade for a given module name and version

setUpgradeMessage

mixed ModuleCore::setUpgradeMessage($upgrade_detail)

Set errors, warning or success message of a module upgrade

Arguments

  • $upgrade_detail mixed

uninstall

mixed PaymentModuleCore::uninstall()

uninstallOverrides

boolean ModuleCore::uninstallOverrides()

Uninstall overrides files for the module

unregisterExceptions

boolean ModuleCore::unregisterExceptions($hook_id, array $shop_list)

Unregister exceptions linked to module

Arguments

  • $hook_id mixed
  • $shop_list array - List of shop

unregisterHook

boolean ModuleCore::unregisterHook($hook_id, array $shop_list)

Unregister module from hook

Arguments

  • $hook_id mixed
  • $shop_list array - List of shop

updatePosition

mixed ModuleCore::updatePosition($id_hook, $way, $position)

Arguments

  • $id_hook mixed
  • $way mixed
  • $position mixed

upgradeModuleVersion

boolean ModuleCore::upgradeModuleVersion($name, $version)

Upgrade the registered version to a new one

Arguments

  • $name mixed
  • $version mixed

validateOrder

mixed PaymentModuleCore::validateOrder(integer $id_cart, integer $id_order_state, float $amount_paid, string $payment_method, string $message, $extra_vars, $currency_special, $dont_touch_amount, $secure_key, \Shop $shop)

Validate an order in database Function called from a payment module

Arguments

  • $id_cart integer - Value
  • $id_order_state integer - Value
  • $amount_paid float - Amount really paid by customer (in the default currency)
  • $payment_method string - Payment method (eg. 'Credit card')
  • $message string - Message to attach to order
  • $extra_vars mixed
  • $currency_special mixed
  • $dont_touch_amount mixed
  • $secure_key mixed
  • $shop Shop