Jump to content


  • Content count

  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
  • Gender

Recent Profile Visitors

951 profile views
  1. pemac

    DPS not redirecting to checkout_success.php

    Yes, have an unproven fix. Has taken weeks off and on part-time to locate where this issue actually lay. Worked OK on my localhost site testing (substituted some locally written code for DPS side of the house), but failed miserably on client's live site when using trying to purchase item. Customer keeps getting logged off upon a successful purchase, but client website owner has no idea about a new order till a grumpy customers rings up. Or wonders about those extra dollars in his bank account. Version 1.5 of addons (at http://addons.oscommerce.com/category?search=pxpay) still exhibits same issue. Customer proceeds to checkout, eventually gets to DPS and successfully completes card transaction. Customer gets sent email and is logged off. No order is ever created in the website database and the website owner is not emailed about the new order. Why was the burning question. Followed through the process ins and out of the add on code, with error logging after each line of code, from checkout_process.php, but particularly in /includes/modules/payment/dps_pxpay.php. Found that the $_SESSION['customer_id'] was non-existent after the first request for access to DPS. So when it gets to the end of transacting with DPS, it checks 'are we still logged in?' and says since $_SESSION['customer_id'] was null, log in again. At this point the customer is mostly happy, he's had a successful card transaction with DPS, has been emailed, is eagerly awaiting arrival of the product, but has been logged off. Not good marketing for your products. The next step should have been create the order in the database, email the website owner and return the customer to a success page, but unfortunately the add on logs the customer off. To me, the problem was in the _processPxPayresponse() function with it's lack of Customer ID. Where to get the Customer ID after all the DPS redirects? Those sessions have long gone. I found the Merchant Reference (available near the end of this function) contains a unique string made up of the Customer ID, a hyphen and a random number. The DPS transactions have had this Merchant Reference with Customer ID available since the first request for access to DPS in the _processPxPay() function. Easy fix, right after building the message for the email to the customer, grab the Merchant Reference, strip everything to the left of the hyphen to use as the Customer ID and use it to re-populate the $_SESSION['customer_id']. Seems to work OK, customer finally gets to the checkout Success page without being logged off. Also owner gets an order entry in website db and the advisory email about the new order. Code I used to follow hopefully later today, ideal will be to write a version 1.6 of the add on. Hope this helps.