PDA

View Full Version : Payment Module Postback URL/Return URL???



DM420
09-09-2005, 07:59 PM
Hi Everyone,

I'm having problems coming up with a definite answer as to what the postback/return URL is in osCommerce for 3rd party payment processors that sends back response codes once a payment has been approved/declined is?

I'm using a local 3rd party payement processor called Moneris and have a custom payment module for osCommerce.

Everything works fine as I go through the check up process upto the point where you confirm the order on checkout_confirmation.php. The process button posts the form correctly to the payment processor and I get an approved transaction.

I am then re-directed to the postback/return URL which i set to many different things with no luck.

I have tried setting it to checkout_success.php with and without passing the "osCsid" value. (i.e. http://www.domain.com/catalog/checkout_success.php?osCsid=d4e5xxxxxxxxxxx). . To achieve this i either specify checkout_success.php directly which results in no osCsid getting passed or by creating a file called similar to the code below which contains:



<?php
$session_id = $HTTP_POST_VARS['rvarsessionid'];
include('includes/application_top.php');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCE SS, 'osCsid=' . $session_id , 'SSL', false, false));
?>


The "rvarsessionid" variable here is a custom field that is posted back to my script. It contains the osCsid value which I send to the payment processor during the inital transaction. I do realize that in the above code it redirects to FILENAME_CHECKOUT_PROCESS which is checkout_process.php but I have tried it with checkout_success.php as well.

I have also tried setting it to checkout_process.php, also with or without the osCsid passed via GET as above.

Either of these ways is not successful. If I don't pass in osCsid to the PHP pages then osCommerce thinks i'm not logged in. If I do pass it in, osCommerce takes me back to checkout_payment.php with an error in the URL stating he CC # was declined. How it knows it is declined is beyond me, since it is valid.

I want to clear up once and for all where I should get the payment processor to redirect to.

Obviously, I could redirect to an approve/decline HTML page but it seems that unless I complete the check out process, the order doesn't get recorded and the customer still has the product in their shopping cart.

Any ideas would be greatly appreciated. I can post more info as needed.

My config is as follows:

osCommerce 2.2-MS2 (no additional modules except for the payment one)
Fedora Core 3
Apache 2.0.52
Mysql 3.23.58
curl 7.12.1
PHP 4.3.9

Thanks in advance

DM