This is a subject that hasn't been written about for a while that I can find but I need help.
I was using Paypal's payflowpro (used to be verisigns payflowpro) but with the PCI compliance need to have credit card information be sent off site to get processed (in order to have an easier time being compliant) I decided to transition to payflowlink and use an old module that I had to update so it passed the shipping infomation and update the link.
It works! BUT the problem is people don't seem to finalize the order once paypal gives them the "APPROVED" message. This has the credit card get processed but nothing is sent back to the database to get recorded. (they have to press the finalize button for that to happen).
Now there is a silent post option that was used in the past that is supposed to go to "verisignreturn.php" in the background to write the order without the customer having to press the final button. But it doesn't work.
Here is the verisignlink.php file:
Code:
<?php
/*
$Id: verisign.php,v 1.16 2002/01/20 16:07:40 hpdl Exp $
The Exchange Project - Community Made Shopping!
http://www.theexchangeproject.org
Copyright (c) 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 = 'verisign';
$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.verisign.com/payflowlink.cfm';
$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 $HTTP_POST_VARS, $CardName, $CardNumber, $order, $total_tax, $shipping_cost;
// $HTTP_POST_VARS[$HTTP_POST_VARS['USER1']] = $HTTP_POST_VARS['USER2'];
// $HTTP_GET_VARS[$HTTP_POST_VARS['USER1']] = $HTTP_POST_VARS['USER2'];
// reset ($HTTP_POST_VARS);
// reset ($HTTP_GET_VARS);
$_POST[$_POST['USER1']] = $_POST['USER2'];
$_GET[$_POST['USER1']] = $_POST['USER2'];
reset ($_POST);
reset ($_GET);
if (strlen($HTTP_POST_VARS['payflowlink_cc_first_name']) && strlen($HTTP_POST_VARS['payflowlink_cc_last_name'])){
$Name = $HTTP_POST_VARS['payflowlink_cc_first_name']. ' ' . $HTTP_POST_VARS['payflowlink_cc_last_name']; }else{
$Name = $order->customer['firstname'] . ' ' . $order->customer['lastname'];
}
$process_button_string = tep_draw_hidden_field('LOGIN',login).
tep_draw_hidden_field('PARTNER',partner).
tep_draw_hidden_field('TYPE',MODULE_PAYMENT_VERISIGN_TYPE) .
tep_draw_hidden_field('EXPDATE', $this->cc_expiry_month . $this->cc_expiry_year) .
tep_draw_hidden_field('AMOUNT', number_format($order->info['total'], 2, '.', '')).
tep_draw_hidden_field('SHIPAMOUNT', number_format($order->info['shipping_cost'], 2, '.', '')).
tep_draw_hidden_field('TAX', number_format($order->info['tax'], 2, '.', '')).
tep_draw_hidden_field('NAME', $Name) .
tep_draw_hidden_field('ADDRESS', $order->customer['street_address']) .
tep_draw_hidden_field('CITY', $order->customer['city']) .
tep_draw_hidden_field('STATE', $order->customer['state']) .
tep_draw_hidden_field('ZIP', $order->customer['postcode']) .
tep_draw_hidden_field('COUNTRY', $order->customer['country']['title']) .
tep_draw_hidden_field('PHONE', $order->customer['telephone']) .
tep_draw_hidden_field('EMAIL', $order->customer['email_address']) .
tep_draw_hidden_field('NAMETOSHIP', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) .
tep_draw_hidden_field('ADDRESSTOSHIP', $order->delivery['street_address']) .
tep_draw_hidden_field('CITYTOSHIP', $order->delivery['city']) .
tep_draw_hidden_field('STATETOSHIP', $order->delivery['state']) .
tep_draw_hidden_field('ZIPTOSHIP', $order->delivery['postcode']) .
tep_draw_hidden_field('ECHODATA', 'True') .
tep_draw_hidden_field('SHOWCONFIRM', 'False') .
tep_draw_hidden_field('DISABLERECEIPT', 'False') .
tep_draw_hidden_field('USER1',tep_session_name()) .
tep_draw_hidden_field('USER2',tep_session_id()) .
tep_draw_hidden_field(tep_session_name(),tep_session_id()) .
tep_draw_hidden_field('COUNTRYTOSHIP', $order->delivery['country']['title']);
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;
}
}
?>
Then the verisignreturn.php
Code:
<?php
/*
$Id: versignreturn.php,v 2.2-vl 2003/03/10 23:52:29 rdo Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
This is a revised version for the Verisign Link module.
Released under the GNU General Public License
*/
//global $HTTP_POST_VARS,$HTTP_GET_VARS;
if($_POST['RESPMSG'] == 'Approved') {
$_POST[$_POST['USER1']] = $_POST['USER2'];
$_GET[$_POST['USER1']] = $_POST['USER2'];
reset ($_POST);
reset ($_GET);
}
$postparameters='';
while (list ($key, $val) = each ($_POST)) {
$postparameters .= $key.'='.urlencode($val).'&';
}
include('includes/application_top.php');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, $postparameters , 'SSL', false, false));
?>
IF I attempt to use the silent post and point it to the verisignreturn.php file the credit card gets processed but then voided because it doesn't get a 200 success error. Which from this post "starting with the Eureka! post"
http://forums.oscommerce.com/topic/1415 ... gn-issues/says is because the last "redirect" line.
So I have spend the last 3 days working to try their solution (which doesn't work) Or anything else I can think of....
Can anyone help? Point me in the right direction? Tell me I'm screwed? etc.
Thank you,
Mike