Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2008
    Posts
    63
    Plugin Contributions
    0

    Default set order status to processing after capture (AIM)

    This question applies for both the Authorize.net (AIM) module as well as the PayPal Express Checkout module. In each I am using the Authorize only method. I capture the funds after I've prepared it for shipment.

    I use this little edit from DrByte for capturing:
    http://www.zen-cart.com/forum/showthread.php?t=111898

    As I have it now, the order status is set to "Pending" after the customer places the order. To save myself some clicks, I would like the order status to be set automatically to "Processing" when I click the capture button and the funds are collected.

    I'm using the latest version of Zen Cart 1.3.8a.
    Thank you.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: set order status to processing after capture

    The Express Checkout module should already set it to Processing automatically after capturing, if you've got that status properly selected in your Express Checkout module settings.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jul 2008
    Posts
    63
    Plugin Contributions
    0

    Default Re: set order status to processing after capture

    Thanks for your help DrByte. It's funny, after searching the forums for many months on various issues, I feel honored that you have taken the time to help me.

    For the Paypal Express Checkout, I now have the following settings:
    Set Order Status
    Processing [2]
    Set Unpaid Order Status
    Pending [1]

    Originally, I had the first one also set to Pending [1].
    I haven't tested yet whether or not this results in the behavior I'm looking for, but I'll post back with my results.

    For Authorize.net (AIM), there are only these two options (along with my current settings):
    Set Completed Order Status
    Pending [1]
    Set Refunded Order Status
    Pending [1]

    There does not seem to be a setting for order status for Unpaid Orders and another one for captured orders.
    The behavior I'm looking for is this:
    when an order comes in, the payment is authorized but not captured, and the order status is set to pending.
    when I review the order and capture the funds, it automatically sets to processing.

    Is there an edit I can apply that will give this behavior? I'm not shy about editing php files.

    Thanks again for the help.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: set order status to processing after capture

    If you edit your /includes/modules/payment/authorizenet_aim.php file, around line 379 you can insert an additional line as shown here:
    Code:
        // If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message
        if ($response_code != '1') {
          $messageStack->add_session('checkout_payment', $response_msg_to_customer . ' - ' . MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_DECLINED_MESSAGE, 'error');
          zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
        }
        if (MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE == 'Authorize') $this->order_status = 1;
      }
      /**
       * Post-process activities. Updates the order-status history data with the auth code from the transaction.
    And then set the Completed Order Status to Processing[2].
    Thus when an order is placed it'll be forced to 1 (by the code change) and when you capture manually it'll be set to 2 (based on your selection from the pulldown in the module settings) for the Completed Order.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jul 2008
    Posts
    63
    Plugin Contributions
    0

    Default Re: set order status to processing after capture (AIM)

    Thank you for the help DrByte.
    I made the change to the php file and also changed:
    Set Completed Order Status
    Processing [2]

    But the change to the php file does not seem to have made a difference. When the orders come in, before capture, they have the status of Processing [2].

    I really don't know the code, so I'll just throw out some humble possibilities:
    Is the new line inserted in the wrong place?
    Should it come in the post-process activities section?

    Thanks.

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

    Default Re: set order status to processing after capture (AIM)

    Hello again,
    I have some more information that I did not notice before.
    In the list of orders, the orders have the status - processing.

    But when I go to edit the order and examine the status history it shows the first line as processing, then the authorization line (second line) as pending. Yet is shows up on the order listing as processing.

    I've attached a picture to show an example of the status history.
    Thanks.
    Attached Images Attached Images  

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: set order status to processing after capture (AIM)

    Hmmm ... I've given you the wrong place to put that new line of code.
    Move it to approx line 100 instead:
    Code:
        $this->order_status = (int)DEFAULT_ORDERS_STATUS_ID;
        if ((int)MODULE_PAYMENT_AUTHORIZENET_AIM_ORDER_STATUS_ID > 0) {
          $this->order_status = (int)MODULE_PAYMENT_AUTHORIZENET_AIM_ORDER_STATUS_ID;
        }
        // Reset order status to pending if capture pending:
        if (MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE == 'Authorize') $this->order_status = 1;
        
        $this->_logDir = DIR_FS_SQL_CACHE;
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jul 2008
    Posts
    63
    Plugin Contributions
    0

    Default Re: set order status to processing after capture (AIM)

    Thank you DrByte!
    That worked perfectly!

 

 

Similar Threads

  1. Order status changes after batch capture on PayPal website
    By Three Sisters in forum PayPal Express Checkout support
    Replies: 21
    Last Post: 10 Mar 2017, 11:55 AM
  2. Replies: 0
    Last Post: 8 Oct 2014, 10:31 PM
  3. Wrong order status set after PayPal payment received
    By flix in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 6 Nov 2012, 06:11 PM
  4. Paypal - Order Status - Processing
    By raymonster in forum PayPal Express Checkout support
    Replies: 10
    Last Post: 10 Jul 2009, 03:28 PM
  5. Google Checkout processing status after order is charged
    By NaturalEnquirer in forum Addon Payment Modules
    Replies: 2
    Last Post: 25 Feb 2009, 09:24 PM

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