Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Protx Direct v2.22


Guest

Recommended Posts

Stowmarket, Ipswich, Norwich - us East Anglian folk are taking over the world.

 

Vger

 

 

The way it should be ;)

Link to comment
Share on other sites

  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

I'll uninstall the one we currently use (didn't know there was a better one), and try Chemo's one out. I must say, the old one has been working for a very long time with no problems...

 

Cheers, Laurie.

 

I bet that will solve the problem.

Link to comment
Share on other sites

Hi, thanks for the suggestion. Unfortunately I have already attempted this and it makes no difference.

 

I have no idea if the W3C option is enabled. :blush:

 

Any other suggestions would be really helpful.

 

Regards,

 

Paul.

 

 

Have you checked the tep_redirect function in includes/functions/general.php to ensure that it is stock and the $url is not being formatted with htmlspecialchars or somesuch?

Link to comment
Share on other sites

Have you checked the tep_redirect function in includes/functions/general.php to ensure that it is stock and the $url is not being formatted with htmlspecialchars or somesuch?

 

Hi Babygurgles, here is the function:

 

function tep_redirect($url) {

if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url

$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL

}

}

header('Location: ' . $url);

tep_exit();

 

Our site is heavily customised and cannot remember if this is chemo's code or not....

 

Anything look stupid to anyone?

Link to comment
Share on other sites

Hi Babygurgles, here is the function:

 

function tep_redirect($url) {

if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url

$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL

}

}

header('Location: ' . $url);

tep_exit();

 

Our site is heavily customised and cannot remember if this is chemo's code or not....

 

Anything look stupid to anyone?

 

Well it's a dirty fix and better to find the root of the problem .. but if all else fails ..

 

Replace in that function

 

	header('Location: ' . $url);

 

With

 

if (eregi('&', $url)) $url = str_replace('&', '&', $url); //Dirty fix to replace & with & in the url
header('Location: ' . $url);

 

Good luck

Link to comment
Share on other sites

Well it's a dirty fix and better to find the root of the problem .. but if all else fails ..

 

Replace in that function

 

	header('Location: ' . $url);

 

With

 

if (eregi('&', $url)) $url = str_replace('&', '&', $url); //Dirty fix to replace & with & in the url
header('Location: ' . $url);

 

Good luck

 

Hi,

 

Thanks for the fix. Works perfectly.

 

I'll have to spend some time to find out excatly why it seems to get encoded but at least our customers can see any protential issues with the payment model.

 

Thanks again,

 

Paul.

Link to comment
Share on other sites

I bet that will solve the problem.

 

Ok, I've removed the SEO stuff I was using, flushed all caches, turned off the "search engine friendly URLs" thingy in admin, and the site now works, albeit without SEO enabled.

 

I'll now tar the site up and add in Chemo's stuff. Will report back.

 

On another peripheral note, is anyone else in the East Anglian contingent a member of ALUG (Anglian Linux User Group)? PM me if you are or want to be, please.

 

Cheers, Laurie.

Link to comment
Share on other sites

Use version 2.1c - the last one updated by Chemo himself. I wouldn't trust anything later than that.

 

Vger

 

I did as you advise, and the site is now working fine. There is one caveat though. The 2.1c version isn't properly compatible with MySQL5. There's a later replacement for seo.class.php which changes the database tables slightly (see: Fixed seo.class.php jpweber 25 Nov 2006) .

 

Ideally, the new version should be installed before first running the app, so the database is properly configured. However, if, as I did, one runs the app as per the instructions, SE-friendly URLs don't work for categories, and clearing the SEO cache dies with the following error:

 

"1146 - Table '<your-database>.cache' doesn't exist DELETE FROM cache WHERE cache_name LIKE '%seo_urls%'"

 

It is also not possible to create new categories.

 

The solution is to take the SQL code from seo.class.php which creates the cache table and execute it your favourite way. Everything works fine thereafter.

 

Many thanks to all who helped here, and especially Tom for a great plug-in.

 

Cheers, Laurie.

Link to comment
Share on other sites

hi guys..

 

i got a uk shop running protx form.. i been testing protx direct for a while and everything looks ok. I am using the version 4.4 protx direct.

 

i am trying to add a surcharge facility .i used this contribution http://www.oscommerce.com/community/contri...ch,payment+type .In uk it is legal to add surcharge.

 

the problem i am having is that it adds surcharge regardless of what type of card is being used.i wanna add surcharge to only credit card not debit card, e.g mastercard and visa.

 

i am looking for few pointers on how to achive this using protx direct 4.4.is it possible to have two protx direct modules running at the same time, label one as debit card and the other credit card.then i can add a surcharge to the credit card.

 

At the moment i have added the surcharge to over all price of the good but this makes certain goods way over priced compared to other shops. i been looking at protx direct to replicate it but with no luck.. i am kind of lost here..what files do i need to replcate ?? no sure .

 

many thanks in advance

 

nafri

Link to comment
Share on other sites

It would be possible to have 2 protx_direct modules but you would need to modify them so they don't clash with each other. You would need to duplicate the includes/modules/payment/protx_direct.php file and the corresponding language file. The files would need to be renamed and then you would need to change the class (i.e. class protx_direct to class protx_direct2 )and constructor function name (i.e function protx_direct() to function protx_direct2() ) as well as the code name (i.e $this->code ="protx_direct" ). You would also need to change the name of the various constants within the module (e.g MODULE_PAYMENT_PROTX_DIRECT....). Finally you would also need to change the fieldnames for the checkout/confirmation pages - these are the fields such as protx_direct_cc_type as used in several of the functions.

 

You would need to duplicate the protx_process.php file and update the names of those variables you have used as above.

 

In summary it is possible but will just take a little bit of work!

 

Tom

Link to comment
Share on other sites

It would be possible to have 2 protx_direct modules but you would need to modify them so they don't clash with each other. You would need to duplicate the includes/modules/payment/protx_direct.php file and the corresponding language file. The files would need to be renamed and then you would need to change the class (i.e. class protx_direct to class protx_direct2 )and constructor function name (i.e function protx_direct() to function protx_direct2() ) as well as the code name (i.e $this->code ="protx_direct" ). You would also need to change the name of the various constants within the module (e.g MODULE_PAYMENT_PROTX_DIRECT....). Finally you would also need to change the fieldnames for the checkout/confirmation pages - these are the fields such as protx_direct_cc_type as used in several of the functions.

 

You would need to duplicate the protx_process.php file and update the names of those variables you have used as above.

 

In summary it is possible but will just take a little bit of work!

 

Tom

 

Many thanks tom.. you saved me alot of hadache here.. .i made the changes in the module and language file but forgot to do it in the protx_process.php.

 

thanks again.

 

nafri

Link to comment
Share on other sites

hi just installed this update version 4.4 which works great apart from when not entering certain card information i'm getting the following code show up on my site in checkout_payment.php:

 

TEXT_CCVAL_ERROR_INVALID_DATE

 

TEXT_CCVAL_ERROR_INVALID_NUMBER

 

and so on, have i missed something.

 

how can i modify the page layout for when you get the two new screens appear once you have hit confirm order? when the boxes come up my site in the background only shows the header.

 

also how can i have 'please select' on the card drop down box rather than just electron there, i'm sure people will not see this correctly otherwise.

Edited by blagger
Link to comment
Share on other sites

If those strings are appearring then the following defines are missing from your includes/languages/english.php file - they are standard osC defies and not part fo the module - they must have been deleted at some pint

define('TEXT_CCVAL_ERROR_INVALID_DATE', 'The expiry date entered for the credit card is invalid.<br>Please check the date and try again.');
define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'The credit card number entered is invalid.<br>Please check the number and try again.');
define('TEXT_CCVAL_ERROR_UNKNOWN_CARD', 'The first four digits of the number entered are: %s<br>If that number is correct, we do not accept that type of credit card.<br>If it is wrong, please try again.');

 

The page layout can be modifyied by changing the code in protx_process.php file. It designed to only show the header so that the customer knows they are still on your site but prevent them from clicking away from the 3D-Secure box (thus reducing cart abandonment) - this is n the verified by visa implementation guidelines

 

To add a "please select" (planned for next release) edit includes/modules/payment/protx_direct.php. Find the section with:

if (MODULE_PAYMENT_PROTX_DIRECT_USE_AMEX != 'False') { $cc_type[] = array('id' => 'AMEX', 'text' => 'American Express'); }

Add the following line BEFORE THE OTHER LINES:

$cc_type[0] = array('id' =>'NOTSELECTED', 'text' => 'Please select ...');

 

I would also suggest in the same file finding

	  if (($result == false) || ($result < 1)) {
	$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&protx_direct_cc_owner=' . urlencode($HTTP_POST_VARS['protx_direct_cc_owner']) . '&protx_direct_cc_expires_month=' . $HTTP_POST_VARS['protx_direct_cc_expires_month'] . '&protx_direct_cc_expires_year=' . $HTTP_POST_VARS['protx_direct_cc_expires_year'];
	tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
  }

and inserting immediately before

	  if ($HTTP_POST_VARS['protx_direct_cc_type'] == 'NOTSELECTED') {
	$error = TEXT_CCVAL_ERROR_SELECT_CARD_TYPE;
	$result = false;
  }

 

You will then need to add the following line to includes/languages/english.php

define('TEXT_CCVAL_ERROR_SELECT_CARD_TYPE', 'Please select your card type and try again');

 

Tom

Edited by perfectpassion
Link to comment
Share on other sites

Hi,

 

I have finally got round to installing v4.4 (an upgrade from v3.2) and all seems to work as it should. There is one issue however that I'm hoping there is a solution to.

When viewing an order in the admin section there was a neat table showing Time, Payment Type, Status etc., this worked perfectly prior to the upgrade but now there are several fields missing/blank ... namely AVS/CV2 check, Address Check, Postcode, CV2 check and Status.

I have gone through everything to make sure I've followed all the necessary steps but I can't see anything obvious that I may have neglected to do.

Any ideas ?

 

John K

 

 

p.s. many thanks to you for the help and support that was given and received on this and the Protx forum through what was a very testing time ... I seriously wish there was something I could do in return.

Link to comment
Share on other sites

Hi,

 

I have finally got round to installing v4.4 (an upgrade from v3.2) and all seems to work as it should. There is one issue however that I'm hoping there is a solution to.

When viewing an order in the admin section there was a neat table showing Time, Payment Type, Status etc., this worked perfectly prior to the upgrade but now there are several fields missing/blank ... namely AVS/CV2 check, Address Check, Postcode, CV2 check and Status.

I have gone through everything to make sure I've followed all the necessary steps but I can't see anything obvious that I may have neglected to do.

Any ideas ?

 

John K

p.s. many thanks to you for the help and support that was given and received on this and the Protx forum through what was a very testing time ... I seriously wish there was something I could do in return.

 

 

You may have done it but I would suggest firstly checking the protx table in phpmyadmin against the following ensuring to change any fields that differ.

 

CREATE TABLE `protx_direct` (
 `id` int(11) unsigned NOT NULL auto_increment,
 `customer_id` int(11) NOT NULL default '0',
 `order_id` int(11) NOT NULL default '0',
 `vendortxcode` varchar(40) default NULL,
 `txtype` varchar(16) default NULL,
 `value` decimal(15,4)default NULL,
 `vpstxid` varchar(50) default NULL,
 `status` varchar(15) default NULL,
 `statusdetail` varchar(100) default NULL,
 `txauthno` varchar(10) default NULL,
 `securitykey` varchar(10) default NULL,
 `avscv2` varchar(50) default NULL,
 `address_result` varchar(20) default NULL,
 `postcode_result` varchar(20) default NULL,
 `CV2_result` varchar(20) default NULL,
 `3DSecureStatus` varchar(12) default NULL,
 `CAVV` varchar(32) default NULL,
 `txtime` timestamp NOT NULL,
 UNIQUE KEY `id` (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1;

Link to comment
Share on other sites

You may have done it but I would suggest firstly checking the protx table in phpmyadmin against the following ensuring to change any fields that differ.

 

 

 

phpmyadmin.jpg

 

 

 

the only line that I can see that differs is the 'txtime' .... is this safe to change ? and if it is what do I do?

 

thanks for helping with this .... at times my brain feels as small as a walnut

 

JK

Link to comment
Share on other sites

don't worry about the txtime.

 

Is it all transactions that are failing to have the details displayed?

 

If you set debug to true and do a test order can you post the details? (NOTE: now that 3D-secure is active you will need to leave debug to false, start the test order, once the 3D-secure iframe appears set debug to true in another browser window then submit the 3D-secure form).

 

Tom

Link to comment
Share on other sites

don't worry about the txtime.

 

Is it all transactions that are failing to have the details displayed?

 

 

Tom

 

 

 

Tom,

 

so far yes ... this is what is returned.

 

phpmyadmin2.jpg

 

I'll run a test order shortly ... I'll need to clear it with me gaffer first.

 

cheers

 

John K

Edited by pynchon
Link to comment
Share on other sites

Hi,

 

Can anybody help me with a change i need to do?

 

if ($authorised === true) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, 'protx_id='.$protx_id, 'SSL'));

} else {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=protx_direct&error=' . urlencode($error_detail), 'SSL', true, false));

}

 

I need to change this statement so that the redirect goes to a certain page dependent upon the products category..

 

Ie. "if $authorised === true 'and' $categories_id = 'xxx' goto FILENAME_CHECKOUT_PROCESS_XXX else FILENAME_CHECKOUT_PROCESS"

 

Is there an easy way to do this? is the $categories_id available to use?

 

Thanks to anyone who can shed any light on how to do this...

Edited by Mighty Mike
Link to comment
Share on other sites

something really weird has happened to my site with regards to payment. it was working perfectly fine, until i tried to change the prots system to test, which when i did, i kept getting an error saying "Please select a payment method for your order" when using the test card details in the site, so i changed back to live.

 

now whenever i try to place an order i keep getting "Please select a payment method for your order". I have made sure that the protx payment is on in admin and made sure I have entered all the details correctly on admin side (i actually did a screen capture to make sure i do all the details correct).

 

anyone any ideas please.

Link to comment
Share on other sites

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