Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Paymate Express 2.3 Contrib - Order Problem


SamyT

Recommended Posts

The PHP file for this contribution claims it supports a return URL which apparently will solve the problem of orders not being logged when a customer fails to continue back to our success page.

 

Does anyone know how add the return URL into the code? I've written to the author but had no response. The version 2.0 by Snowman appears to suffer from the same problem, also I found it not passing shipping costs into the payment (got stung once with that).

 

Has anyone out there solved this issue or know how to add a return URL into the coding without killing the contrib?

Link to comment
Share on other sites

  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

Pasting the code of the file if it helps, can anyone show how to add a return URL and make the information come back to oscommerce so the order is logged?

 

<?php
/*
 // $Id: paymate.php,v 2.0 2002/01/17

 $Id: paymate.php,v 2.3 2005/11/27

 This module was modifed and rev'd to 2.3 by Mark Edwards to provide better support for paymate.

 New features in v3.0
  * Uses POST instead of GET for better functionality
  * Supports a return URL, which streamlines payment processing
  * Supports return codes from paymate in case a payment is declined
  * Supports sort order for payment choice listings
  * No longer requires the use of the paymate graphic and separate payment window which 
 formerly depended on the user returning to the store to confirm completion of their order,
 this is all done automatically now


 The module works per paymate's spec as of Nov 27, 2005.

 Paymate dev help and testing info:
 http://www.paymate.com.au/help/help.do?helpSet=paymate&item=siteintegration

 Paymate integration info:
 http://www.paymate.com.au/help/help.do?helpSet=paymate&item=siteintegration 

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class paymate {
var $code, $title, $description, $enabled;

// class constructor
function paymate() {
  $this->code = 'paymate';
  $this->title = MODULE_PAYMENT_PAYMATE_TEXT_TITLE;
  $this->description = MODULE_PAYMENT_PAYMATE_TEXT_DESCRIPTION;
  $this->enabled = ((MODULE_PAYMENT_PAYMATE_STATUS == 'True') ? true : false);
  $this->sort_order = MODULE_PAYMENT_PAYMATE_SORT_ORDER;
  $this->form_action_url = 'https://www.paymate.com.au/PayMate/ExpressPayment';
}

// 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 $order, $currency, $currencies;
  $my_currency = $currency;


  $process_button_string = tep_draw_hidden_field('mid', MODULE_PAYMENT_PAYMATE_MID) .
tep_draw_hidden_field('popup', 'false') .
tep_draw_hidden_field('amt', number_format($order->info['total'] * $currencies->get_value($my_currency), 2) ).
tep_draw_hidden_field('amt_editable', 'N') .
tep_draw_hidden_field('ref',STORE_NAME).
tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') ) .
tep_draw_hidden_field('currency', $mycurrency) .
tep_draw_hidden_field('PMT_RECIPIENT_EMAIL', MODULE_PAYMENT_PAYMATE_ID) .
tep_draw_hidden_field('PMT_TRANSACTION_ORDERREF', time()) .
tep_draw_hidden_field('PMT_SENDER_EMAIL', $order->customer['email_address']) .
tep_draw_hidden_field('PMT_CONTACT_FIRSTNAME', $order->billing['firstname']) .
tep_draw_hidden_field('PMT_CONTACT_SURNAME', $order->billing['lastname']) .
tep_draw_hidden_field('regindi_address1', $order->billing['street_address']) .
tep_draw_hidden_field('regindi_sub', $order->billing['city']) .
tep_draw_hidden_field('regindi_pcode', $order->billing['postcode']) .
tep_draw_hidden_field('PMT_TRANSACTION_SELLERAMOUNT', number_format($order->info['total'] * 	$currencies->get_value($my_currency), 2));

return $process_button_string;

}

function before_process() {
  global $HTTP_POST_VARS;

  if ($HTTP_POST_VARS['responseCode'] == 'PD') { // declined
		tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=YOUR PAYMENT WAS DECLINED BY YOUR PAYMENT PROCESSOR. PLEASE SELECT ANOTHER PAYMENT METHOD:', 'SSL', true, false));
  }
  if ($HTTP_POST_VARS['responseCode'] == 'PA') { // approved
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, 'error_message=Your payment was approved! Thank you!', 'SSL', true, false));
  }
  if ($HTTP_POST_VARS['responseCode'] == 'PP') { // processing
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, 'error_message=Your payment is being processed. Thank you!', 'SSL', true, false));
  }

}

function after_process() {
  return false;   

}

function get_error() {
	 global $HTTP_GET_VARS;

	 $error = array('title' => 'ERROR PROCESSING YOUR PAYMENT',
					'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));

	 return $error;
}

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_PAYMATE_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 PAYMATE Module', 'MODULE_PAYMENT_PAYMATE_STATUS', 'True', 'Do you want to accept PAYMATE 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 ('Paymate ID', 'MODULE_PAYMENT_PAYMATE_MID', 'your Paymate ID', 'The merchant ID paymate assigned to you for the PAYMATE service', '6', '4', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('E-Mail Address', 'MODULE_PAYMENT_PAYMATE_ID', '[email protected]', 'The e-mail address registered for the Paymate service', '6', '5', 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_PAYMATE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");

}

function remove() {
  $keys = '';
  $keys_array = $this->keys();
  for ($i=0; $i<sizeof($keys_array); $i++) {
	$keys .= "'" . $keys_array[$i] . "',";
  }
  $keys = substr($keys, 0, -1);

  tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
}

function keys() {
  return array('MODULE_PAYMENT_PAYMATE_STATUS', 'MODULE_PAYMENT_PAYMATE_MID', 'MODULE_PAYMENT_PAYMATE_ID','MODULE_PAYMENT_PAYMATE_SORT_ORDER');
}
 }
?>

Link to comment
Share on other sites

Does anyone know where to turn when no one replies to your post here and the author of a contribution does not answer messages?

 

Any suggestions would be gratefully received.

When you open two threads, try reading both of them.

 

Mine worked without modification. Just installed it and put my PayMate email address in.

Link to comment
Share on other sites

I'm sorry, I posted asking for a mod to remove that one as it was a double post glitch - I didn't realise it was still around.

 

OK, so something is making it not work for me.. I see SSL mentioned in the code around where it has return and checkout_process.. does my store have to be using a SSL for this to work?

Link to comment
Share on other sites

Nah, I guess that's not it.

 

Coopco, are you saying your customer automatically is returned to your store and doesn't have to press continue?

No, the return is automatic AFTER pressing continue. The last paymate screen gives the opportunity to print the receipt and then press continue to confirm the order. I tested it in my test site before posting.

 

Your code looks the same as mine.

Link to comment
Share on other sites

OK.. but what happens when customers don't press continue - the payment is made, they're satisfied with that and they close the screen? This happened with the first customer who chose this module!

Link to comment
Share on other sites

OK.. but what happens when customers don't press continue - the payment is made, they're satisfied with that and they close the screen? This happened with the first customer who chose this module!

It is my impression that the transaction does not complete until the continue button is pressed. From memory, it says press continue to confirm.

Link to comment
Share on other sites

It does but it also says transaction was successful and buyers may consider it paid and over and done with. As I said, the very first customer closed the window once payment was made and I had to email them and ask what they ordered.

 

The continue button looks a lot like you click it IF you want to go back to the store you were at, which some buyers may not wish to do.. thus the problem.

Link to comment
Share on other sites

It does but it also says transaction was successful and buyers may consider it paid and over and done with. As I said, the very first customer closed the window once payment was made and I had to email them and ask what they ordered.

 

The continue button looks a lot like you click it IF you want to go back to the store you were at, which some buyers may not wish to do.. thus the problem.

Doesn't OSC work much the same way?

Link to comment
Share on other sites

What does that mean? I'm sorry, I don't understand your comment.

 

As you probably know, Pay Pal had much the same problem but a contribution was made to make sure order details were logged earlier in the transaction - yet Paymate we're stuck with a big chance the customer will end up giving us their money but not their order.

Link to comment
Share on other sites

Doesn't OSC work much the same way?

I just meant to click continue to confirm order.

 

You will need someone with php programming skills to make the required change to the paymate module.

Link to comment
Share on other sites

As you're the only person who appears to reply to posts and the author completely ignored all contact, I am at a loss with what to do.

 

FYI, the third customer to choose Paymate just sent through payment with no accompanying order - even with a BIG notice on our confirmation page telling customers they need to continue all the way back to our URL otherwise their order will not be logged.

 

How is this a satisfactory module?

Link to comment
Share on other sites

As you're the only person who appears to reply to posts and the author completely ignored all contact, I am at a loss with what to do.

 

FYI, the third customer to choose Paymate just sent through payment with no accompanying order - even with a BIG notice on our confirmation page telling customers they need to continue all the way back to our URL otherwise their order will not be logged.

 

How is this a satisfactory module?

email me

Link to comment
Share on other sites

By the way, if anyone else is still reading this, there has been no resolution here so if anyone knows how to get the order details logged by the site before the customer moves to Paymate for payment, that'd be a huge help.

Link to comment
Share on other sites

By the way, if anyone else is still reading this, there has been no resolution here so if anyone knows how to get the order details logged by the site before the customer moves to Paymate for payment, that'd be a huge help.

I think that we need a Paymate IPN module. It is beyond what I can do. Maybe the the OSC PayPal IPN team can look at it?

Link to comment
Share on other sites

I am not sure there are enough users of Paymate for them to bother :'(

I think you are right.

 

Maybe I will try to hack it in a few weeks time, but don't hold your breath. It will be a long painfull process.

Link to comment
Share on other sites

I just wish Paymate were interested in helping, instead all they do is say, speak to the person who wrote the code.. that'd be fine but the two main people who did Paymate modules do not respond to messages.

Link to comment
Share on other sites

  • 1 month later...

Yes I have been experiencing the same problem as you guys with Paymate.

My last two transaction have I discovered in my abandon cart report. Just did

a dummy transaction to see what could be causing the problem.

 

If your user doesn't click on 'continue' on the step 3 at the bottom of the page

the customer doesn't return and the order doesn't go into the order table. I

checked my customer orders refreshed then pressed continue and then refresh

and the order was there. So they must be missing the 'continue' button.

 

However your Paymate transaction goes through fine. So you get an email from

Paymate telling you about a transaction you don't really have a clue about.

 

Up until now I think I've been lucky but the last two transactions have been

as described above.

 

My php skills are hack, comment out then cut and paste so I don't think I'll volunteer

to making this contribution update.

Edited by Gamerigs
Link to comment
Share on other sites

Just been comparing code

 

This module was modifed and rev'd to 2.3 by Mark Edwards to provide better support for paymate with snowtechs 2.20

 

I found that 2.3 had this function taken out, aren't fuctions important?

 

// class methods
   function update_status() {
     global $order;

     if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYMATE_ZONE > 0) ) {
       $check_flag = false;
       $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYMATE_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
       while ($check = tep_db_fetch_array($check_query)) {
         if ($check['zone_id'] < 1) {
           $check_flag = true;
           break;
         } elseif ($check['zone_id'] == $order->billing['zone_id']) {
           $check_flag = true;
           break;
         }
       }

       if ($check_flag == false) {
         $this->enabled = false;
       }
     }
   }

   function javascript_validation() {
     return false;
   }

 

 

And this one probably less the currency stuff

 

function process_button() {
     global $order, $currencies, $currency;

     if (MODULE_PAYMENT_PAYMATE_CURRENCY == 'Selected Currency') {
       $my_currency = $currency;
     } else {
       $my_currency = substr(MODULE_PAYMENT_PAYMATE_CURRENCY, 2);
     }
     if (!in_array($my_currency, array('AUD', 'USD'))) {
       $my_currency = 'AUD';
     }

     $process_button_string = '<script language="javascript">
     														document.checkout_confirmation.onsubmit = function(){
																	var newWin = window.open(\'about:blank\', \'wizard\', \'height=580,width=500,scrollbars=1,toolbar=no\');
																	self.name = \'parent\';
																	document.checkout_confirmation.target = \'wizard\';
																	newWin.focus();
     														}
     													</script>
     													' . 
     						   tep_draw_hidden_field('mid', MODULE_PAYMENT_PAYMATE_ID) .

Link to comment
Share on other sites

Still looking for help on this one if anyone is interested.

This is not a solution, more of a way of dealing with the problem. If your install the pending order email contrib, you will get the order details when the customer goes to the checkout_confirmation page.

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