TaxCloud API Call on "Confirmed" not Trigged

  • Posts: 238
  • Thank you received: 21
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
8 years 10 months ago #225025

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.7
-- PHP version -- : 5.6.13
-- Browser(s) name and version -- : any

What I've found is if your payment method sets an order status to "confirmed" (by-passing created) then it will not trigger the API calls to TaxCloud to confirm an order.

Even if I switch the status to "shipped" it won't make the API calls.

However if you set the status back to "created" and then set it to "confirmed" it will trigger the API calls to TaxCloud correctly.

I've tested this with a few payment methods but the key one of note I've found was Authorize.net when it is set to "instant capture" payment. Another person I know I believe is happening with PayPal too.

I've never noticed it before as I've never had this exact setup needed until now.

I suppose a work around for now is to set the Verified Status to go to "created".
Then the site owner/manger would have to switch to "confirmed" to trigger the API call.
I think that might cause other confusion with various email and other things that trigger.

Or just do as I described above per order (which is going to get old quickly).

I'm thinking bug and not a design choice.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 10 months ago #225030

Hi,

Thank you for your feedback.
I don't think that the problem is with the instant capture setting, but that it is with the API mode you're using.
If you're using the AIM mode, then the order is directly confirmed at the creation of the order and thus the order status isn't changed to confirmed as an update but directly set at the creation of the order.
And looking at the code of the TaxCloud plugin, that's indeed not taken into account.
But I can't see how this could happen with the PayPal plugin since it cannot create orders already confirmed at the creation. So I suppose that this is not related.

To fix that, try adding the code:

//for newly CONFIRMED ORDERS, call to AuthorizedWithCaptured
		if(!empty($order->order_status)){
			//getting the confirmed/cancelled statuses
			$config =& hikashop_config();
			$confirmed_statuses = explode(',', trim($config->get('invoice_order_statuses','confirmed,shipped'), ','));
			if(empty($confirmed_statuses))
				$confirmed_statuses = array('confirmed','shipped');
			
			if(in_array($order->order_status,$confirmed_statuses) && !in_array($order->old->order_status,$confirmed_statuses)){//if the actual status is confirmed and the old status wasn't confirmed
				$this->AuthorizedWithCaptured($order);
				return;
			}
		}
after the code:
$this->lookupAfterOrderCreate($order);
in the file plugins/hikashop/taxcloud/taxcloud.php

The following user(s) said Thank You: jazzmang

Please Log in or Create an account to join the conversation.

  • Posts: 238
  • Thank you received: 21
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
8 years 10 months ago #225063

I believe if you set the pending state to be "confirmed" vs. "created" with any payment method. it will cause this.

That is what my friend was seeing with PayPal and what lead me to look into this.
She tried my trick of switching status after an order from "confirmed" to "created" then back to "confirmed" (which worked).

Obviously not the default configuration, but I've done that on at least one other site (but it doesn't use/need TaxCloud).

I'll try this out on my test install first and let you know if I have any problems still.

Thanks again and don't work on holiday!

Please Log in or Create an account to join the conversation.

  • Posts: 238
  • Thank you received: 21
  • Hikamarket Multivendor Hikashop Business Hikashop Essential
8 years 10 months ago #225268

This patch works at least with Authorize.net as the payment method.

I didn't try it with any other payment method but I did test it with UPS shipping and Manual Shipping.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 10 months ago #225311

Thank you for your feedback. We'll add that patch for next release of HikaShop.

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum