uc_cybersource.install in Ubercart 5
Same filename and directory in other branches
Handles installing, uninstalling, and updating CyberSource settings.
File
payment/uc_cybersource/uc_cybersource.installView source
<?php
/**
* @file
* Handles installing, uninstalling, and updating CyberSource settings.
*/
function uc_cybersource_uninstall() {
// Delete related variables all at once.
db_query("DELETE FROM {variable} WHERE name LIKE 'uc_cybersource_%%' OR name LIKE 'cs_ship_from_%%'");
}
function uc_cybersource_update_1() {
// Change the variable used to define the default transaction type.
if (variable_get('uc_cybersource_transaction_type', 'sale') == 'sale') {
variable_set('uc_pg_cybersource_cc_txn_type', UC_CREDIT_AUTH_CAPTURE);
}
else {
variable_set('uc_pg_cybersource_cc_txn_type', UC_CREDIT_AUTH_ONLY);
}
variable_del('uc_cybersource_transaction_type');
// Convert the old subscription IDs to the new ones.
$result = db_query("SELECT order_id, data FROM {uc_orders} WHERE data LIKE '%%cybersource%%soap%%'");
while ($row = db_fetch_array($result)) {
$data = unserialize($row['data']);
uc_credit_log_reference($row['order_id'], $data['uc_cybersource']['soap']['subscription_id'], 'XXXX');
}
return array();
}
Functions
Name | Description |
---|---|
uc_cybersource_uninstall | @file Handles installing, uninstalling, and updating CyberSource settings. |
uc_cybersource_update_1 |