Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

[Contribution] Protx Direct v5 Support Thread


  • You cannot reply to this topic
152 replies to this topic

#141 ciDfenmaria

  • Community Member
  • 12 posts
  • Real Name:Gang

Posted 26 January 2010, 15:58

View Poststubbsy, on 24 January 2010, 09:47, said:

It hadn't happened to me all week and then a customer on Friday had his money taken 5 times before he phoned up! This time though it wasn't 3d secure but it was still a visa transaction.

The frequency of it may have slowed down a bit this end as the number of orders we're getting is around 50% down on December.

Hopefully your debug will throw something up. Do you want to post the code you added and I'll stick it on at this end too?


The function do_curl() in protx_direct.php send the order details to sagepay and get returned responses. After the original code
$response = curl_exec($ch);
$curl_error = curl_error($ch);
curl_close($ch);

you could put the following code to track the $responses, So you would track the response from sagepay for every transaction (every hit of the confirm button):

//
$trackresponse = "\n\n" . print_r($responses,true);
mail('yourmail@hotmail.com', '', $trackresponse);
//

It happened to a few orders this morning, where a customer failed several times in putting a transaction through (by getting following responses):
$responses['Status']=NOTAUTHED
$responses['StatusDetail'] => 2000 : The Authorisation was Declined by the bank.

which is fine actually. But after that one of these failed transaction got empty response from sagepay. (where the $responses array is empty) and it's not recorded in the sagepay admin either.
That's what I've got so far & still waiting to see the debug response details for a duplicate transaction.

#142 stubbsy

  • Community Member
  • 539 posts
  • Real Name:dave stubbs
  • Gender:Male
  • Location:Lyme Regis

Posted 27 January 2010, 12:06

View PostciDfenmaria, on 26 January 2010, 15:58, said:

The function do_curl() in protx_direct.php send the order details to sagepay and get returned responses. After the original code
$response = curl_exec($ch);
$curl_error = curl_error($ch);
curl_close($ch);

you could put the following code to track the $responses, So you would track the response from sagepay for every transaction (every hit of the confirm button):

//
$trackresponse = "\n\n" . print_r($responses,true);
mail('yourmail@hotmail.com', '', $trackresponse);
//

It happened to a few orders this morning, where a customer failed several times in putting a transaction through (by getting following responses):
$responses['Status']=NOTAUTHED
$responses['StatusDetail'] => 2000 : The Authorisation was Declined by the bank.

which is fine actually. But after that one of these failed transaction got empty response from sagepay. (where the $responses array is empty) and it's not recorded in the sagepay admin either.
That's what I've got so far & still waiting to see the debug response details for a duplicate transaction.

Thanks I'll take a look at that.

Strangely I've had 2 people phone today who have had the problem and these 2 were Mastercard!

Dave

#143 ciDfenmaria

  • Community Member
  • 12 posts
  • Real Name:Gang

Posted 02 February 2010, 12:03

The thread is quiet... Is there any other thread for protx direct too. Have this happened to anyone else as well?

Hi dave, I've got a double charged yesterday and the first transaction(attempt) got an empty response from sagepay. I haven't got a clue why it's getting the empty response (or even whether sagepay had the request)

For some reason this happened once a week rather than once a day previously. Are you getting empty response, similar result?

#144 stubbsy

  • Community Member
  • 539 posts
  • Real Name:dave stubbs
  • Gender:Male
  • Location:Lyme Regis

Posted 09 February 2010, 12:28

Hi,

sorry I've been busy for a while.

I've just added the code to be sent the emails, I'm getting quite a few at the moment so it won't be long before I get some data together.

Recently it happened on maestro and mastercard so not sure what has changed.

I'll keep you posted.

Cheers

Dave

#145 stubbsy

  • Community Member
  • 539 posts
  • Real Name:dave stubbs
  • Gender:Male
  • Location:Lyme Regis

Posted 09 February 2010, 15:17

The first 2 emails I've had through have been completely blank. Am I missing something?

#146 ciDfenmaria

  • Community Member
  • 12 posts
  • Real Name:Gang

Posted 10 February 2010, 10:17

Are those 2 payment request successful or is there any record accordingly in the Sagepay VSP?

View Poststubbsy, on 09 February 2010, 15:17, said:

The first 2 emails I've had through have been completely blank. Am I missing something?


#147 stubbsy

  • Community Member
  • 539 posts
  • Real Name:dave stubbs
  • Gender:Male
  • Location:Lyme Regis

Posted 10 February 2010, 12:56

View PostciDfenmaria, on 10 February 2010, 10:17, said:

Are those 2 payment request successful or is there any record accordingly in the Sagepay VSP?

I've had 40 or so orders and 40 or so emails but they're all blank.

I don't know yet if any of them were unsuccessful.

#148 ciDfenmaria

  • Community Member
  • 12 posts
  • Real Name:Gang

Posted 15 February 2010, 14:47

For the double charge(start_transaction() executed twice) I am still not sure why that happens but Temporarily I come up with a solution:

in protx_prcess.php look for '$response = $GLOBALS['protx_direct']->start_transaction();' added just before:

$last_order_id_query = tep_db_query("SHOW TABLE STATUS from `" . DB_DATABASE . "` like '" . TABLE_ORDERS . "'");
$last_order_id = tep_db_fetch_array($last_order_id_query);
$new_order_id = $last_order_id['Auto_increment'];

$sagepay_local_query = tep_db_query("select * from " . TABLE_PROTX_DIRECT . " where customer_id='". (int)$customer_id . "' order by txtime desc");
if (tep_db_num_rows($sagepay_local_query)>0) {
$sagepay_local = tep_db_fetch_array($sagepay_local_query);
if ($sagepay_local['customer_id']==$customer_id && $sagepay_local['order_id']==$new_order_id_1 && $sagepay_local['status']=='OK') {
echo '<script type="text/javascript">window.location.href="'.tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL').'";</script>';
tep_exit();
}
}


Also, during testing I think the following change of code works better in protx_direct.php. look for code for sending payment request (from SagePay addon Direct http://addons.oscommerce.com/info/6985)
function do_curl($data, $url) {
$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, 90);

if (MODULE_PAYMENT_PROTX_DIRECT_CURL_SSL == '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);

change to :

function do_curl($data, $url){
$server = parse_url($url);

if (isset($server['port']) === false) {
$server['port'] = ($server['scheme'] == 'https') ? 443 : 80;
}

if (isset($server['path']) === false) {
$server['path'] = '/';
}

if (isset($server['user']) && isset($server['pass'])) {
$header[] = 'Authorization: Basic ' . base64_encode($server['user'] . ':' . $server['pass']);
}

if (function_exists('curl_init')) {
$ch = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : ''));
curl_setopt($ch, CURLOPT_PORT, $server['port']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

if (MODULE_PAYMENT_PROTX_DIRECT_CURL_SSL == '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);
} else {
exec(escapeshellarg(MODULE_PAYMENT_PROTX_DIRECT_CURL_SSL) . ' -d ' . escapeshellarg($data) . ' "' . $server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '') . '" -P ' . $server['port'] . ' -k', $result);
$response = implode("\n", $result);
}


So far I am still not sure what cause the empty responses for request (returned MODULE_PAYMENT_PROTX_DIRECT_TEXT_PROTX_ERROR from protx_direct.php interpreteResponse()) where customer need to re hit the confirm button.

Really appreciated if someone can spot any pitfalls of the changes above or any other suggestion.

#149 stubbsy

  • Community Member
  • 539 posts
  • Real Name:dave stubbs
  • Gender:Male
  • Location:Lyme Regis

Posted 18 February 2010, 10:46

Hi Gang,

i've added the code this morning so we'll see what happens.

Btw I've never got the email results to work. every email I receive is blank??

#150 ciDfenmaria

  • Community Member
  • 12 posts
  • Real Name:Gang

Posted 22 February 2010, 09:42

View Poststubbsy, on 18 February 2010, 10:46, said:

Hi Gang,

i've added the code this morning so we'll see what happens.

Btw I've never got the email results to work. every email I receive is blank??

In your debug email did you put in the correct response array? check that, and Normally there is no way the customer can proceed the transaction by getting a blank response, in which case the customer will see something like: 'Unfortunately there has been a technical problem. Please try again and if the problem persists please contact us.' and stuck on the confirmation page.

By the way so far I manage to avoid the double charged problem(frequency once a week), and got a debug email every time that happen. see the code I mentioned above. Still not knowing the cause though...And recently I am too busy to investigate more.

#151 IVMark

  • Community Member
  • 4 posts
  • Real Name:Mark Morris

Posted 29 September 2010, 10:27

I'm running a somewhat customized version of OSC 2.2 RC2. I've been struggling with the Protx URL changes and thought I'd upgrade to a new payment module to iron out any other bugs that may have existed. My problem is that when I get to protx_process_win it just sits there with a moving bar in the middle of the screen and a link to close the window. I don't see a 3D S window or anything similar. I've tried in Chrome and Firefox in case it was a browser / java problem (I'm on a mac if that makes a difference), but no joy. I've read through this thread and seen some talk about a curl ssl option, but I don't have that in my configuration page in the admin area. I've tried turning debug on, but I just get the same problem. Are there any other ideas?

#152 darrenultra

  • Community Member
  • 53 posts
  • Real Name:Nick
  • Gender:Male

Posted 28 October 2010, 15:23

Hey guys,

Just wondering if anyone has updated the module such that it has the Paypal Mark integration yet? I'd do it myself if I wasn't so darn stupid.

#153 sajuk

  • Community Member
  • 3 posts
  • Real Name:saj

Posted 17 January 2012, 11:50

Hi,

I have got this issue as well, with duplicate orders showing in the admin, somtimes i get duplicate payments but most of the time i get duplicate orders showing but only one actual payment taken, via protx, is there any fix for this or any grade to the protx payment module, funny thing its only just started about 2 weeks ago..? before this it was fine, never made any changes to the site whatsoever,,

Any help would be good.

Thanks