Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Finnish payment module


aapinen

Recommended Posts

Here is one module but I need to generate unique number to replace this 55: $ref = "55";

 

Is there other countiries bankmodules I could use?

 

 

class solo {

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

// class constructor

function solo() {

global $order;

$this->code = 'solo';

$this->title = 'Nordea Solo';

$this->description = 'Payment via Nordea Solo';

$this->sort_order = 0;

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

if ((int)MODULE_PAYMENT_SOLO_ORDER_STATUS_ID > 0) {

$this->order_status = MODULE_PAYMENT_SOLO_ORDER_STATUS_ID;

}

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

$this->form_action_url = 'https://solo3.nordea.fi/cgi-bin/SOLOPM01';

}

// class methods

function update_status() {

global $order;

$this->enabled = true;

}

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;

$orderid = ceil(rand(1,10000));

//Kentt?tiedot

$version = "0003";

$stamp = $orderid;

$rcv_id = "12345678";

$amount = number_format($order->info['total'],2);

$ref = "55";

$date = "EXPRESS";

$cur = "EUR";

$tarkisteavain = "LEHTI";

//Lasketaan MAC

$rawstring = $version . "&" . $stamp . "&" . $rcv_id . "&" . $amount . "&" . $ref . "&" . $date . "&" . $cur . "&" .

$tarkisteavain . "&";

$mac = md5($rawstring);

$mac = strtoupper($mac);

//Itse formi tietojen l?hetykseen

$process_button_string = tep_draw_hidden_field('SOLOPMT_VERSION', $version) .

tep_draw_hidden_field('SOLOPMT_STAMP', $orderid) .

tep_draw_hidden_field('SOLOPMT_RCV_ID', $rcv_id) .

tep_draw_hidden_field('SOLOPMT_RCV_ACCOUNT','29501800000014') .

tep_draw_hidden_field('SOLOPMT_RCV_NAME',

'Matti Rinnekangas') .

tep_draw_hidden_field('SOLOPMT_LANGUAGE','1') .

tep_draw_hidden_field('SOLOPMT_AMOUNT', $amount) .

tep_draw_hidden_field('SOLOPMT_REF', $ref) .

tep_draw_hidden_field('SOLOPMT_DATE', $date) .

tep_draw_hidden_field('SOLOPMT_MSG','El?intuotteita') .

tep_draw_hidden_field('SOLOPMT_RETURN',

tep_href_link('checkout_process.php','','SSL')) .

tep_draw_hidden_field('SOLOPMT_CANCEL',

tep_href_link('checkout_failure.php','','SSL')) .

tep_draw_hidden_field('SOLOPMT_REJECT',

tep_href_link('checkout_failure.php','','SSL')) .

tep_draw_hidden_field('SOLOPMT_MAC', $mac) .

tep_draw_hidden_field('SOLOPMT_CONFIRM','YES') .

tep_draw_hidden_field('SOLOPMT_KEYVERS','0001') .

tep_draw_hidden_field('SOLOPMT_CUR', $cur);

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_SOLO_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 Solo Module',

'MODULE_PAYMENT_SOLO_STATUS', 'True', 'Do you want to accept Solo 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 ('Your Solo RCV_ID', 'MODULE_PAYMENT_SOLO_ID',

'12345678', 'Your Solo RCV_ID', '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, date_added) values ('Transaction Currency',

'MODULE_PAYMENT_SOLO_CURRENCY', 'Selected Currency', 'The currency to use for Solo transactions', '6', '6',

'tep_cfg_select_option(array(\'Selected Currency\',\'Only EUR\'), ', 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_SOLO_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, use_function, set_function, date_added) values ('Payment Zone',

'MODULE_PAYMENT_SOLO_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', '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_SOLO_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_SOLO_STATUS', 'MODULE_PAYMENT_SOLO_ID', 'MODULE_PAYMENT_SOLO_CURRENCY',

'MODULE_PAYMENT_SOLO_ZONE', 'MODULE_PAYMENT_SOLO_ORDER_STATUS_ID', 'MODULE_PAYMENT_SOLO_SORT_ORDER');

}

}

?>

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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