Jump to content
xt:Commerce Community Forum

Anpassung eines OS-Moduls an XT


Jessi Lee James

Recommended Posts

Von einem Anbieter für Kreditkartenzahlungen habe ich ein Modul erhalten, welches eigentlich für einen Shop gedacht ist, der auf OS-Commerce basiert.

Versuch macht klug... nach der Installation in meinen xt:commerce-Shop erhielt ich folgende Fehlermeldung:

Fatal error: Call to undefined function: tep_get_payment_unallowed() in /var/www/web2/html/shop3/includes/modules/payment/swisspay24.php on line 24

Der betreffende Bereich rund um Zeile 24 (rot markiert) ist dieser:

      $this->code = 'swisspay24';

      $this->title = MODULE_PAYMENT_SWISSPAY24_TEXT_TITLE;

      $this->description = MODULE_PAYMENT_SWISSPAY24_TEXT_DESCRIPTION;

      $this->sort_order = MODULE_PAYMENT_SWISSPAY24_SORT_ORDER;

      //$this->enabled = ((MODULE_PAYMENT_SWISSPAY24_STATUS == 'True') ? true : false);

      // START PAYMENT UNALLOWED

    [COLOR="Red"]if ( tep_get_payment_unallowed($this->code) ) {[/COLOR]

         $this->enabled = ((MODULE_PAYMENT_SWISSPAY24_STATUS == 'True') ? true : false);

         }

                 // END PAYMENT UNALLOWED


      if ((int)MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID > 0) {

        $this->order_status = MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID;

      }

Ein entsprechendes Modul von einem anderen Anbieter, das in meinem xt:Commerce-Shop aber funktioniert, ist ähnlich aufgebaut:
      $this->code = 'ecs_solution';

      $this->title = MODULE_PAYMENT_ECS_SOLUTION_TEXT_TITLE;

      $this->description = MODULE_PAYMENT_ECS_SOLUTION_TEXT_DESCRIPTION;

      $this->email_footer = MODULE_PAYMENT_ECS_SOLUTION_TEXT_EMAIL_FOOTER;


      $this->enabled = ((MODULE_PAYMENT_ECS_SOLUTION_STATUS == 'True') ? true : false);

      $this->sort_order = MODULE_PAYMENT_ECS_SOLUTION_SORT_ORDER;


      if ((int)MODULE_PAYMENT_ECS_SOLUTION_ORDER_STATUS_ID > 0) {

        $this->order_status = MODULE_PAYMENT_ECS_SOLUTION_ORDER_STATUS_ID;

      }

Hat jemand so viel Ahnung von php und sieht eine Möglichkeit, das für OS entwickelte php-script so anzupassen, dass es auch auf XT läuft?

*lieb guck*

Link to comment
Share on other sites

Hallo!

Lösche mal dies aus der Datei raus und probiere es dann nochmal:

// START PAYMENT UNALLOWED

    [COLOR=Red]if ( tep_get_payment_unallowed($this->code) ) {[/COLOR]

         $this->enabled = ((MODULE_PAYMENT_SWISSPAY24_STATUS == 'True') ? true : false);

         }

                 // END PAYMENT UNALLOWED

Sag bescheid, ob es geklappt hat.

MfG Hetfield :cool:

Link to comment
Share on other sites

hat leider nicht funktioniert... nun kommt folgende Fehlermeldung:

Call to undefined function: tep_db_query() in /var/www/web2/html/shop3/includes/modules/payment/swisspay24.php on line 132

dies ist die gesamte Datei... Zeile 132 ist rot markiert

<?php

  /**

   * This File is Part of the Swisspay24 Payment System

   * All Copyrights are reserved to Burani Treuhand & Verwaltungs AG

	 *

   * @copyright 2004 by Burani Treuhand & Verwaltungs AG

   * @package Burani

   * @subpackage oscommerce

   */


  class swisspay24{

    var $code, $title, $description, $enabled;


		// class constructor

    function swisspay24() {

      global $order;


      $this->code = 'swisspay24';

      $this->title = MODULE_PAYMENT_SWISSPAY24_TEXT_TITLE;

      $this->description = MODULE_PAYMENT_SWISSPAY24_TEXT_DESCRIPTION;

      $this->sort_order = MODULE_PAYMENT_SWISSPAY24_SORT_ORDER;

      //$this->enabled = ((MODULE_PAYMENT_SWISSPAY24_STATUS == 'True') ? true : false);



      if ((int)MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID > 0) {

        $this->order_status = MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID;

      }


      if (is_object($order)) $this->update_status();


			$this->form_action_url = 'https://www.swisspay24.com/payment/paygate.asp';

    }


		// class methods

    function update_status() {

      global $order;


      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SWISSPAY24_ZONE > 0) ) {

        $check_flag = false;

        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_SWISSPAY24_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");

        while ($check = tep_db_fetch_array($check_query)) {

          if ($check['zone_id'] < 1) {

            $check_flag = true;

            break;

          } elseif ($check['zone_id'] == $order->billing['zone_id']) {

            $check_flag = true;

            break;

          }

        }


        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, $currencies, $currency, $language;


      $my_currency = MODULE_PAYMENT_SWISSPAY24_CURRENCY;

			$amount = (int)($order->info['total'] * $currencies->get_value($my_currency) * 100);

			switch($language)

			{

				case "german":

					$lang_value = "de";

					break;

				case "espanol":

					$lang_value = "es";

					break;

				case "french":

					$lang_value = "fr";

					break;

				case "italian":

					$lang_value = "it";

					break;

				default:

					$lang_value = "us";

					break;

			}


      $process_button_string = tep_draw_hidden_field('lid', MODULE_PAYMENT_SWISSPAY24_ID) .

                               tep_draw_hidden_field('betrag', $amount) .

                               tep_draw_hidden_field('parameter1', $order->customer['firstname']."_".$order->customer['lastname']) .

                               tep_draw_hidden_field('parameter2', tep_session_id() ) .

                               tep_draw_hidden_field('email', $order->customer['email_address']) .

                               tep_draw_hidden_field('vorname', $order->customer['firstname']) .

                               tep_draw_hidden_field('nachname', $order->customer['lastname']) .

                               tep_draw_hidden_field('strasse', $order->customer['street_address']) .

                               tep_draw_hidden_field('plz', $order->customer['postcode']) .

                               tep_draw_hidden_field('land', $order->billing['country']['title']) .

                               tep_draw_hidden_field('cancel_url', tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'NONSSL', true)).

                               tep_draw_hidden_field('sel', 'CC') .

                               tep_draw_hidden_field('ort', $order->customer['city']) .

                               tep_draw_hidden_field('language', $lang_value) .

                               tep_draw_hidden_field('kdnr', '') .

                               tep_draw_hidden_field('kennwort', '') .

			                         tep_draw_hidden_field('waehrung', $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)) {

        [COLOR="Red"]$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_SWISSPAY24_STATUS'");[/COLOR]

        $this->_check = tep_db_num_rows($check_query);

      }

      return $this->_check;

    }


    function install() {

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable swisspay24 Module', 'MODULE_PAYMENT_SWISSPAY24_STATUS', 'True', 'Do you want to accept swissapy24 payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Project-ID', 'MODULE_PAYMENT_SWISSPAY24_ID', '0', 'The project id (lid) you received from swisspay24 for this shop', '6', '2', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_SWISSPAY24_CURRENCY', 'EUR', 'The currency to use for your swisspay24 account', '6', '6', 'tep_cfg_select_option(array(\'EUR\',\'USD\',\'GBP\',\'CHF\'), ', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_SWISSPAY24_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '4', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '5', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_SWISSPAY24_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '6', now())");

    }


    function remove() {

      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

    }


    function keys() {

      return array('MODULE_PAYMENT_SWISSPAY24_STATUS', 'MODULE_PAYMENT_SWISSPAY24_ID', 'MODULE_PAYMENT_SWISSPAY24_CURRENCY', 'MODULE_PAYMENT_SWISSPAY24_ZONE', 'MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID', 'MODULE_PAYMENT_SWISSPAY24_SORT_ORDER');

    }

  }

?>

Link to comment
Share on other sites

ein schritt voran ging es schon mal... das modul taucht in der liste der zahlungsweisen ohne fehlermeldung auf.

allerdings erscheint nun nach dem klick auf den "Installieren"-button folgende meldung auf einer neuen seite:

1054 - Unknown column 'configuration_title' in 'field list'

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable swisspay24 Module', 'MODULE_PAYMENT_SWISSPAY24_STATUS', 'True', 'Do you want to accept swissapy24 payments?', '6', '1', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())

[XT SQL Error]

danke für deinen bisherigen fleiß und die geduld :D

Link to comment
Share on other sites

Hallo!

Nächster Schritt: :)

Ersetze dies:

function install() {

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable swisspay24 Module', 'MODULE_PAYMENT_SWISSPAY24_STATUS', 'True', 'Do you want to accept swissapy24 payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Project-ID', 'MODULE_PAYMENT_SWISSPAY24_ID', '0', 'The project id (lid) you received from swisspay24 for this shop', '6', '2', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_SWISSPAY24_CURRENCY', 'EUR', 'The currency to use for your swisspay24 account', '6', '6', 'tep_cfg_select_option(array(\'EUR\',\'USD\',\'GBP\',\'CHF\'), ', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_SWISSPAY24_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '4', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '5', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");

      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_SWISSPAY24_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '6', now())");

    }
gegen dies:
function install() {

      xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_PAYMENT_SWISSPAY24_STATUS', 'True', 'Do you want to accept swissapy24 payments?', '6', '1', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())");

      xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_SWISSPAY24_ID', '0', 'The project id (lid) you received from swisspay24 for this shop', '6', '2', now())");

      xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_PAYMENT_SWISSPAY24_CURRENCY', 'EUR', 'The currency to use for your swisspay24 account', '6', '6', 'xtc_cfg_select_option(array(\'EUR\',\'USD\',\'GBP\',\'CHF\'), ', now())");

      xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('MODULE_PAYMENT_SWISSPAY24_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '4', 'xtc_get_zone_class_title', 'xtc_cfg_pull_down_zone_classes(', now())");

      xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '5', 'xtc_cfg_pull_down_order_statuses(', 'xtc_get_order_status_name', now())");

      xtc_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('MODULE_PAYMENT_SWISSPAY24_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '6', now())");

    }

Und dann wie gehabt: wieder melden! :P

MfG Hetfield :cool:

Link to comment
Share on other sites

Naja... die Fehlermeldung kommt immer noch... allerdings etwas kürzer ;-)

1054 - Unknown column 'configuration_description' in 'field list'

insert into configuration (configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('MODULE_PAYMENT_SWISSPAY24_STATUS', 'True', 'Do you want to accept swissapy24 payments?', '6', '1', 'xtc_cfg_select_option(array(\'True\', \'False\'), ', now())

[XT SQL Error]

Link to comment
Share on other sites

Hallo!

Will mal nicht so sein. ;) Hab die Datei mal eben angepasst. Lässt sich installieren und einstellen im Adminbereich. Allerdings ungetestet im Kaufvorgang. Melde Dich, wenn es jetzt funktioniert und stell für die anderen User doch bitte noch die dazugehörigen Sprachdateien zur Verfügung. :o

Ich hoffe, jetzt funktioniert es.

MfG Hetfield :cool:

Link to comment
Share on other sites

ähem... leider bekomme ich nach der installation eine ganze anzahl von meldungen:

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_STATUS_TITLE in /var/www/web2/html/shop3/admin/modules.php on line 166

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_STATUS_DESC in /var/www/web2/html/shop3/admin/modules.php on line 168

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_ID_TITLE in /var/www/web2/html/shop3/admin/modules.php on line 166

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_ID_DESC in /var/www/web2/html/shop3/admin/modules.php on line 168

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_CURRENCY_TITLE in /var/www/web2/html/shop3/admin/modules.php on line 166

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_CURRENCY_DESC in /var/www/web2/html/shop3/admin/modules.php on line 168

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_ZONE_TITLE in /var/www/web2/html/shop3/admin/modules.php on line 166

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_ZONE_DESC in /var/www/web2/html/shop3/admin/modules.php on line 168

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID_TITLE in /var/www/web2/html/shop3/admin/modules.php on line 166

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_ORDER_STATUS_ID_DESC in /var/www/web2/html/shop3/admin/modules.php on line 168

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_SORT_ORDER_TITLE in /var/www/web2/html/shop3/admin/modules.php on line 166

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_SORT_ORDER_DESC in /var/www/web2/html/shop3/admin/modules.php on line 168

Link to comment
Share on other sites

selbst gebastelt? oh woooow! :rolleyes:

ja so eine sprachdatei gab es auch dazu:

<?php

  /**

   * This File is Part of the Globalpay Payment System

   * All Copyrights are reserved to Globalpay AG

   *

   * @copyright 2004 by Globalpay

   * @package Global-Pay

   * @subpackage oscommerce

   * @author m.ronneberger <[email protected]>

   */


  define('MODULE_PAYMENT_SWISSPAY24_TEXT_TITLE', 'Kreditkarte, Bankeinzug ... mit Swisspay24');

  define('MODULE_PAYMENT_SWISSPAY24_TEXT_DESCRIPTION', 'Swisspay24');

?>

Link to comment
Share on other sites

Hallo!

Wenn das alles ist, was in der Sprachdatei ist, wird es nicht funktionieren. Nimm mal diese hier (mein Provisorium) und/oder lass dir vom Anbieter eine erstellen bzw. aktualisierte zukommen. Aber fürs erste zum Testen des Moduls dürfte diese ausreichen.

MfG Hetfield :cool:

Link to comment
Share on other sites

:(

geht niiiiiicht

Warning: constant(): Couldn't find constant MODULE_PAYMENT_SWISSPAY24_ALLOWED in /var/www/web2/html/shop3/includes/classes/payment.php on line 68

Fatal error: Call to a member function on a non-object in /var/www/web2/html/shop3/includes/modules/payment/swisspay24.php on line 78

was mache ich denn bloß falsch, wenn es bei dir funktioniert? :confused:

lg

Jessi

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 2 months later...
  • 10 months later...

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...