Any idea how the code below works?
I found the error to be in the after_order_create()-function in moneybookers_payment.php module as the class doesn't exist, so the if-statement is run. This generates a warning, probably as prior to this the code below
Code:
includes/modules/payment/.php
has of course failed, as there is no file name - so far it has occured with moneybookersEWallet!
The fatal error occures when a new class (payment method) is to be generated (>>>>>> line):
Code:
function after_order_create($id) {
global $db, $order;
$sql = "SELECT orders_status, plugin FROM " . DB_PREFIX . "moneybookers WHERE security_token='" . $db->prepareInput($_SESSION['securityToken'] . '_' . $_SESSION['payment_order_iteration']) . "' LIMIT 1";
$r = $db->Execute($sql);
if ($r->fields['orders_status'] != -1) {
$className = $r->fields['plugin'];
if (!class_exists($r->fields['plugin'], false)) {
include(DIR_WS_MODULES . 'payment' . DIRECTORY_SEPARATOR . $r->fields['plugin'] . '.php');
}
>>>>>>>>>>>>>>>>>>>>>> $payMethod = new $className();
$key = $payMethod->_prefix . 'PROCESSING_ORDER_STATUS_ID';
$db->Execute("UPDATE " . TABLE_ORDERS . " SET orders_status=(SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = '$key' LIMIT 1) WHERE orders_id=$id");
$db->Execute("DELETE FROM " . DB_PREFIX . "moneybookers WHERE security_token='" . $db->prepareInput($_SESSION['securityToken'] . '_' . $_SESSION['payment_order_iteration']) ."'");
} else {
$db->Execute("UPDATE " . DB_PREFIX . "moneybookers SET id_order=$id WHERE security_token='" . $db->prepareInput($_SESSION['securityToken'] . '_' . $_SESSION['payment_order_iteration']) . "'");
}
}
The above code also leaves in the moneybookers-table two entries behind (both with id_order "0", same incremented security_token, different session_id and same order_status "-1"):
Code:
22 0 81ffa6cb8c2133b6f624b50b4cde1fc9_1 8da76945f2a70a3743069ad222452fb4 moneybookersEWallet -1
23 0 81ffa6cb8c2133b6f624b50b4cde1fc9_2 05105e77d956f23aaeff88d61015c713 moneybookersEWallet -1
:::::
26 0 38fa93e1e717e74efcee46a58c85829b_1 e7ca83927e254338a747c107ea52ac7c moneybookersCreditCard -1
27 0 38fa93e1e717e74efcee46a58c85829b_2 2db99d8e5ba4bf19d308503fd5b2106f moneybookersEWallet -1
The used payment method was moneybookersEWallet. No idea why the plugin is different for both payments! Most other entries have same plugin!
Is there a incremented security_token....._0, which is the successful payment? Are the above entries a list of unsuccessful payments?
Bookmarks