Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Protx form - not redirecting correctly


30 replies to this topic

#1 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 13 July 2007, 17:33

Hi
Please can someone help
I am using protx form, in test mode, when i have made a test payment, and it is sucessful, i get taken back to the shop index page, instead of checkout_sucess

also the cart doesnt update itself, i still have a cart, and the order isnt showing in admin

anyone, this is driving me bonkers

#2 sofaking

  • Community Member
  • 72 posts
  • Real Name:Michael Hernon
  • Gender:Male
  • Location:Scotland

Posted 13 July 2007, 17:49

View Postfernyburn, on Jul 13 2007, 06:33 PM, said:

Hi
Please can someone help
I am using protx form, in test mode, when i have made a test payment, and it is sucessful, i get taken back to the shop index page, instead of checkout_sucess

also the cart doesnt update itself, i still have a cart, and the order isnt showing in admin

anyone, this is driving me bonkers

Your not alone here.............I have the same problem.............been looking for the past 2 days.

I uploaded the fixs in the last 2 contributions, but havent found out what the problem is with this part yet.

Heres hoping a wizard comes along to help us out

#3 sofaking

  • Community Member
  • 72 posts
  • Real Name:Michael Hernon
  • Gender:Male
  • Location:Scotland

Posted 13 July 2007, 18:15

Can someone explain why the Success and Failure URL are the same?

I have run a decrypt and the info sent to PROTX is

SuccessURL=http://www.mysite.com/catalog/checkout_process.php?osCsid=b2e7809e534650f850763bfcf250cf13
FailureURL=http://www.mysite.com/catalog/checkout_process.php?osCsid=b2e7809e534650f850763bfcf250cf13

Also in protx VSPAdmin area has received the session ids above and displays them

It must be when the customer is returned to my site that something goes wrong.....as the end of the address is
http://www.mysite.com/catalog/checkout_pay...;error_message=

and they are returned to the checkout_payment screen.

Anyone out there any ideas?

Cheers,

Michael.

#4 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 13 July 2007, 18:43

aaahha
so its not just me then

i have noticed that the 2 urls are the same, and have even changed them to
filename_checkout_success, which works, but it doesnt update the cart, or put an order in admin

I have gone back a few years on the module, and the urls are the same,

I thought it was because i was running fast easy checkout, but all other modules work fine


the problem i have

in test mode
enter the credit card details, it connect to the test bank, and then redirects me to shop/index.php
and my cart still shows my order.
also the order isn't in admin.
it isn't a problem with the site, as i use paypal, netbanx, nochex, fax all without problems

definatly something with the sessions i think.... but what ????


forgot to add, i get the confirmation emails from protx

Edited by fernyburn, 13 July 2007, 18:44.


#5 sofaking

  • Community Member
  • 72 posts
  • Real Name:Michael Hernon
  • Gender:Male
  • Location:Scotland

Posted 13 July 2007, 19:15

Yip, its all exactly the same for me.....and as you described it.

I assume that the successURL and failureURL are actually supposed to tell the cart something.

Apparently from what I have read, it is contained within the encrypted string that protx sends back to our sites.

keeping the sessionID at the end (osCsid=b2e7809e534650f850763bfcf250cf13)
ie, from
checkout_shipping.php?osCsid=b2.... ----> onto
checkout_payment.php?osCsid=b2.... ----> onto
checkout_confirmation.php?osCsid=b2.... ----> onto
checkout_process.php?osCsid=b2.... ----> onto ---->

from here it sends you off to protx with all the important stuff encrypted......go through protx then it must send encrypted stuff back to the checkout_process with either "SUCCESS or FAIL" stored in it or something like that........

checkout_process.php?osCsid=b2....

then the cart moves onto either our checkout_success.php page or somewhere else. depending on what the "un encoded" message tells it what to do.

I think it must either be the code from protx or more than likely how our carts are interperating the code it has been sent to de-code.

#6 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 13 July 2007, 19:20

well i have just installed the protx form from around 2005, and i got the same error
so its not the form....

i have just tried to get some paid help, cos i want this system live asap

#7 sofaking

  • Community Member
  • 72 posts
  • Real Name:Michael Hernon
  • Gender:Male
  • Location:Scotland

Posted 13 July 2007, 19:42

I installed all of them!!!

and still had the same problem.....taking money okay........telling cart that it had not okay.

I have noticed that the integration test server says it is
https://ukvpstest.protx.com/vspgateway/serv...rm-register.vsp

but the protx_form.php says it is
https://ukvpstest.protx.com/vps2form/submit.asp

I have asked on here about it............I might be confusing myself after reading through about 40threads

#8 GemRock

  • Community Member
  • 2,069 posts
  • Real Name:Ken
  • Gender:Male
  • Location:UK

Posted 13 July 2007, 20:43

1. protx is under gone some system upgrade/changes recently/around this time. so you first call should be contacting them to see if there's anything that may be causing the problem;

2. The most reliable version, in my experience (up to quite recently), is mike jackson's v1.09 released on 21/10/2005. any versions posted after that should be ignored, unless you know what you are doing, ie, you read through the code and understand what and why are the changes. one example, why on earth this line
$this->description = MODULE_PAYMENT_PROTX_FORM_TEXT_DESCRIPTION;
was chnaged to (according to sofaking):
$this->description = MODULE_PAYMENT_PROTX_FORM_TEXT_PICTURE;
i suspect someone may just post something that only applies to their specific site as a general contrib.
Ken

Edited by GemRock, 13 July 2007, 20:45.

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.

#9 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 13 July 2007, 21:22

this has to be a protx problem

i have just reinstalled mike jackson's v1.09 released on 21/10/2005
and the same problem happens, the system goes, payment .... connecting to bank....
straight to /shop/index.php

i have also put it on a fresh install
and it still doesnt work]

protx have been emailed, but have replied that its oscommerce problem not theirs
im rapidly losing faith
no phone support is totally rubbish

#10 GemRock

  • Community Member
  • 2,069 posts
  • Real Name:Ken
  • Gender:Male
  • Location:UK

Posted 13 July 2007, 22:05

I'd have stated that your site is also an important factor, ie, any modification you may have made to your site.
Reason why I said v1.09 was the most reliable is because that's the only version I use all the time and everytime, and it always works on a number of osc sites, except that it has an issue with gift voucher purchase (missing delivery address error on protx server but that's not entirely its fault and that can be easily fixed.
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.

#11 sofaking

  • Community Member
  • 72 posts
  • Real Name:Michael Hernon
  • Gender:Male
  • Location:Scotland

Posted 13 July 2007, 22:54

Could it have something to do with the "StatusDetail" or the "error message="

This is the section of code I am looking at..

 function before_process() {
      global $HTTP_POST_VARS, $crypt;
	  $crypt = $_REQUEST['crypt'];
	  $process_button_string = str_replace(" ", "+", $process_button_string);
 
      $Decoded = $this->SimpleXor(base64_decode(str_replace (" ", "+", $crypt)),MODULE_PAYMENT_PROTX_FORM_PASSWORD);
      $values = $this->getToken($Decoded);

      $Status = $values['Status'];
      $StatusDetail = $values['StatusDetail'];

      if ($Status != 'OK') {
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()] . '&error_message=' . urlencode($StatusDetail), 'SSL', false, false));
      }
    }

Can you say if the HTTP_POST_VARS and HTTP_GET_VARS are in the right places?

Also the last section of this

 if ($Status != 'OK') {
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()] . '&error_message=' . urlencode($StatusDetail), 'SSL', false, false));
      }
    }

As I am sending the sessionID to them, they are recieving it, and they are sending it back to me.......

what does the ". '&error_message=' . urlencode($StatusDetail), 'SSL', false, false));" bit do?

Cheers,

Michael

#12 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 14 July 2007, 07:47

View PostGemRock, on Jul 13 2007, 11:05 PM, said:

I'd have stated that your site is also an important factor, ie, any modification you may have made to your site.
Reason why I said v1.09 was the most reliable is because that's the only version I use all the time and everytime, and it always works on a number of osc sites, except that it has an issue with gift voucher purchase (missing delivery address error on protx server but that's not entirely its fault and that can be easily fixed.
Ken


this is why i installed 1.09 on a clean os commerce
and it still redirects rong - back - index.php - i dont get any errors showing

#13 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 14 July 2007, 14:12

just to let you know
i spoke to protx and they are adament nothing is wrong at there end

#14 sofaking

  • Community Member
  • 72 posts
  • Real Name:Michael Hernon
  • Gender:Male
  • Location:Scotland

Posted 14 July 2007, 14:50

Somethings got to be wrong somewhere!!! :'(

Have you logged into VSPAdmin and looked to check if your session ID is the same as the test id you are doing?

I now have =error message&osCid...... at the end of my url's

Could it be this part? Line251

        if ($Status != 'OK') {
        $sessionName = tep_session_name();
        $sessionId = $HTTP_GET_VARS[$sessionName];
        $hrefLink = tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $sessionId . '&error_message=' . urlencode($StatusDetail), 'SSL', false, false);
        tep_redirect( $hrefLink );
      }
    }

Why if
$Status !='OK'

does the

$hrefLink = (have the '&error_message=" bit in it?)

should it not be something like
if ($Status != 'OK') {
$sessionName = tep_session_name();
$sessionId = $HTTP_GET_VARS[$sessionName];
$hrefLink = tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $sessionId)
tep_redirect( $hrefLink );

if its not OK then - error message-------------------------
$hrefLink = tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $sessionId . '&error_message=' . urlencode($StatusDetail), 'SSL', false, false);
tep_redirect( $hrefLink );
}
}

#15 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 14 July 2007, 17:27

Quote

Have you logged into VSPAdmin and looked to check if your session ID is the same as the test id you are doing?

how do i do this

also - what php version are you running

#16 sofaking

  • Community Member
  • 72 posts
  • Real Name:Michael Hernon
  • Gender:Male
  • Location:Scotland

Posted 14 July 2007, 18:32

View Postfernyburn, on Jul 14 2007, 06:27 PM, said:

how do i do this

also - what php version are you running


Apparently I am running - according to the "server info" section in the oscommerce admin - 4.3.10 (Zend: 1.3.0)
according to my hosting company it is 4.3.10 and 5.0.2

The VSPAdmin (the protx admin) is here - https://ukvpstest.protx.com/vspadmin/
it lets you see all your transactions that you have processed. including what checks the cards passed, the order details, and the successURL and failureURL that it has on record.

#17 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 14 July 2007, 18:47

the success and failure url
show

Success URL: http://www.*****.co.uk/shop/checkout_process.php
Failure URL: http://www.*****.co.uk/shop/checkout_process.php

is theree supposed to be anything after it ?
because there isnt - just those urls ?

#18 sofaking

  • Community Member
  • 72 posts
  • Real Name:Michael Hernon
  • Gender:Male
  • Location:Scotland

Posted 14 July 2007, 19:50

View Postfernyburn, on Jul 14 2007, 07:47 PM, said:

the success and failure url
show

Success URL: http://www.*****.co.uk/shop/checkout_process.php
Failure URL: http://www.*****.co.uk/shop/checkout_process.php

is theree supposed to be anything after it ?
because there isnt - just those urls ?

the sessionid should be after that.......I assume you are looking in VSPAdmin in the Transaction details part?

So they should look like
http://www.*****.co.uk/shop/checkout_proce...xxxblah13r13f1c
exaclty the same for both success and failure.


I have found out that the ($Status !='OK') means "if protx says there is no error (!=) then the order is OK" - ie go to checkout_success
but if you change it to ($Status =='OK') this means that "if protx says there IS an error(==) then the order is OK - ie go to checkout_success.

osCommerce is reading whatever protx sends back to us as an error all the time by the looks of it. - I am looking into the Register Globals problem

#19 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 14 July 2007, 20:32

I have globals turned on

#20 fernyburn

  • Community Member
  • 139 posts
  • Real Name:Ronnie

Posted 15 July 2007, 12:35

I have a fix !!

apparently - a C has been changed at Protxs end - making crypt - become Crypt

to make changes on the latest protx contribution

http://www.oscommerce.com/community/contri...ll/search,protx

simply change

line 230 tep_draw_hidden_field('crypt', $crypt);

to tep_draw_hidden_field('Crypt', $crypt);



and line 239 $crypt = $_REQUEST['crypt'];

to $crypt = $_REQUEST['Crypt'];


and this makes it work