Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I just installed the contribution for payment modules - Leu virtual.ro

You can find it at http://www.oscommerce.com/community/contributions,3335/

 

I have only one currency set up on my shop and the is RON (romanian leu).

When I made a test order, everything went fine, except that in the end, the total amount of the order is converted into USD.

I tried to fix the PHP code in order to remove all the content dealing with currencies update. But I didn't succeded.

here's the code of what i have now!

If anyone can solve it, I'd apreciate!

Thanks

 

<?php
/*
 $Id: leuvirtual.php,

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

 Copyright (c) 2005 osCommerce

 Released under the GNU General Public License

 LeuVirtual module Created by Costescu Gabriel


*/


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

// class constructor
function leuvirtual() {
  $this->code = 'leuvirtual';
  $this->title = 'LeuVirtual';
  $this->description = 'LeuVirtual';
  $this->sort_order = MODULE_PAYMENT_LEUVIRTUAL_SORT_ORDER;
  $this->enabled = ((MODULE_PAYMENT_LEUVIRTUAL_STATUS == 'True') ? true : false);

  if ((int)MODULE_PAYMENT_LEUVIRTUAL_ORDER_STATUS_ID > 0) {
	$this->order_status = MODULE_PAYMENT_LEUVIRTUAL_ORDER_STATUS_ID;
  }
  $this->form_action_url = 'https://www.leuvirtual.ro/en/pay/pay.php';
}

// 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;



  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $queryURL);
  curl_setopt ($ch, CURLOPT_TIMEOUT, 3);
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  $result = curl_exec($ch);
  curl_close($ch);
  if (tep_not_null($result)) {
$result_array = explode(',', urldecode($result));
$result = trim($result_array[1]);

  }

  $process_button_string = tep_draw_hidden_field('LV_PAYMENT_TO_ACCOUNT', MODULE_PAYMENT_LEUVIRTUAL_ACCOUNT) .
						   tep_draw_hidden_field('LV_PAYMENT_AMOUNT', number_format(($order->info['total']) )) .
						   tep_draw_hidden_field('LV_PAYMENT_METHOD', '1') .
						   tep_draw_hidden_field('LV_PAYMENT_SUCCESS_URL', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .
						   tep_draw_hidden_field('LV_PAYMENT_CANCEL_URL', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')) .
				 tep_draw_hidden_field('LV_PAYMENT_STATUS_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_LEUVIRTUAL_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 LeuVirtual? Module', 'MODULE_PAYMENT_LEUVIRTUAL_STATUS', 'True', 'Do you want to accept LeuVirtual? 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 ('LeuVirtual Account Name', 'MODULE_PAYMENT_LEUVIRTUAL_NAME', 'xxxx', 'The name you wish to have displayed as the Payee on the LeuVirtual? 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_LEUVIRTUAL_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 ('LeuVirtual Account Number', 'MODULE_PAYMENT_LEUVIRTUAL_ACCOUNT', 'xxxxxx', 'Your LeuVirtual? 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_LEUVIRTUAL_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() {
  tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
  return array('MODULE_PAYMENT_LEUVIRTUAL_STATUS', 'MODULE_PAYMENT_LEUVIRTUAL_NAME', 'MODULE_PAYMENT_LEUVIRTUAL_SORT_ORDER', 'MODULE_PAYMENT_LEUVIRTUAL_ACCOUNT', 'MODULE_PAYMENT_LEUVIRTUAL_ORDER_STATUS_ID');
}
 }
?>

==========

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...