foxkitsinc Posted January 30, 2009 Share Posted January 30, 2009 We have been using the built in CC module to run credit cards; taking the information provided and running the transactions manually using a virtual terminal. Due to recent PCI/DSS compliance requirements we are activating the automated processing through Paypal Payflow Link. Using the Verisign payment module "verisign.php,v 1.16 2002/01/20" that looks like this: /* $Id: verisign.php,v 1.16 2002/01/20 16:07:40 hpdl Exp $ The Exchange Project - Community Made Shopping! [url="http://www.theexchangeproject.org"]http://www.theexchangeproject.org[/url] Copyright © 2000,2001 The Exchange Project Released under the GNU General Public License */ class verisign { var $code, $title, $description, $enabled; // class constructor function verisign() { $this->code = 'propercodehere'; $this->title = MODULE_PAYMENT_VERISIGN_TEXT_TITLE; $this->description = MODULE_PAYMENT_VERISIGN_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_VERISIGN_SORT_ORDER; $this->enabled = ((MODULE_PAYMENT_VERISIGN_STATUS == 'True') ? true : false); // $this->form_action_url = 'https://payflowlink.paypal.com'; $this->form_action_url = 'https://payflowlink.paypal.com'; } // 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 $_POST, $HTTP_SERVER_VARS, $order, $total_cost, $total_tax, $shipping_cost, $customer_id, $sendto; $customer_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_street_address, ab.entry_city, ab.entry_country_id, ab.entry_zone_id, ab.entry_state, ab.entry_postcode from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " ab on c.customers_default_address_id = ab.address_book_id and c.customers_id = ab.customers_id where c.customers_id = '" . $customer_id . "'"); $customer_values = tep_db_fetch_array($customer_query); $delivery_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_street_address, ab.entry_city, ab.entry_country_id, ab.entry_zone_id, ab.entry_state, ab.entry_postcode from " . TABLE_ADDRESS_BOOK . " ab where ab.address_book_id = '" . $sendto . "' and ab.customers_id = '" . $customer_id . "'"); $delivery_values = tep_db_fetch_array($delivery_query); echo tep_draw_hidden_field('LOGIN', MODULE_PAYMENT_VERISIGN_LOGIN) . tep_draw_hidden_field('PARTNER', MODULE_PAYMENT_VERISIGN_PARTNER) . tep_draw_hidden_field('TYPE', MODULE_PAYMENT_VERISIGN_TYPE) . tep_draw_hidden_field('AMOUNT', number_format($order->info['total'], 2, '.', '')). tep_draw_hidden_field('NAME', $customer_values['customers_firstname'] . ' ' . $customer_values['customers_lastname']) . tep_draw_hidden_field('ADDRESS', $customer_values['entry_street_address']) . tep_draw_hidden_field('CITY', $customer_values['entry_city']) . tep_draw_hidden_field('STATE', tep_get_zone_name($customer_values['entry_country_id'], $customer_values['entry_zone_id'], $customer_values['entry_state'])) . tep_draw_hidden_field('ZIP', $customer_values['entry_postcode']) . tep_draw_hidden_field('COUNTRY', tep_get_country_name($customer_values['entry_country_id'])) . tep_draw_hidden_field('PHONE', $customer_values['customers_telephone']) . tep_draw_hidden_field('EMAIL', $customer_values['customers_email_address']) . tep_draw_hidden_field('NAMETOSHIP', $delivery_values['entry_firstname'] . ' ' . $delivery_values['entry_lastname']) . tep_draw_hidden_field('ADDRESSTOSHIP', $delivery_values['entry_street_address']) . tep_draw_hidden_field('CITYTOSHIP', $delivery_values['entry_city']) . tep_draw_hidden_field('STATETOSHIP', tep_get_zone_name($delivery_values['entry_country_id'], $delivery_values['entry_zone_id'], $delivery_values['entry_state'])) . tep_draw_hidden_field('ZIPTOSHIP', $delivery_values['entry_postcode']) . tep_draw_hidden_field('COUNTRYTOSHIP', tep_get_country_name($delivery_values['entry_country_id'])) . tep_draw_hidden_field('PHONETOSHIP', $customer_values['customers_telephone']) . tep_draw_hidden_field('EMAILTOSHIP', $customer_values['customers_email_address']); return $process_button_string; } function before_process() { return true; } 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_VERISIGN_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 VeriSign', 'MODULE_PAYMENT_VERISIGN_STATUS', 'True', 'Do you want to accept VeriSign 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 ('Login ID', 'MODULE_PAYMENT_VERISIGN_LOGIN', '', 'Your VeriSign Login ID.', '6', '2', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Partner ID', 'MODULE_PAYMENT_VERISIGN_PARTNER', '', 'Your VeriSign Partner ID.', '6', '3', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Transaction Type', 'MODULE_PAYMENT_VERISIGN_TYPE', 'S', 'What is the transaction Type? (S = Sales)', '6', '3', 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_VERISIGN_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VERISIGN_STATUS'"); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VERISIGN_LOGIN'"); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VERISIGN_PARTNER'"); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VERISIGN_TYPE'"); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_VERISIGN_SORT_ORDER'"); } function keys() { $keys = array('MODULE_PAYMENT_VERISIGN_STATUS', 'MODULE_PAYMENT_VERISIGN_LOGIN', 'MODULE_PAYMENT_VERISIGN_PARTNER', 'MODULE_PAYMENT_VERISIGN_TYPE', 'MODULE_PAYMENT_VERISIGN_SORT_ORDER'); return $keys; } } ?> We have managed to get a test transaction to the last step. However, using a test CC number when we select the confirm option on the final page we get an error message like this: We were unable to process your transaction due to one of the following reasons: the credit card or expiration date you entered is invalid, the street address you entered does not match the address of your credit card, the zip code you entered does not match the zip code of your credit card or there are insufficient funds available on the credit card you entered. Does anyone have a clue how to fix this? Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.