Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008
    Posts
    6
    Plugin Contributions
    0

    Default Payment module creating 2 orders

    I have created a payment module based on a combination of paypal and nochex. It's for a french (CiC) payment gateway that uses a predetermined callback to notify my site whenever a card is accepted or declined.

    The callback aspect works fine and, just like the paypal module I recreate the session and create the order when the callback indicates a good transaction.

    The problem I'm having is that, after completing payment, when the customer clicks on the "return" link that brings them back to checkout_process (same setting as paypal ipn uses) a second order is generated with the same details.

    I've tried a number of different things in the before_process() function of my payment module to prevent the second order being created but keep ending up with an empty page if I do that. With nothing in the before_process() function the user is correctly redirected to the checkout_success and given a new number.

    I've spent hours scanning the paypal and nochex code for a clue but I can't see anything those modules do that mine isn't doing....

    Any ideas... ?

  2. #2
    Join Date
    Jul 2008
    Posts
    6
    Plugin Contributions
    0

    Default Re: Payment module creating 2 orders

    Never mind, figured it out in the end - I had a syntax error in the before_process() function, hence the empty page when I returned to it.

    In case it helps anyone else, the following clears the basket etc...

    function before_process() {
    global $order_total_modules;
    // referer is added to the return url during the process_button step
    if (isset($_GET['referer']) && $_GET['referer'] == 'creditmutuel') {
    $_SESSION['cart']->reset(true);
    unset($_SESSION['sendto']);
    unset($_SESSION['billto']);
    unset($_SESSION['shipping']);
    unset($_SESSION['payment']);
    unset($_SESSION['comments']);
    unset($_SESSION['cot_gv']);
    $order_total_modules->clear_posts();
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
    } else {
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    }
    }

  3. #3
    Join Date
    Jul 2006
    Location
    Cardiff, Wales
    Posts
    305
    Plugin Contributions
    0

    Default Re: Payment module creating 2 orders

    Hi davew

    I am working on a payment module also... I just wondered how did you "recreate the session"?

    I just cant get this to work. I have zenid being sent in the callback POST but dont know how to create the session.

    Thanks

 

 

Similar Threads

  1. v151 Creating Payment Module Logo
    By cryptoreporter in forum Addon Payment Modules
    Replies: 3
    Last Post: 19 Oct 2014, 03:12 PM
  2. Creating an Addon Payment module
    By algae in forum Addon Payment Modules
    Replies: 1
    Last Post: 9 Sep 2011, 07:28 PM
  3. Creating New Payment Module
    By The One in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 12 Jun 2009, 05:07 PM
  4. Creating a new payment module...
    By tehbadseed in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 14 Feb 2008, 01:51 AM
  5. Orders not showing in admin orders module - using Setcom SA payment module
    By brucehere in forum Managing Customers and Orders
    Replies: 7
    Last Post: 16 Nov 2007, 02:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR