VirtueMart  3.2.14.9808
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | List of all members
vmPSPlugin Class Reference
Inheritance diagram for vmPSPlugin:
Inheritance graph
[legend]
Collaboration diagram for vmPSPlugin:
Collaboration graph
[legend]

Public Member Functions

 __construct (&$subject, $config)
 
 getVarsToPush ()
 
 setConvertable ($toConvert)
 
 selectedThisType ($psType)
 
 onStoreInstallPluginTable ($jplugin_id, $name=FALSE)
 
 onSelectCheck (VirtueMartCart $cart)
 
 displayListFE (VirtueMartCart $cart, $selected=0, &$htmlIn)
 
 onSelectedCalculatePrice (VirtueMartCart $cart, array &$cart_prices, &$cart_prices_name)
 
 onCheckAutomaticSelected (VirtueMartCart $cart, array $cart_prices=array(), &$methodCounter=0)
 
 selectedThisElement ($element)
 
 onShowOrderBE ($_virtuemart_order_id, $_method_id)
 
 onShowOrderPrint ($order_number, $method_id)
 
 onUpdateOrder ($formData)
 
 onUpdateOrderLine ($formData)
 
 onEditOrderLineBE ($orderId, $lineId)
 
 onShowOrderLineFE ($orderId, $lineId)
 
 onNotification ()
 
 onResponseReceived (&$virtuemart_order_id, &$html)
 
 getDebug ()
 
 setDebug ($params)
 
 decryptFields ($method)
 
 getHtmlRowBE ($key, $value)
 
 getSelectable (VirtueMartCart $cart, &$method_id, $cart_prices)
 
 convert_condition_amount (&$method)
 
 getEmailCurrency (&$method)
 
 displayTaxRule ($tax_id)
 
 getCosts (VirtueMartCart $cart, $method, $cart_prices)
 
 getCartAmount ($cart_prices)
 
 convertToVendorCurrency (&$method)
 
 setCartPrices (VirtueMartCart $cart, &$cart_prices, $method, $progressive=true)
 
 setInConfirmOrder ($cart)
 
 processConfirmedOrderPaymentResponse ($returnValue, $cart, $order, $html, $payment_name, $new_status= '')
 
 emptyCart ($session_id=NULL, $order_number=NULL)
 
 emptyCartFromStorageSession ($session_id, $order_number)
 
 _emptyCartFromStorageSession ($data)
 
 handlePaymentUserCancel ($virtuemart_order_id)
 
 getLogFileName ()
 
 debugLog ($message, $title='', $type= 'message', $doDebug=true)
 
- Public Member Functions inherited from vmPlugin
 __construct (&$subject, $config)
 
 setConvertDecimal ($toConvert)
 
 convertDec (&$data)
 
 loadJLangThis ($fname, $type=0, $name=0)
 
 setPluginLoggable ($set=TRUE)
 
 setCryptedFields ($fieldNames)
 
 getOwnUrl ()
 
 display3rdInfo ($intro, $developer, $contactlink, $manlink)
 
 selectedThisByMethodId ($id= 'type')
 
 onStoreInstallPluginTable ($psType, $name=FALSE)
 
 getTableSQLLoggablefields ()
 
 getTableSQLFields ()
 
 setConfigParameterable ($paramsFieldName, $varsToPushParam)
 
 renderByLayout ($layout= 'default', $viewData=NULL, $name=NULL, $psType=NULL)
 
 getTemplatePath ($pluginName, $group, $layout= 'default')
 

Static Public Member Functions

static getPaymentCurrency (&$method, $getCurrency=FALSE)
 
static getAmountInCurrency ($amount, $currencyId)
 
static getAmountValueInCurrency ($amount, $currencyId)
 
- Static Public Member Functions inherited from vmPlugin
static loadJLang ($fname, $type, $name)
 
static getVarsToPushFromForm ($form)
 
static getVarsToPushByXML ($xmlFile, $name)
 

Public Attributes

 $methods = null
 

Protected Member Functions

 onShowOrderFE ($virtuemart_order_id, $virtuemart_method_id, &$method_info)
 
 getPluginMethod ($method_id)
 
 getPluginMethods ($vendorId)
 
 getDataByOrderId ($virtuemart_order_id)
 
 getDatasByOrderId ($virtuemart_order_id)
 
 getDataByOrderNumber ($order_number)
 
 getDatasByOrderNumber ($order_number)
 
 getOrderWeight (VirtueMartCart $cart, $to_weight_unit)
 
 getThisName ($virtuemart_method_id)
 
 storePSPluginInternalData ($values, $primaryKey=0, $preload=FALSE)
 
 sendEmailToVendorAndAdmins ($subject=NULL, $message=NULL)
 
 displayLogos ($logo_list)
 
 renderPluginName ($plugin)
 
 getPluginHtml ($plugin, $selectedPlugin, $pluginSalesPrice)
 
 getHtmlHeaderBE ()
 
 getHtmlRow ($key, $value, $class= '')
 
 checkConditions ($cart, $method, $cart_prices)
 
 calculateSalesPrice ($cart, $method, $cart_prices)
 
 logInfo ($text, $type= 'message', $doLog=false)
 
- Protected Member Functions inherited from vmPlugin
 selectedThis ($psType, $name=0, $jid=null)
 
 selectedThisByJPluginId ($jplugin_id= 'type')
 
 getJoomlaPluginId ()
 
 createTableSQL ($tableComment, $tablesFields=0)
 
 getTablePluginParams ($psType, $name, $id, &$xParams, &$varsToPush)
 
 setOnTablePluginParams ($name, $id, &$table)
 
 declarePluginParams ($psType, &$data, $blind=0, $blind2=0)
 
 getVmPluginMethod ($int, $cache=true)
 
 storePluginInternalData (&$values, $primaryKey=0, $id=0, $preload=FALSE)
 
 getPluginInternalData ($id, $primaryKey=0)
 
 createPluginTableObject ($tableName, $tableFields, $primaryKey, $tableId, $loggable=FALSE)
 
 removePluginInternalData ($id, $primaryKey=0)
 

Protected Attributes

 $_toConvert = false
 
- Protected Attributes inherited from vmPlugin
 $_psType = 0
 
 $_jid = 0
 
 $_vmpItable = 0
 
 $_tablename = 0
 
 $_tableId = 'id'
 
 $_tablepkey = 0
 
 $_vmpCtable = 0
 
 $_configTable = 0
 
 $_configTableFileName = 0
 
 $_configTableClassName = 0
 
 $_xParams = 0
 
 $_varsToPushParam = array()
 
 $_idName = 0
 
 $_configTableFieldName = 0
 
 $_debug = FALSE
 
 $_loggable = FALSE
 
 $_cryptedFields = false
 
 $_toConvertDec = false
 

Private Member Functions

 getOrderMethodNamebyOrderId ($virtuemart_order_id)
 
 getOrderPluginName ($order_number, $pluginmethod_id)
 

Static Private Member Functions

static session_decode ($session_data)
 
static session_encode ($session_data_array)
 

Constructor & Destructor Documentation

vmPSPlugin::__construct ( $subject,
  $config 
)

Member Function Documentation

vmPSPlugin::_emptyCartFromStorageSession (   $data)
vmPSPlugin::calculateSalesPrice (   $cart,
  $method,
  $cart_prices 
)
protected

calculateSalesPrice

Parameters
$value
$tax_idtax id
Returns
$salesPrice
vmPSPlugin::checkConditions (   $cart,
  $method,
  $cart_prices 
)
protected

Enter description here ...

Author
Valerie Isaksen
Max Milbers
Parameters
VirtueMartCart$cart
int$method
array$cart_prices
vmPSPlugin::convert_condition_amount ( $method)
Parameters
$method
vmPSPlugin::convertToVendorCurrency ( $method)
vmPSPlugin::debugLog (   $message,
  $title = '',
  $type = 'message',
  $doDebug = true 
)

log all messages of type ERROR log in case the debug option is on, and the log option is on

Parameters
string$messagethe message to write
string$title
string$typemessage, deb-ug, info, error
boolean$doDebugin payment notification, we don't want to use vmdebug even if the debug option is on
vmPSPlugin::decryptFields (   $method)
vmPSPlugin::displayListFE ( VirtueMartCart  $cart,
  $selected = 0,
$htmlIn 
)

displayListFE This event is fired to display the pluginmethods in the cart (edit shipment/payment) for example

Parameters
object$cartCart object
integer$selectedID of the method selected
Returns
boolean True on success, false on failures, null when this plugin was not selected. On errors, JError::raiseWarning (or JError::raiseError) must be used to set a message.
Author
Valerie Isaksen
Max Milbers
vmPSPlugin::displayLogos (   $logo_list)
protected

displays the logos of a VirtueMart plugin

Author
Valerie Isaksen
Max Milbers
Parameters
array$logo_list
Returns
html with logos
vmPSPlugin::displayTaxRule (   $tax_id)

displayTaxRule

Parameters
int$tax_id
Returns
string $html:
vmPSPlugin::emptyCart (   $session_id = NULL,
  $order_number = NULL 
)
vmPSPlugin::emptyCartFromStorageSession (   $session_id,
  $order_number 
)
static vmPSPlugin::getAmountInCurrency (   $amount,
  $currencyId 
)
static
Parameters
$amount
$currencyId
Returns
array
static vmPSPlugin::getAmountValueInCurrency (   $amount,
  $currencyId 
)
static
Parameters
$amount
$currencyId
Returns
array
vmPSPlugin::getCartAmount (   $cart_prices)

Get the cart amount for checking conditions if the payment conditions are fullfilled

Parameters
$cart_prices
Returns
mixed
vmPSPlugin::getCosts ( VirtueMartCart  $cart,
  $method,
  $cart_prices 
)
vmPSPlugin::getDataByOrderId (   $virtuemart_order_id)
finalprotected

Get Method Data for a given Payment ID

Author
Valérie Isaksen
Parameters
int$virtuemart_order_idThe order ID
Returns
$methodData
vmPSPlugin::getDataByOrderNumber (   $order_number)
finalprotected

Get Method Data for a given Payment ID

Author
Valérie Isaksen
Parameters
int$order_numberThe order Number
Returns
$methodData
vmPSPlugin::getDatasByOrderId (   $virtuemart_order_id)
finalprotected

Get Method Datas for a given Payment ID

Author
Valérie Isaksen
Parameters
int$virtuemart_order_idThe order ID
Returns
$methodData
vmPSPlugin::getDatasByOrderNumber (   $order_number)
finalprotected

Get Method Datas for a given Payment ID

Author
Valérie Isaksen
Parameters
int$order_numberThe order Number
Returns
$methodData
vmPSPlugin::getDebug ( )
vmPSPlugin::getEmailCurrency ( $method)
vmPSPlugin::getHtmlHeaderBE ( )
protected
vmPSPlugin::getHtmlRow (   $key,
  $value,
  $class = '' 
)
protected
vmPSPlugin::getHtmlRowBE (   $key,
  $value 
)
vmPSPlugin::getLogFileName ( )
vmPSPlugin::getOrderMethodNamebyOrderId (   $virtuemart_order_id)
private
Author
Valerie Isaksen
Max Milbers
Parameters
int$virtuemart_order_id
Returns
string pluginName from the plugin table
vmPSPlugin::getOrderPluginName (   $order_number,
  $pluginmethod_id 
)
private
vmPSPlugin::getOrderWeight ( VirtueMartCart  $cart,
  $to_weight_unit 
)
protected

Get the total weight for the order, based on which the proper shipping rate can be selected.

Parameters
object$cartCart object
Returns
float Total weight for the order
static vmPSPlugin::getPaymentCurrency ( $method,
  $getCurrency = FALSE 
)
static
Parameters
$method
bool$getCurrency
vmPSPlugin::getPluginHtml (   $plugin,
  $selectedPlugin,
  $pluginSalesPrice 
)
protected
vmPSPlugin::getPluginMethod (   $method_id)
finalprotected

Get Plugin Data for a go given plugin ID

Author
Valérie Isaksen
Parameters
int$pluginmethod_idThe method ID
Returns
method data
vmPSPlugin::getPluginMethods (   $vendorId)
protected

Fill the array with all plugins found with this plugin for the current vendor Todo it would be nicer to use here the correct vmtable methods

Returns
True when plugins(s) was (were) found for this vendor, false otherwise
Author
Oscar van Eijk
max Milbers
valerie Isaksen
vmPSPlugin::getSelectable ( VirtueMartCart  $cart,
$method_id,
  $cart_prices 
)

getSelectable This method returns the number of valid methods

Parameters
VirtueMartCartcart: the cart object
$method_ideg $virtuemart_shipmentmethod_id
vmPSPlugin::getThisName (   $virtuemart_method_id)
finalprotected

getThisName Get the name of the method

Parameters
int$idThe method ID
Author
Valérie Isaksen
Returns
string Shipment name
vmPSPlugin::getVarsToPush ( )
vmPSPlugin::handlePaymentUserCancel (   $virtuemart_order_id)
Parameters
integer$virtuemart_order_idthe id of the order
vmPSPlugin::logInfo (   $text,
  $type = 'message',
  $doLog = false 
)
protected

logInfo to help debugging Payment notification for example Keep it for compatibilty

vmPSPlugin::onCheckAutomaticSelected ( VirtueMartCart  $cart,
array  $cart_prices = array(),
$methodCounter = 0 
)

onCheckAutomaticSelected Checks how many plugins are available. If only one, the user will not have the choice. Enter edit_xxx page The plugin must check first if it is the correct type

Author
Valerie Isaksen
Parameters
VirtueMartCartcart: the cart object
Returns
null if no plugin was found, 0 if more then one plugin was found, virtuemart_xxx_id if only one plugin is found
vmPSPlugin::onEditOrderLineBE (   $orderId,
  $lineId 
)

OnEditOrderLineBE This method is fired when editing the order line details in the backend. It can be used to add line specific package codes

Parameters
integer$_orderIdThe order ID
integer$_lineId
Returns
mixed Null for method that aren't active, text (HTML) otherwise
Author
Oscar van Eijk
vmPSPlugin::onNotification ( )

This event is fired when the method notifies you when an event occurs that affects the order. Typically, the events represents for payment authorizations, Fraud Management Filter actions and other actions, such as refunds, disputes, and chargebacks.

NOTE for Plugin developers: If the plugin is NOT actually executed (not the selected payment method), this method must return NULL

Parameters
$return_contextit was given and sent in the payment form. The notification should return it back. Used to know which cart should be emptied, in case it is still in the session.
int$virtuemart_order_id: payment order id
char$new_status: new_status for this order id.
Returns
mixed Null when this method was not selected, otherwise the true or false
Author
Valerie Isaksen
vmPSPlugin::onResponseReceived ( $virtuemart_order_id,
$html 
)

OnResponseReceived This event is fired when the method returns to the shop after the transaction

the method itself should send in the URL the parameters needed NOTE for Plugin developers: If the plugin is NOT actually executed (not the selected payment method), this method must return NULL

Parameters
int$virtuemart_order_id: should return the virtuemart_order_id
text$html,the html to display
Returns
mixed Null when this method was not selected, otherwise the true or false
Author
Valerie Isaksen
vmPSPlugin::onSelectCheck ( VirtueMartCart  $cart)

This event is fired after the payment method has been selected. It can be used to store additional payment info in the cart.

Author
Max Milbers
Valérie isaksen
Parameters
VirtueMartCart$cart,the actual cart
Returns
null if the payment was not selected, true if the data is valid, error message if the data is not vlaid
vmPSPlugin::onSelectedCalculatePrice ( VirtueMartCart  $cart,
array &  $cart_prices,
$cart_prices_name 
)
vmPSPlugin::onShowOrderBE (   $_virtuemart_order_id,
  $_method_id 
)

This method is fired when showing the order details in the backend. It displays the the payment method-specific data. All plugins must reimplement this method.

Parameters
integer$_virtuemart_order_idThe order ID
integer$_paymethod_idPayment method used for this order
Returns
mixed Null when for payment methods that were not selected, text (HTML) otherwise
Author
Max Milbers
Valerie Isaksen
vmPSPlugin::onShowOrderFE (   $virtuemart_order_id,
  $virtuemart_method_id,
$method_info 
)
protected

This method is fired when showing the order details in the frontend. It displays the method-specific data.

Parameters
integer$order_idThe order ID
Returns
mixed Null for methods that aren't active, text (HTML) otherwise
Author
Max Milbers
Valerie Isaksen
vmPSPlugin::onShowOrderLineFE (   $orderId,
  $lineId 
)

This method is fired when showing the order details in the frontend, for every orderline. It can be used to display line specific package codes, e.g. with a link to external tracking and tracing systems

Parameters
integer$_orderIdThe order ID
integer$_lineId
Returns
mixed Null for method that aren't active, text (HTML) otherwise
Author
Oscar van Eijk
vmPSPlugin::onShowOrderPrint (   $order_number,
  $method_id 
)

This method is fired when showing when priting an Order It displays the the payment method-specific data.

Parameters
integer$_virtuemart_order_idThe order ID
integer$method_idmethod used for this order
Returns
mixed Null when for payment methods that were not selected, text (HTML) otherwise
Author
Valerie Isaksen
vmPSPlugin::onStoreInstallPluginTable (   $jplugin_id,
  $name = FALSE 
)

Create the table for this plugin if it does not yet exist. This functions checks if the called plugin is active one. When yes it is calling the standard method to create the tables

Author
Valérie Isaksen
vmPSPlugin::onUpdateOrder (   $formData)

Save updated order data to the method specific table

Parameters
array$_formDataForm data
Returns
mixed, True on success, false on failures (the rest of the save-process will be skipped!), or null when this method is not actived.
Author
Oscar van Eijk
vmPSPlugin::onUpdateOrderLine (   $formData)

Save updated orderline data to the method specific table

Parameters
array$_formDataForm data
Returns
mixed, True on success, false on failures (the rest of the save-process will be skipped!), or null when this method is not actived.
Author
Oscar van Eijk
vmPSPlugin::processConfirmedOrderPaymentResponse (   $returnValue,
  $cart,
  $order,
  $html,
  $payment_name,
  $new_status = '' 
)
vmPSPlugin::renderPluginName (   $plugin)
protected
vmPSPlugin::selectedThisElement (   $element)

check if it is the correct element

Parameters
string$elementeither standard or paypal
Returns
boolean
vmPSPlugin::selectedThisType (   $psType)

check if it is the correct type

Parameters
string$psTypeeither payment or shipment
Returns
boolean
vmPSPlugin::sendEmailToVendorAndAdmins (   $subject = NULL,
  $message = NULL 
)
protected

Something went wrong, Send notification to all administrators

Parameters
stringsubject of the mail
stringmessage
static vmPSPlugin::session_decode (   $session_data)
staticprivate
static vmPSPlugin::session_encode (   $session_data_array)
staticprivate
vmPSPlugin::setCartPrices ( VirtueMartCart  $cart,
$cart_prices,
  $method,
  $progressive = true 
)
Parameters
VirtueMartCart$cart
$cart_prices
$method
bool$progressive
Returns
mixed
vmPSPlugin::setConvertable (   $toConvert)
vmPSPlugin::setDebug (   $params)
vmPSPlugin::setInConfirmOrder (   $cart)

setInConfirmOrder In VM 2.6.7, we introduced a double order checking. Now plugin itself can define if it should be possible to use the same trigger more than one time. this should be done at the begin of the trigger

Author
Valérie Isaksen
Parameters
$cart
vmPSPlugin::storePSPluginInternalData (   $values,
  $primaryKey = 0,
  $preload = FALSE 
)
protected

Extends the standard function in vmplugin. Extendst the input data by virtuemart_order_id Calls the parent to execute the write operation

Author
Max Milbers
Parameters
array$_values
string$_table

Member Data Documentation

vmPSPlugin::$_toConvert = false
protected
vmPSPlugin::$methods = null

The documentation for this class was generated from the following file: