Jump to content
Sign in to follow this  
perfectpassion

Protx Direct v2.22

Recommended Posts

The order editor has no direct way of making payments and needs to be customised to take manual protx payments - I recall now sending you a customisation that I did for a site that was heavily customised - hence why it probably doesn't work. Just looking at the code again try the following:

 

Edit admin/includes/classes/order.php:

	  $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
  while ($totals = tep_db_fetch_array($totals_query)) {
	$this->totals[] = array('title' => $totals['title'],
							'text' => $totals['text']);
  }

change to:

	  $totals_query = tep_db_query("select title, text, class, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
  while ($totals = tep_db_fetch_array($totals_query)) {
	$this->totals[] = array('title' => $totals['title'],
							'text' => $totals['text'],
							'class' => $totals['class'],
							'value' => $totals['value']);
  }

 

The status lights is not a mod I created/support so I'm not sure why it's not working - If you replace the admin/orders_protx.php with the original from the protx 4.4 zip do you get the fields displayed?

 

Tom

 

I haven't got the status lights working yet, but am less worried about that - they didn't work with the original admin/orders_protx.php

 

Good new on the edit order front.

 

I can now make payments via protx - the value is picked up.

 

However, when I create a new order, adding new products does not seem to work, the value is not recalculated and the product is not added - if I refresh the page the new product is shown as added, but the value of the order remains at 0 so I guess this bit needs to get sorted and I will be there - so thank you for getting me nearer.

 

You are right you did send me an edited admin/order_edits.php file.

 

If I diff this file against the original file these are the differences (hoping something in here is causing the problem)

 

After: (around line 65)

 

////

//Update Order

case 'update_order'

 

The following is added:

 

			  if ($_POST['protx']) {

// Extra Configuration Options
$disable_curl_ssl_check = false;	// Set to true (no quotes)
								// if you are having problems connecting to the protx servers

$timeout = 90;  // Number of seconds to wait for Protx response

$protocol = '2.22';  // Shouldn't need changing

$currency = 'GBP';

// End of extra configuration options

define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_DECLINED_MESSAGE', 'Your credit card could not be authorised. Please correct any information and try again or contact us for further assistance.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_ERROR', 'There seems to be a problem with your credit card.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_PROTX_ERROR', 'Unfortunately there has been a technical problem. Please try again and if the problem persists please contact us');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_PROTX_MALFORMED', 'Your credit card could not be authorised. Please correct any information and try again or contact us for further assistance.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_PROTX_INVALID', 'Your credit card could not be authorised. Please correct any information and try again or contact us for further assistance.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_CVV_ERROR', 'The security code given does not match that of your card. Please correct this and try again.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_ADDRESS_ERROR', 'The billing address given does not match that of your card. Please correct this and try again.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_AVS_CVV_ERROR','There has been an error with the security checks. Please check your billing address matches your card statement address and the security code (CVV) is correct and try again.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_INVALID_ISSUE','The issue number given is incorrect. Please check is carefully (including any leading zero) and try again.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_INVALID_START','The start date is either incorrect or missing. Please check carfeully and try again.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_INVALID_CARDTYPE','The given card type is incorrect. Please check carefully and try again.');
define('MODULE_PAYMENT_PROTX_DIRECT_TEXT_3D_DECLINED','Your card failed your bank\'s Verified by Visa / Mastercard Securecode checks. Please try again.');

/*include(DIR_WS_CLASSES.'currencies.php');
$currencies = new currencies; */

 require(DIR_WS_CLASSES . 'order.php');
 $order = new order((int)$_GET['oID']);

$new_order_id = (int)$_GET['oID'];
 $order_description = 'Order Number: ' . (int)$_GET['oID'];

// DATA PREPARATION SECTION
	unset($submit_data);  // Cleans out any previous data stored in the variable

  // Populate an array that contains all of the data to be sent to Protx
	$delivery_add = '';
	if ($order->delivery['street_address']) {
	  $delivery_add = $order->delivery['street_address'];
	}
	if(ACCOUNT_SUBURB == 'true' && tep_not_null($order->delivery['suburb'])) {
	  $delivery_add .= ",\r\n" . $order->delivery['suburb'];
		}
	if (tep_not_null($order->delivery['city'])) {
	  $delivery_add .= ",\r\n" . $order->delivery['city'];
	}
	if (ACCOUNT_STATE == 'true' && tep_not_null($order->delivery['state'])) {
	  $delivery_add .= ",\r\n" . $order->delivery['state'];
	}
	if (tep_not_null($order->delivery['country']['title'])) {
	  $delivery_add .= ",\r\n" . $order->delivery['country']['title'];
	}

	$billing_add = '';
	$billing_add = $order->billing['street_address'];
	if (ACCOUNT_SUBURB == 'true') {
	  $billing_add .= ",\r\n" . $order->billing['suburb'];
	}
	$billing_add .= ",\r\n" . $order->billing['city'];
	if (ACCOUNT_STATE == 'true') {
	  $billing_add .= ",\r\n" . $order->billing['state'];
	}
	$billing_add .= ",\r\n" . $order->delivery['country']['title'];


 $use_3D_Secure = 2;  // Disable 3D-Secure as this is a MOTO (should be disabled automatically anyway)

//calculate total
$total = 0;
for ($i=0; $i<sizeof($order->totals); $i++) {
  if ($order->totals[$i]['class'] == 'ot_total') {
	  $total += $order->totals[$i]['value'];
	}
}

// create a random id for the transaction
  $uid = tep_create_random_value(32, 'digits');
  $VendorTxCode = $new_order_id . '-' . $uid;
	$submit_data = array(
	VPSProtocol => $protocol, // Protocol Version (Should be 2.22 for this release)
	TxType => MODULE_PAYMENT_PROTX_DIRECT_AUTHORIZATION_TYPE, // Transaction Type
	Vendor => MODULE_PAYMENT_PROTX_DIRECT_VENDOR_NAME, // Vendor Login ID
	VendorTxCode => $VendorTxCode,  // Unique Transaction ID
  Amount => number_format($total * $currencies->get_value($currency), 2,'.',''),
	Currency => $currency,
	Description => $order_description,
  CardHolder => substr($_POST['protx_direct_cc_owner'],0,50),
	CardNumber => $_POST['protx_direct_cc_number'],
	StartDate => $_POST['protx_direct_cc_start_month'].$_POST['protx_direct_cc_start_year'],
	ExpiryDate => $_POST['protx_direct_cc_expires_month'].$_POST['protx_direct_cc_expires_year'],
	IssueNumber => $_POST['protx_direct_cc_issue'],
	CV2 => $_POST['protx_direct_cc_cvv'],
	CardType => $_POST['protx_direct_cc_type'],
	BillingAddress => substr($billing_add,0,200),
	BillingPostCode => substr($order->billing['postcode'],0,10),
	DeliveryAddress => substr($delivery_add,0,200),
	DeliveryPostCode => substr($order->delivery['postcode'],0,200),
	CustomerName => substr($order->customer['name'],0,100),
	ContactNumber => substr($order->customer['telephone'],0,20),
	CustomerEMail => substr($order->customer['email_address'],0,255),
  //  ClientIPAddress => tep_get_ip_address(),
  //  Basket => $basketlist,
	AccountType => 'M',  // This is a MOTO transaction - regardless of general setting
	  Apply3DSecure =>$use_3D_Secure);

  // concatenate the submission data and put into variable $data
  while(list($key, $value) = each($submit_data)) {
	$data .= $key . '=' . urlencode($value) . '&';
  }

  // Strip final &
  $data = substr($data, 0, -1);

// SEND DATA BY CURL SECTION
  // Post order info data to Protx, make sure you have curl installed
	// Unset $response to make sure nothing left over from previous module calls
	unset($response);
	unset($responses);

  if (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Test') {
	  $url = 'https://ukvpstest.protx.com/vspgateway/service/vspdirect-register.vsp';
	} elseif (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Server IP Test') {
	  $url = 'https://ukvpstest.protx.com/showpost/showpost.asp';
	} elseif (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Simulator') {
	  $url = 'https://ukvpstest.protx.com/VSPSimulator/VSPDirectGateway.asp';
	} else {
	  $url = 'https://ukvps.protx.com/vspgateway/service/vspdirect-register.vsp';
	}

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);

if ($disable_curl_ssl_check === true) {
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  }

  $response = curl_exec($ch);
  $curl_error = curl_error($ch);

  curl_close ($ch);



  // Begin Debug Section
  if (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Server IP Test'){
   echo print_r($response,true);
   echo print_r($data,true);
	exit();
  }
  // End Debug Section

  // parse Protx response string
  $responses = Array();
  $response_array = explode("\r\n", $response);
  for ($i=0; $i < sizeof($response_array); $i++) {
	$key = substr($response_array[$i],0, strpos($response_array[$i], '='));
	$responses[$key] = substr(strstr($response_array[$i], '='), 1);
  }

  // Begin Debug Section
  if (MODULE_PAYMENT_PROTX_DIRECT_DEBUG == 'True'){
  echo '<pre>Request URL=' . $url . "\r\n" .
	   'Data string sent=' . $data . "\r\n" .
	   'Protx response=' . $response . "\r\n" .
	   'Response array='. print_r($responses,true) ."\r\n".
	   'curl_error= ' . $curl_error . '</pre>';
	exit();
  }
  // End Debug Section

$data = Array('id' => '',
			'customer_id' => $order->info['customers_id'],
				'order_id' => $new_order_id,
				'vendortxcode' => $VendorTxCode,
				'txtype' => MODULE_PAYMENT_PROTX_DIRECT_AUTHORIZATION_TYPE,
				'value' => number_format($total * $currencies->get_value($currency), 2, '.', ''),
				'vpstxid' => $responses['VPSTxId'],
				'status' => $responses['Status'],
				'statusdetail' => $responses['StatusDetail'],
				'txauthno' => $responses['TxAuthNo'],
				'securitykey' => $responses['SecurityKey'],
				'avscv2' => $responses['AVSCV2'],
				'address_result' => $responses['AddressResult'],
				'postcode_result' => $responses['PostCodeResult'],
				'CV2_result' => $responses['CV2Result'],
				'3DSecureStatus' => $responses['3DSecureStatus'],
				'CAVV' => $responses['CAVV'],
				'txtime' => date('Y-m-d H:i:s'));

	tep_db_perform('protx_direct', $data);
  $protx_id = tep_db_insert_id();

  // Check response and proceed appropriately
$response_code = substr($responses['StatusDetail'],0,4);
  $authorised = false;  // Default to transaction failed
  $error_detail = '';

  switch ($responses['Status']) {

  case "OK":
	case "REGISTERED":
	case "AUTHENTICATED":
	  // OK to proceed
  $authorised = true;
	  break;

	case "REJECTED":
	case "NOTAUTHED":
	  if ($response_code == '2001') {
		if (stristr($responses['AVSCV2'], 'NO DATA MATCHES')) {
		  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_AVS_CVV_ERROR;
		} elseif (stristr($responses['AVSCV2'], 'SECURITY CODE MATCH ONLY')) {
			$error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_ADDRESS_ERROR;
		} elseif (stristr($responses['AVSCV2'], 'ADDRESS MATCH ONLY')) {
		  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_CVV_ERROR;
		} else {
		  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_DECLINED_MESSAGE .' (' . $responses['StatusDetail'] . ')';			
		}  
	  } elseif ($response_code == '4026') {
		  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_3D_DECLINED;			
	  } else {
		$error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_DECLINED_MESSAGE .' (' . $responses['StatusDetail'] . ')';		
	  }
	  break;

	case "MALFORMED":
	  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_PROTX_MALFORMED . ' (' . $responses['StatusDetail'] . ')';
	  break;	

	case "INVALID":
	  if ($response_code == '5015') {
		if (stristr($responses['StatusDetail'],'Issue')) { 
  			  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_INVALID_ISSUE;
		} elseif (stristr($responses['StatusDetail'],'Start')) {
		  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_INVALID_START;
		}
	  } elseif ($response_code == '4022') {
		$error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_INVALID_CARDTYPE;
	  }  else {
		$error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_PROTX_INVALID . ' (' . $responses['StatusDetail'] . ')';
	  }
	  break;

	case "ERROR":
	  // There's a fault with module or Protx
	  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_PROTX_ERROR . ' (' . $responses['StatusDetail'] . ')';
	  break;		 

	default:
	  // Just in case we haven't caught any other response, assume failed
	  $error_detail = MODULE_PAYMENT_PROTX_DIRECT_TEXT_PROTX_ERROR . ' (' . $responses['StatusDetail'] . ')';
	  break;
  }	  

  if ($authorised === true) {
		$messageStack->add_session('Payment successful', 'success');
	  tep_redirect(tep_href_link(FILENAME_ORDERS_EDIT, tep_get_all_get_params(array('action')) . 'action=edit'));

  } else {
		$messageStack->add_session('Payment Failed: '.$error_detail, 'error');
	  tep_redirect(tep_href_link(FILENAME_ORDERS_EDIT, tep_get_all_get_params(array('action')) . 'action=edit'));
  }			

			}

 

Line:

'payment_method' => tep_db_input(tep_db_prepare_input($_POST['update_info_payment_method'])),

Changed to:

'payment_method' => tep_db_input(tep_db_prepare_input(htmlspecialchars($_POST['update_info_payment_method']))),

 

Line: 1164

</tr>

Replaced with:

 

</tr> -->
	<tr>
	  <td>
		<?php 	$protx_direct = new protx_direct;
		$selection[0] = $protx_direct->selection(); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="2" class="bor">
		  <tr>
			<td class="main" width="100%" colspan="2">Enter Payment Information</td>
		  </tr>
<?php
 $radio_buttons = 0;
 for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
?>
		  <tr>
			<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
  echo '				  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
} else {
  echo '				  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
}
?>
				<td class="main"><b><?php echo $selection[$i]['module']; ?></b></td>
				<td class="main" align="right">
<?php
if (sizeof($selection) > 1) {
  echo tep_draw_radio_field('payment', $selection[$i]['id']);
} else {
  echo tep_draw_hidden_field('payment', $selection[$i]['id']);
}
?>
				</td>
			  </tr>
<?php
if (isset($selection[$i]['error'])) {
?>
			  <tr>
				<td class="main" colspan="2"><?php echo $selection[$i]['error']; ?></td>
			  </tr>
<?php
} elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
?>
			  <tr>
				<td colspan="2">

				<table border="0" cellspacing="0" cellpadding="2">
<?php
  for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
?>
				  <tr>
					<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main"><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
					<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main"><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
					<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
<?php
  }
?>
				</table>

				</td>
			  </tr>
<?php
}
?>
			</table></td>
		  </tr>
<?php
$radio_buttons++;
 }			
?>			</td>
	</tr>		
	<tr>
	  <td class="main"><?php   tep_draw_hidden_field(tep_session_name(), tep_session_id());
								 tep_draw_hidden_field('oID', $oID); ?>
										  <input type="submit" name="protx" value="Create new payment"></form></td>
	</tr>

 

 

I'm guessing somewhere in here the update to the value/contents of the shopping bag is not happening.

 

If you have any idea you would make me quite possibly the happiest person in the UK!

Share this post


Link to post
Share on other sites

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-a-shopp-53 like 'orders'' at line 1

 

SHOW TABLE STATUS from web36-a-shopp-53 like 'orders'

 

[TEP STOP]

 

anyone know what this is about? I get this error when someone tries to pay... please help

Share this post


Link to post
Share on other sites
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-a-shopp-53 like 'orders'' at line 1

 

SHOW TABLE STATUS from web36-a-shopp-53 like 'orders'

 

[TEP STOP]

 

anyone know what this is about? I get this error when someone tries to pay... please help

 

by the way i am using this contribution... Protx Direct v4.4

Share this post


Link to post
Share on other sites

Hi,

 

I am working on an oscommere store which i have recently uploaded to 1and1. I have successfully set up 1and1's shared SSL.

 

When it comes to integrating payment modules i'm a bit of a beginner. So far I have installed the latest version of Protx Direct according to the install instructions. However, when I try and make a payment (Vendor Name - Testvendor, Transaction mode - Test) I get redirected to the login.php page.

 

Please not that I have not signed up with Protx yet. Is this why my transaction isn't going through or is there something else wrong?

 

If someone could tell me what steps i should be taking next i would be very grateful.

 

Thanks,

Nick

Share this post


Link to post
Share on other sites

OK,

 

I've done some research ...which has prompted me to do the following:

 

1. I've set up a VSP Simulator account.

2. In the accounts section of the Simulator account i have set my home page, operating system (linux i believe), scripting language (PHP), a valid IP address and currency (GBP).

3. I've set the authorisation type to PAYMENT in OSCommerce admin.

 

Now when i place an order using the test card numbers it does show up in the Transactions section of my VSP Simulator account. However, after confirming the payment in OSCommerce I am redirected to the login.php page rather than the checkout_success.php page. Furthermore no orders show up in the admin section of OSC.

 

My website is password protected by a .htaccess file. Would this cause me to be directed to login.php rather than checkout_success.php? The only reason the site is password protected is to stop google from spidering it too soon. If anyone thinks they can help I will happily give out the password so they can see my site.

 

All input is very welcome!

Share this post


Link to post
Share on other sites

donny84 - open protx_process.php, find (line 208):

	$last_order_id_query = tep_db_query("SHOW TABLE STATUS from " . DB_DATABASE . " like '" . TABLE_ORDERS . "'");

change to

	$last_order_id_query = tep_db_query("SHOW TABLE STATUS from `" . DB_DATABASE . "` like '" . TABLE_ORDERS . "'");

 

darrenultra - It sounds like a sessions problem, check your cookie settings in includes/configure.php

 

PJ2006 - try changing the following line from:

<input type="submit" name="protx" value="Create new payment"></form></td>

to

<input type="submit" name="protx" value="Create new payment"></td>

 

Tom

Share this post


Link to post
Share on other sites
darrenultra - It sounds like a sessions problem, check your cookie settings in includes/configure.php

 

Hi Tom,

 

I checked my cookie settings ...i have the following:

define('HTTP_COOKIE_DOMAIN', 'www.bananafingers.co.uk');

define('HTTPS_COOKIE_DOMAIN', 'sslrelay.com/bananafingers.co.uk');

define('HTTP_COOKIE_PATH', '/storeradio/');

define('HTTPS_COOKIE_PATH', '/storeradio/');

 

I believe this to be correct for a shared SSL setup. I've messed about with them a bit ...but it doesn't seem to help.

 

I've just put another order through - this time in debug mode. The order has appeared in Protx VSP simulator without any problems. This is the info i was given on the protx_process.php page:

 

Request URL=https://ukvpstest.protx.com/VSPSimulator/VSPDirectGateway.asp

Data string sent=VPSProtocol=2.22&TxType=PAYMENT&Vendor=bananafingers&VendorTxCode=47-51549625116921412338468327332399&Amount=135.11&Currency=GBP&Description=Order+Number%3A+47&CardHolder=Nick+Barr&CardNumber=5404000000000001&StartDate=0407&ExpiryDate=0415&IssueNumber=&CV2=987&CardType=MC&BillingAddress=Southwheel+House%2C%0D%0ABroad+Elm%2C%0D%0AHereford%2C%0D%0AHerefordshire%2C%0D%0AUnited+Kingdom&BillingPostCode=HR3+7RA&DeliveryAddress=Southwheel+House%2C%0D%0ABroad+Elm%2C%0D%0AHereford%2C%0D%0AHerefordshire%2C%0D%0AUnited+Kingdom&DeliveryPostCode=HR3+7RA&CustomerName=Nick+Barr&ContactNumber=01776765837&CustomerEMail=contact%40radioscan.co.uk&ClientIPAddress=88.105.105.67&Basket=3%3AMicrosoft+Internet+Keyboard+PS%2F2%3A1%3A69.99%3A12.25%3A82.24%3A82.24%3ADie+Hard+With+A+Vengeance%3A1%3A39.99%3A7.00%3A46.99%3A46.99%3AShipping%3A1%3A5.88%3A----%3A5.88%3A5.88&AccountType=E&Apply3DSecure=2

Protx response=VPSProtocol=2.22

Status=OK

StatusDetail=VSP Direct transaction from VSP Simulator.

VPSTxId={30362B53-3884-422D-9B62-6AA8B342F952}

SecurityKey=WIY03W9X3W

TxAuthNo=5403

AVSCV2=SECURITY CODE MATCH ONLY

AddressResult=NOTCHECKED

PostCodeResult=NOTCHECKED

CV2Result=MATCHED

 

Response array=Array

(

[VPSProtocol] => 2.22

[status] => OK

[statusDetail] => VSP Direct transaction from VSP Simulator.

[VPSTxId] => {30362B53-3884-422D-9B62-6AA8B342F952}

[securityKey] => WIY03W9X3W

[TxAuthNo] => 5403

[AVSCV2] => SECURITY CODE MATCH ONLY

[AddressResult] => NOTCHECKED

[PostCodeResult] => NOTCHECKED

[CV2Result] => MATCHED

[0] =>

)

 

curl_error=

 

 

....does this give you any idea as to what might be going on? If you want to try putting an order through yourself the website is bananafingers dot co dot uk and the htaccess username and password are as follows:

username: 1234

password: 1234567

 

Many Thanks,

Nick

Share this post


Link to post
Share on other sites
donny84 - open protx_process.php, find (line 208):
	$last_order_id_query = tep_db_query("SHOW TABLE STATUS from " . DB_DATABASE . " like '" . TABLE_ORDERS . "'");

change to

	$last_order_id_query = tep_db_query("SHOW TABLE STATUS from `" . DB_DATABASE . "` like '" . TABLE_ORDERS . "'");

 

darrenultra - It sounds like a sessions problem, check your cookie settings in includes/configure.php

 

PJ2006 - try changing the following line from:

<input type="submit" name="protx" value="Create new payment"></form></td>

to

<input type="submit" name="protx" value="Create new payment"></td>

 

Tom

 

Whooooooooo hoooooooooooooooooo it worked, thank you so much, now doing happy dance around the room - You are an absolute star Tom !!!!!

Share this post


Link to post
Share on other sites

PJ2006 - glad it's working!

 

darrenultra - the debug you posted is absolutely fine. I had a look at your site and there's definately session problems - firstly the osCsid doesn't disappear showing that cookies aren't working and also the session id changes during checkout/

 

try changing your configure.php to:

define('HTTP_COOKIE_DOMAIN', 'www.bananafingers.co.uk');

define('HTTPS_COOKIE_DOMAIN', 'sslrelay.com);

define('HTTP_COOKIE_PATH', '/storeradio/');

define('HTTPS_COOKIE_PATH', '/bananafingers.co.uk/storeradio/');

define('STORE_SESSIONS', 'mysql');

 

if that doesn't work try:

define('HTTP_COOKIE_DOMAIN', 'www.bananafingers.co.uk');

define('HTTPS_COOKIE_DOMAIN', '');

define('HTTP_COOKIE_PATH', '/storeradio/');

define('HTTPS_COOKIE_PATH', '');

define('STORE_SESSIONS', 'mysql');

Share this post


Link to post
Share on other sites
PJ2006 - glad it's working!

 

darrenultra - the debug you posted is absolutely fine. I had a look at your site and there's definately session problems - firstly the osCsid doesn't disappear showing that cookies aren't working and also the session id changes during checkout/

 

try changing your configure.php to:

define('HTTP_COOKIE_DOMAIN', 'www.bananafingers.co.uk');

define('HTTPS_COOKIE_DOMAIN', 'sslrelay.com);

define('HTTP_COOKIE_PATH', '/storeradio/');

define('HTTPS_COOKIE_PATH', '/bananafingers.co.uk/storeradio/');

define('STORE_SESSIONS', 'mysql');

 

Hi Tom,

 

I made the changes you suggested and what do you know? It is working like a dream!

You don't know how happy you've made me!

 

Cheers,

Nick

Share this post


Link to post
Share on other sites

Hi Tom,

 

I have taken the plunge and decided to switch from HSBC to Protx.

 

After having installed your payment module and now having it working in test mode, I have a couple of questions.

 

Firstly, regarding the order number/tx code. Due to the fact that I was using a random order number generator with HSBC, when I reset osC to use the auto increment order numbers, I have had to start from 10000000. This means that the protx tx code was too long. I have reduced your randomly generated number from 32 down to 26. Is there any reason why you opted for a 32 digit number, presumably it was the maximum length you could fit into the tx code, along with the order number. The longest being the most secure. I am guessing that reducing the length should not have any impact on how the module works but would be happier if you could confirm this.

 

Secondly, due to the fact that with our business we sometimes have items that we have to order items in to complete orders and on occassions there may be a lengthy delay in completing the backorders, I have opted to use the "Authenticate/Authorise" transaction type rather than "Deffered/Release" (as these transactions automatically cancel after 30 days). Everything seems to be working fine but I have a query about the admin orders page. When the order is made, I can view the order in admin and authorise or cancel it, but after authorising it I only get the option to Repeat it (which I dont need). It is only after trying to Repeat the order (not currently working for me) that I get option to Refund the order. Having looked at admin/orders_protx.php I see that this is how you have designed it and the process is working as it should but is there any reason I cannot skip the Repeat option and jump straight to Refund for an already authorised order?

 

Thanks,

Richard


Only Dead Fish Go With The Flow......

Share this post


Link to post
Share on other sites

Hi,

 

The Protx spec allows for a VendorTxCode of upto 40 character show I chose 32 random digits, which with the hyphen would allow order numbers upto 7 digits long (i.e. 999,999,999) - I thought this would be enough for anyone!

 

There should be no issue reducing the number of digits - it's not really a security thing - it more that each VendorTxCode needs to be unique so the more random digits the more likely that'll be.

 

Regarding the refund for Authorised transactions - there's no reason other than oversight on my part, there's no reason to add it in

 

find:

} elseif ($transaction['txtype'] == 'AUTHORISE') {
 echo '<td align="center"><a href="java script:disp_prompt(\'repeat\', '.$transaction['value'].', '.$tid.');" style="text-decoration:underline">Repeat</a></td>';
} elseif ($transaction['txtype'] == 'REPEAT') {

and change to:

} elseif ($transaction['txtype'] == 'AUTHORISE') {
 echo '<td align="center"><a href="java script:disp_prompt(\'repeat\', '.$transaction['value'].', '.$tid.');" style="text-decoration:underline">Repeat</a> / <a href="java script:disp_prompt(\'refund\', '.$transaction['value'].', '.$tid.');" style="text-decoration:underline">Refund</a></td>';
} elseif ($transaction['txtype'] == 'REPEAT') {

 

Tom

Share this post


Link to post
Share on other sites

Thanks for the reply Tom.

 

Your answers were what I expected, nice to have it confirmed though.

 

So far, I am very happy to be making the change from HSBC to Protx and alot of that is down to the simplicity/ease of install of this contribution and the regular updating of this thread by yourself and others (namely Vger).

 

Many thanks again for your work on this,

 

Richard


Only Dead Fish Go With The Flow......

Share this post


Link to post
Share on other sites

By payment system I think they are referring to PAYMENT, DEFERRED, AUTHENTICATE/AUTHORISE - check you are using the right one - if you are then I'd give the Protx support line a call.

 

Tom

Share this post


Link to post
Share on other sites

We have been using your Protx faultlessly. Thanks very much. :thumbsup:

We now wish to have transactions recur automatically as in a subscription.

£ x every month.

Does the 'repeat' function in admin do this or what can we do?

TIA.


HTH

Neil

 

Common sense is genius dressed in working clothes.

Ralph Waldo Emerson

Share this post


Link to post
Share on other sites

Yes the repeat feature can be used for this.

 

You MUST have a continuous authority merchant account for recurring payments, and will need to set the protx module to 'C' mode (look in the module setup in admin)

 

http://techsupport.protx.com/continuousauthority.asp - has some useful information about the banks that support it and getting it set up.

 

Tom

Share this post


Link to post
Share on other sites

Hi Tom,

 

Hope your well!

 

Just have a quick question regarding the name entered on the payment screen. Currently the name is transferred over from the account details to the 'Name as it appears on card' section.

 

Now if this name is not identical to what appears on the card is there a possibilty the transaction will be declined?

 

Reason I ask is because I am losing 3 or 4 conversions a day on this page, therefore I was wondering if the problem was related to this. I have used other sites and they show the 'Name on card' section blank for the customer to fill in again.

 

If this could be the problem, which bit of code do I need to remove so the name is not automatically transferred over from the account details that are stored in the database?

Share this post


Link to post
Share on other sites
Yes the repeat feature can be used for this.

 

You MUST have a continuous authority merchant account for recurring payments, and will need to set the protx module to 'C' mode (look in the module setup in admin)

 

http://techsupport.protx.com/continuousauthority.asp - has some useful information about the banks that support it and getting it set up.

 

Tom

 

Thanks Tom,

We have set the protx module to 'C' mode.

A transaction has been processed & shows in admin as Payment Type = 'PAYMENT'.

To make this recur do we click the 'repeat' link?

Is this automatically monthly or where do we set the duration - eg monthly, weekly?

Can we set this to a specific day in the month eg 15th or is it already set?


HTH

Neil

 

Common sense is genius dressed in working clothes.

Ralph Waldo Emerson

Share this post


Link to post
Share on other sites

Clicking repeat will process a new payment (for the amount specified in the subsequent popup).

 

This will not be recurring, you will need to click repeat every time you need the payment to be taken.

 

If you need it to be automated that will need a custom coded solution.

 

Tom

Share this post


Link to post
Share on other sites

I seem to be having trouble with the "credit card error" info on Protx Direct 4.4

 

The module works fine and takes orders but if a customer inputs incorrect card details, on bouncing them back to checkout_payment.php the "Credit Card Error" text is displayed above a red box where presumably one of the error messages defined in /includes/languages/english.php would be displayed.

 

There is however, no text displayed in this red box.

 

I've tested against all of the card error types I can.

 

Any ideas?

Share this post


Link to post
Share on other sites

Hi Tom

 

Not sure if you missed my query on post #1044 :P

Edited by blagger

Share this post


Link to post
Share on other sites

sorry had missed it!

 

The Cardholder's name, although transferred to Protx and a compulsary field, is not actually verfied when the transaction is processed (so I am lead to believe) - the postcode and address numerics (along with the CVV) are the most imortant values - these are checked every time (if AVS checks are enable at the protx end).

 

If you look at your protx_direct table in your db failures will be listed there along with the error code - may help you figure out why.

 

Tom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×