ich habe mit der Entwicklung einer Schnittstelle zu sofortueberweisung.de begonnen.
Gruß
ajp
Code: Alles auswählen
class sofortueberweisung {
// class constructor
function sofortueberweisung() {}
// class methods
function update_status() {}
function javascript_validation() {}
function selection() {}
function pre_confirmation_check() {}
function confirmation() {}
function process_button() {}
function before_process() {}
function after_process() {}
function output_error() {}
function check() {}
function install() {}
function remove() {}
function keys() {}
?>
Code: Alles auswählen
function remove() {
$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$db->Execute("DELETE FROM " . $oosDBTable['configuration'] . " WHERE configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
Code: Alles auswählen
// class constructor
function sofortueberweisung() {
global $order, $aLang;
$this->code = 'sofortueberweisung';
$this->title = $aLang['module_payment_sofortueberweisung_text_title'];
$this->description = $aLang['module_payment_sofortueberweisung_text_description'];
$this->sort_order = MODULE_PAYMENT_SOFORTUEBERWEISUNG_SORT_ORDER;
$this->enabled = ((MODULE_PAYMENT_SOFORTUEBERWEISUNG_STATUS == 'True') ? true : false);
if ((int)MODULE_PAYMENT_SOFORTUEBERWEISUNG_ORDER_STATUS_ID > 0) {
$this->order_status = MODULE_PAYMENT_SOFORTUEBERWEISUNG_ORDER_STATUS_ID;
}
if (is_object($order)) $this->update_status();
$this->form_action_url = 'https://www.sofortueberweisung.de/payment/start';
}
Code: Alles auswählen
class sofortueberweisung {
function output_error() {}
?>
Code: Alles auswählen
function get_error() {
Code: Alles auswählen
function remove() {
$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$db->Execute("DELETE FROM " . $oosDBTable['configuration'] . " WHERE configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
Code: Alles auswählen
$this->form_action_url = 'https://www.sofortueberweisung.de/payment/start';
Code: Alles auswählen
* @version Sofortüberweisung 1.9 27.06.2007
* @author Henri Schmidhuber info@in-solution.de
* @copyright 2006 - 2007 Henri Schmidhuber
* @link http://www.in-solution.de
* @link http://www.oscommerce.com
Code: Alles auswählen
class sofortueberweisung {
var $code, $title, $description, $enabled;
// class constructor
function sofortueberweisung() {
global $order, $aLang;
$this->code = 'sofortueberweisung';
$this->title = $aLang['module_payment_sofortueberweisung_text_title'];
$this->description = $aLang['module_payment_sofortueberweisung_text_description'];
$this->sort_order = MODULE_PAYMENT_SOFORTUEBERWEISUNG_SORT_ORDER;
$this->enabled = ((MODULE_PAYMENT_SOFORTUEBERWEISUNG_STATUS == 'True') ? true : false);
if ((int)MODULE_PAYMENT_SOFORTUEBERWEISUNG_ORDER_STATUS_ID > 0) {
$this->order_status = MODULE_PAYMENT_SOFORTUEBERWEISUNG_ORDER_STATUS_ID;
}
if (is_object($order)) $this->update_status();
$this->form_action_url = 'https://www.sofortueberweisung.de/payment/start';
}
// class methods
function update_status() {
global $order;
if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SOFORTUEBERWEISUNG_ZONE > 0) ) {
$check_flag = false;
$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$check_result = $db->Execute("SELECT zone_id FROM " . $oosDBTable['zones_to_geo_zones'] . " WHERE geo_zone_id = '" . MODULE_PAYMENT_SOFORTUEBERWEISUNG_ZONE . "' AND zone_country_id = '" . $order->billing['country']['id'] . "' ORDER BY zone_id");
while ($check = $check_result->fields) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->billing['zone_id']) {
$check_flag = true;
break;
}
$check_result->MoveNext();
}
if ($check_flag == false) {
$this->enabled = false;
}
}
}
function javascript_validation() {
return false;
}
function selection() {
return array('id' => $this->code,
'module' => $this->title);
}
function pre_confirmation_check() {
return false;
}
function confirmation() {
return false;
}
function process_button() {
global $order, $oCurrencies;
if (MODULE_PAYMENT_SOFORTUEBERWEISUNG_CURRENCY == 'Selected Currency') {
$my_currency = $_SESSION['currency'];
} else {
$my_currency = substr(MODULE_PAYMENT_SOFORTUEBERWEISUNG_CURRENCY, 5);
}
if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) {
$my_currency = 'EUR';
}
$process_button_string = oos_draw_hidden_field('user_id', MODULE_PAYMENT_SOFORTUEBERWEISUNG_KDNR) .
oos_draw_hidden_field('project_id', MODULE_PAYMENT_SOFORTUEBERWEISUNG_PROJEKT) .
oos_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $oCurrencies->get_value($my_currency), $oCurrencies->get_decimal_places($my_currency)));
return $process_button_string;
}
function before_process() {
return false;
}
function after_process() {
return false;
}
function output_error() {
return false;
}
function check() {
if (!isset($this->_check)) {
$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$check_result = $db->Execute("SELECT configuration_value FROM " . $oosDBTable['configuration'] . " WHERE configuration_key = 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_STATUS'");
$this->_check = $check_result->RecordCount();
}
return $this->_check;
}
function install() {
$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$db->Execute("INSERT INTO " . $oosDBTable['configuration'] . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) VALUES ('MODULE_PAYMENT_SOFORTUEBERWEISUNG_STATUS', 'True', '6', '3', 'oosCfgSelectOption(array(\'True\', \'False\'), ', now())");
$db->Execute("INSERT INTO " . $oosDBTable['configuration'] . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_SOFORTUEBERWEISUNG_KDNR', '10000', '6', '4', now())");
$db->Execute("INSERT INTO " . $oosDBTable['configuration'] . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_SOFORTUEBERWEISUNG_PROJEKT', '50000', '6', '4', now())");
$db->Execute("INSERT INTO " . $oosDBTable['configuration'] . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) VALUES ('MODULE_PAYMENT_SOFORTUEBERWEISUNG_CURRENCY', 'Selected Currency', '6', '6', 'oosCfgSelectOption(array(\'Selected Currency\',\'Only USD\',\'Only CAD\',\'Only EUR\',\'Only GBP\',\'Only JPY\'), ', now())");
$db->Execute("INSERT INTO " . $oosDBTable['configuration'] . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) VALUES ('MODULE_PAYMENT_SOFORTUEBERWEISUNG_SORT_ORDER', '0', '6', '0', now())");
$db->Execute("INSERT INTO " . $oosDBTable['configuration'] . " (configuration_key, configuration_value, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('MODULE_PAYMENT_SOFORTUEBERWEISUNG_ZONE', '0', '6', '2', 'oosCfgGetZoneClassTitle', 'oosCfgPullDownZoneClasses(', now())");
$db->Execute("INSERT INTO " . $oosDBTable['configuration'] . " (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, use_function, date_added) VALUES ('MODULE_PAYMENT_SOFORTUEBERWEISUNG_ORDER_STATUS_ID', '0', '6', '0', 'oosCfgPullDownOrderStatuses(', 'oosCfgGetOrderStatusName', now())");
}
function remove() {
$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$db->Execute("DELETE FROM " . $oosDBTable['configuration'] . " WHERE configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
return array('MODULE_PAYMENT_SOFORTUEBERWEISUNG_STATUS', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_KDNR', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_PROJEKT', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_CURRENCY', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_ZONE', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_ORDER_STATUS_ID', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_SORT_ORDER');
}
}
?>
Code: Alles auswählen
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_STATUS_TITLE', 'Sofortüberweisung');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_STATUS_DESC', 'Möchten Sie Zahlungen per sofortueberweisung.de anbieten?');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_KDNR_TITLE', 'Ihre Kundennummer');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_KDNR_DESC', 'Ihre Kundennummer bei der Sofortüberweisung');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_PROJEKT_TITLE', 'Ihre Projektnummer');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_PROJEKT_DESC', 'Ihre Projektnummer bei der Sofortüberweisung');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_CURRENCY_TITLE', 'Transaction Currency');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_CURRENCY_DESC', 'The currency to use for credit card transactions');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_ZONE_TITLE', 'Zone für diese Zahlungsweise');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_ZONE_DESC', 'Wenn Sie eine Zone auswählen, wird diese Zahlungsweise nur in dieser Zone angeboten.');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_ORDER_STATUS_ID_TITLE', 'Order Status');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_ORDER_STATUS_ID_DESC', 'Festlegung des Status für Bestellungen, welche mit dieser Zahlungsweise durchgeführt werden.');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_SORT_ORDER_TITLE', 'Reihenfolge der Anzeige');
define('MODULE_PAYMENT_SOFORTUEBERWEISUNG_SORT_ORDER_DESC', 'Niedrigste wird zuerst angezeigt.');
$aLang['module_payment_sofortueberweisung_text_title'] = 'Sofortueberweisung';
$aLang['module_payment_sofortueberweisung_text_description'] = 'SOFORTUEBERWEISUNG';
Code: Alles auswählen
class sofortueberweisung {
var $code, $title, $description, $enabled;
// class constructor
function sofortueberweisung() {
global $order, $aLang;
function process_button() {
global $order, $oCurrencies;
if (MODULE_PAYMENT_SOFORTUEBERWEISUNG_CURRENCY == 'Selected Currency') {
$my_currency = $_SESSION['currency'];
} else {
$my_currency = substr(MODULE_PAYMENT_SOFORTUEBERWEISUNG_CURRENCY, 5);
}
if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) {
$my_currency = 'EUR';
}
}
?>
Code: Alles auswählen
function after_process() {
global $oOrder, $oCurrencies;
$my_currency = 'EUR';
$aFilename = oos_get_filename();
$aModules = oos_get_modules();
$sAmount = number_format(($oOrder->info['total] - $oOrder->info['shipping_cost]) * $oCurrencies->get_value($my_currency), $oCurrencies->get_decimal_places($my_currency));
$sShipping = number_format($oOrder->info['shipping_cost] * $oCurrencies->get_value($my_currency), $oCurrencies->get_decimal_places($my_currency));
$sReturn = oos_link($aModules['checkout], $aFilename['checkout_success], '', 'SSL');
$sCancel_return = oos_link($aModules['checkout], $aFilename['checkout_payment], '', 'SSL');
$sLink = 'https://www.paypal.com/de/cgi-bin/webscr?cmd=_xclick&business=' . MODULE_PAYMENT_PAYPAL_ID .
'&item_name= Pop Art von ' . STORE_NAME .
'&amount=' . urlencode($sAmount) .
'&shipping=' . urlencode($sShipping) .
'&return=' . urlencode($sReturn) .
'&cancel_return=' . urlencode($sCancel_return) .
'¤cy_code=EUR';
oos_redirect($sLink);
return false;
}
Code: Alles auswählen
unset($_SESSION['sendto]);
unset($_SESSION['billto]);
unset($_SESSION['shipping]);
unset($_SESSION['payment]);
unset($_SESSION['comments]);
Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste