larryv Posted June 26, 2011 Share Posted June 26, 2011 hello I process payment using ipayDNA after payment customers redirected to my site/checkout_success.php But an new order is not created. Cart is not emptied this is the module: <?php /* $Id: paypal.php,v 1.39 2003/01/29 19:57:15 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ class ipayDNA { var $code, $title, $description, $enabled; // class constructor function ipayDNA() { global $order; $this->code = 'ipayDNA'; $this->title = MODULE_PAYMENT_IPAYDNA_TEXT_TITLE; $this->description = MODULE_PAYMENT_IPAYDNA_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_IPAYDNA_SORT_ORDER; $this->enabled = ((MODULE_PAYMENT_IPAYDNA_STATUS == 'True') ? true : false); if ((int)MODULE_PAYMENT_IPAYDNA_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_IPAYDNA_ORDER_STATUS_ID; } if (is_object($order)) $this->update_status(); $this->form_action_url = MODULE_PAYMENT_IPAYDNA_URL; //$this->form_action_url = 'http://192.168.28.2/ipaydna_info/rhea/gatedna/process/acquirer/ePaymentMOLe.cfm'; //$this->form_action_url = 'http://192.168.28.2/ipaydna_info/rhea/gatedna/process/acquirer/epaymentpage.cfm'; //$this->form_action_url = 'https://www.ipaydna.com/orion/training/cardDNA/index.cfm'; //https://www.ipaydna.com/orion/training/cardDNA/sale.cfm'; //https://www.ipaydna.com/orion/training/carddna/sale.cfm'; } // class methods function update_status() { global $order; if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_IPAYDNA_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_IPAYDNA_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; if (MODULE_PAYMENT_IPAYDNA_CURRENCY == 'Selected Currency') { $my_currency = $currency; } else { $my_currency = substr(MODULE_PAYMENT_IPAYDNA_CURRENCY, 5); } if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD','MYR'))) { $my_currency = 'USD'; } $rand = (rand()*11)*100; $process_button_string = "" . // start draw required parameters tep_draw_hidden_field('customerPaymentPageText', MODULE_PAYMENT_IPAYDNA_ID) . tep_draw_hidden_field('orderDescription', 'OSC'. $rand) . tep_draw_hidden_field('purchaseAmount', ($order->info['total']) * $currencies->get_value($my_currency)) . //tep_draw_hidden_field('purchaseAmount', number_format(($order->info['total']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) . tep_draw_hidden_field('cardholderip', $_SERVER["REMOTE_ADDR"]) . tep_draw_hidden_field('currencyText', $my_currency) . //start draw optional parameters //tep_draw_hidden_field('shippingAmount', ($order->info['shipping_cost']) * $currencies->get_value($my_currency)) . //taxAmount , dutyAmount, cardHolderName, cardNo, cardTypeText , cardExpireMonth, cardExpireYear Optional //cardIssueMonth, cardIssueYear, issuerName, firstName, lastName, Company, Address, City, State, Zip, Country, //Email, Phone, shipFirstName, shipLastName, shipAddress, shipCity, shipState, shipZip, shipCountry //tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) . //tep_draw_hidden_field('cancel_return', 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_IPAYDNA_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 ipayDNA Module', 'MODULE_PAYMENT_IPAYDNA_STATUS', 'True', 'Do you want to accept ipayDNA 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 ('Merchant ID', 'MODULE_PAYMENT_IPAYDNA_ID', 'MERCHANT ID', 'The id to use for the ipayDNA service', '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_IPAYDNA_CURRENCY', 'Selected Currency', 'The currency to use for credit card transactions', '6', '6', 'tep_cfg_select_option(array(\'Selected Currency\',\'Only USD\',\'Only CAD\',\'Only EUR\',\'Only GBP\',\'Only JPY\',\'Only MYR\'), ', 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_IPAYDNA_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_IPAYDNA_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_IPAYDNA_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())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('ePayment URL', 'MODULE_PAYMENT_IPAYDNA_URL', 'URL', 'The gateway URL to use for the ipayDNA service', '6', '5', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_PAYMENT_IPAYDNA_STATUS', 'MODULE_PAYMENT_IPAYDNA_ID', 'MODULE_PAYMENT_IPAYDNA_URL', 'MODULE_PAYMENT_IPAYDNA_CURRENCY', 'MODULE_PAYMENT_IPAYDNA_ZONE', 'MODULE_PAYMENT_IPAYDNA_ORDER_STATUS_ID', 'MODULE_PAYMENT_IPAYDNA_SORT_ORDER'); } } ?> please help. thanks Link to comment Share on other sites More sharing options...
GemRock Posted June 26, 2011 Share Posted June 26, 2011 where you got the module from? maybe go to the support thread may be more helpful? a quick look at the code the orders save/update is not there so it has to rely on check out process to do the job. Ken commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile). over 20 years of computer programming experience. Link to comment Share on other sites More sharing options...
larryv Posted June 27, 2011 Author Share Posted June 27, 2011 Thanks. They asked me what is checkout success URL. I toll then checkout_success.php. I will try checkout_process.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.