Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / set order status to processing after capture (AIM)

set order status to processing after capture (AIM)

Locked

Views: 2,703

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
21 Aug 2009, 8:45 PM
#1
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

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.

21 Aug 2009, 11:58 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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

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.

24 Aug 2009, 6:07 PM
#3
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

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

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.

24 Aug 2009, 6:21 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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

If you edit your /includes/modules/payment/authorizenet_aim.php file, around line 379 you can insert an additional line as shown here: ```
// 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));
}
[B] if (MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE == 'Authorize') $this->order_status = 1;
[/B] }
/**

  • Post-process activities. Updates the order-status history data with the auth code from the transaction.
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.
25 Aug 2009, 7:28 PM
#5
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

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.

25 Aug 2009, 8:47 PM
#6
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

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.

25 Aug 2009, 9:45 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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:```
$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;
}
[B][B] // Reset order status to pending if capture pending:
if (MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE == 'Authorize') $this->order_status = 1;
[/B]
[/B]
$this->_logDir = DIR_FS_SQL_CACHE;

27 Aug 2009, 12:54 AM
#8
patternman avatar

patternman

New Zenner

Join Date:
Jul 2008
Posts:
63
Plugin Contributions:
0

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

Thank you DrByte!
That worked perfectly!