Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

E-gold payment module installation error


EnKumber

Recommended Posts

I tried to install E-gold payment module from

http://www.oscommerce.com/community/contributions,138

and i received the following error in administration/payment modules:

Fatal error: Call to undefined function: tep_get_free_charger() in /home/shop/public_html/gsmshopping.ro/includes/modules/payment/egold.php on line 25

 

Any ideea ?

Thank you very much !

Link to comment
Share on other sites

Yes I got this problem too a couple of days ago. It occurs after uploading egold module to the appropriate locations, when on loading the admin payment moduel page (where one hopes to install it) it basically stops the rest of the module listing because of the error.

 

have you contacted the contributor yet?

 

I have not yet had time to look at the code itself (way down the list in terms of priorities for me)

 

not even looked at whether this module was for the old oscommerce version

 

<_<

Edited by henka
Link to comment
Share on other sites

I didn't contact the contributor, but i found a link in the code, to webmakers.com.

So, i found a couple of modules for oscommerce, i found the function that makes that error , i think i will resolve it .

 

If you know exactly how to resolve this, reply

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

HI folks,

 

I've just added the e-gold module successfully to 2.2MS2. :) The code requires some modifications, notably the SORT_ORDER stuff for it to show up in the payments section. Here is my modified module. I'm currently testing it, my store goes live in the next week... I'll update to contribs once tests are successful. I've successfully got to the e-gold payments page. Yet to actually try a payment.

 

Please post your test results here as well. Enjoy!

 

catalog/includes/modules/payment/egold.php :

 

 

<?php
/*
 $Id: e-gold.php,v 1 2003/07/23

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License

 e-Gold module Crated by Craig Harrison
 modified 2004/01/18 for osCommerce-2.2MS2 by rayservers.com

*/


 class egold {
   var $code, $title, $description, $enabled;

// class constructor
   function egold() {
     $this->code = 'egold';
     $this->title = MODULE_PAYMENT_EGOLD_TEXT_TITLE;
     $this->description = MODULE_PAYMENT_EGOLD_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_PAYMENT_EGOLD_SORT_ORDER;
     $this->enabled = ((MODULE_PAYMENT_EGOLD_STATUS == 'True') ? true : false);

     if ((int)MODULE_PAYMENT_EGOLD_ORDER_STATUS_ID > 0) {
       $this->order_status = MODULE_PAYMENT_EGOLD_ORDER_STATUS_ID;
     }
     $this->form_action_url = 'https://www.e-gold.com/sci_asp/payments.asp';
   }

// class methods
   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;
                                                                                                                                   
     $process_button_string = tep_draw_hidden_field('PAYEE_ACCOUNT', MODULE_PAYMENT_EGOLD_ACCOUNT) .
                              tep_draw_hidden_field('PAYEE_NAME', MODULE_PAYMENT_EGOLD_NAME) .
                              tep_draw_hidden_field('PAYMENT_AMOUNT', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->currencies['USD']['value'], $currencies->currencies['USD']['decimal_places'])) .
                              tep_draw_hidden_field('PAYMENT_UNITS', '1') .
                              tep_draw_hidden_field('PAYMENT_METAL_ID', '1') .
                              tep_draw_hidden_field('BAGGAGE_FIELDS', '') .
                              tep_draw_hidden_field('PAYMENT_URL', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .
                              tep_draw_hidden_field('NOPAYMENT_URL', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
                                                                                                                                   
     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)) {
       $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_EGOLD_STATUS'");
       $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 e-Gold<AE> Module', 'MODULE_PAYMENT_EGOLD_STATUS', 'True', 'Do you want to accept e-Gold<AE> payments?', '6', '3', '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 ('e-Gold Account Name', 'MODULE_PAYMENT_EGOLD_NAME', 'rayservers.com', 'The name you wish to have displayed as the Payee on the e-gold<AE> payment form.', '6', '4', 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_EGOLD_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('e-Gold Account Number', 'MODULE_PAYMENT_EGOLD_ACCOUNT', '1179726', 'Your e-gold<AE> account number to which the payment is to be made.', '6', '4', 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_EGOLD_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
   }
                                                                                                                                   
/*    function remove() {
     $keys = '';
     $keys_array = $this->keys();
     for ($i=0; $i<sizeof($keys_array); $i++) {
       $keys .= "'" . $keys_array[$i] . "',";
     }
     $keys = substr($keys, 0, -1);
                                                                                                                                   
     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
   }
*/
   function remove() {
     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");    }
                                                                                                                                   
   function keys() {
     return array('MODULE_PAYMENT_EGOLD_STATUS', 'MODULE_PAYMENT_EGOLD_NAME', 'MODULE_PAYMENT_EGOLD_SORT_ORDER', 'MODULE_PAYMENT_EGOLD_ACCOUNT', 'MODULE_PAYMENT_EGOLD_ORDER_STATUS_ID');
   }
 }
?>

Link to comment
Share on other sites

  • 3 months later...

Hi Guys,

 

I am making a change to the e-gold payment module.

 

Can someone point me to the variable that contains the currency code in oscommerce.

 

ie in the available currencies say you have USD and EUR as the available currencies what oscommerce variable contains it.

 

eg In the e-gold module under the function process_button() is a global definition for $currencies.

Then in that function there is a reference

$currencies->currencies['USD']['value']

 

What variable does oscommerce hold the value of the currently selected currency which is displayed in the currencies box on the front right bottom corner of the shopping cart front page so I can replace the 'USD' constant above, with the variable name containing the value USD?

 

Any help would be a help.

 

Boana

Link to comment
Share on other sites

Hi Guys,

 

I just checked the e-gold module operation and it does not include the shipping amount as part of the total when passed to the e-gold SCI website, you now where you go on to enter your e-gold acct and passphrase.

 

But the shipping appears on the oscommerce confirmation page.

 

The PAYMENT_AMOUNT seems to have total and shipping_cost

tep_draw_hidden_field('PAYMENT_AMOUNT', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->currencies['EUR']['value'], $currencies->currencies['EUR']['decimal_places'])) .

 

Any ideas why?

 

 

Regards

Boana

      $process_button_string = tep_draw_hidden_field('PAYEE_ACCOUNT', MODULE_PAYMENT_EGOLD_ACCOUNT) .
                              tep_draw_hidden_field('PAYEE_NAME', MODULE_PAYMENT_EGOLD_NAME) .
                              tep_draw_hidden_field('PAYMENT_AMOUNT', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->currencies['EUR']['value'], $currencies->currencies['EUR']['decimal_places'])) .
                              tep_draw_hidden_field('PAYMENT_UNITS', '85') .
                              tep_draw_hidden_field('PAYMENT_METAL_ID', '1') .
                              tep_draw_hidden_field('BAGGAGE_FIELDS', '') .
                              tep_draw_hidden_field('PAYMENT_URL', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .
                              tep_draw_hidden_field('NOPAYMENT_URL', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

     return $process_button_string;

Link to comment
Share on other sites

Yes, this should be fixed. The original author intended free shipping on egold payments. Since I have free shipping on everything (hence a zero deduction) I did not catch it till later and I got busy and did not update the module on the contrib site. This affects the 1mdc module as well, I believe.

Link to comment
Share on other sites

  • 1 month later...

I get the following error after hitting continue on egold page, whre it should go back to OSC page.

 

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

 

insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('3', '1', now(), '1', 'Test purchase')

 

[TEP STOP]

 

Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...