News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Slow creation of confirmation invoice or emails

Started by jwest, March 01, 2017, 00:50:28 AM

Previous topic - Next topic

jwest

Our VirtueMart store was recently modified to include a SIM payment option that sends a customer to authorize.net's servers to enter credit card information and complete a transaction. Although transactions were charging correctly, the relay response process was failing and displayed this message to customers:

QuoteAn error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

This transaction has been approved.

It is advisable for you to contact the merchant to verify that you will receive the product or service.

After working with the SIM developer, he helped us determine that the failure point appears to be email creation. Basically, authorize.net calls to our relay response URL, our system gets the message that the order is confirmed, thereby kicking off emails to both vendor and customer, which takes longer than the ten seconds before authorize.net times out. By the time our servers communicate back that all is good (cart emptied, status confirmed, etc.) authorize.net has already stopped listening and displayed the message.

When I changed "Default Order Status to send email to shopper/vendor", "Default order status to create invoice", and "Orderstatus to use for attachment" to status "Complete" only, everything gets process without a hitch... except no emails get sent out to customer or merchant confirming the order.

If anyone has resolved a similar issue, or suggestions for what could be done, I would greatly appreciate it.

Details: Joomla 3.6.5, VM 3.0.18

jenkinhill

Check settings for "Default Order Status to send email ....." in VM Configuration/Emails
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

jwest

And what would you suggest I use for this field? I'm currently generating the emails for the following statuses:

Confirmed
Cancelled
Confirmed by Shipper (don't think I've seen this status though)
Shipped
Refunded

I suspect the "Confirmed" is causing the delay and ultimate problem, but customers expect an email once they complete an order. I have the same statuses minus "Shipped" in the box for "Default Order Status to send email to vendor" which likely is adding to the delay. I would have thought the heavy lifting of email generation would occur after time-critical steps like confirming the relay response.

One more detail: PHP 5.5.9

Studio 42

Try to reduce your logo size if you send the PDF in the email.
Perhaps disable PDF  in orders completely solve your issue(PDF is not needed, user can print the order in front end)
If you use SMTP, try to use PHP mail or sendmail in your Joomla config is most of time faster.

jwest

Hi Studio42, thank you for the ideas. I tried again with PDF invoice creation set to "none" (also tried with orderstatus to use attachment to "none" as well) but still took too long to send. We are currently using PHP Mail and got no better results switching to sendmail. I have not gotten to test with SMTP as I'm waiting to verify the configuration settings with our System Admin.

jwest

I have narrowed down the problem to the SIM plugin initiating this line of code:


$modelOrder->updateStatusForOneOrder($virtuemart_order_id, $order, true);


$modelOrder is previously set with this line $modelOrder = new VirtueMartModelOrders();

I placed logging commands before and after, and the process can take from 35-60 seconds to complete before it displays the necessary html and the function ends. I'm not good enough with PHP to determine if I can throw this function into a asynchronous thread to run AFTER the function is over.

Studio 42

What plugin do you use in your shop that are called in your order ?
And have you checked  with an updated release Vm 3.0.18.6 or beta 3.0.19.6 ? I know that in some case you can have a loop problem because some plugins that seems to be solved in new releases.

Milbo

Quote from: Studio 42 on March 02, 2017, 21:42:44 PM
What plugin do you use in your shop that are called in your order ?
beta 3.0.19.6 ? I know that in some case you can have a loop problem because some plugins that seems to be solved in new releases.
3.0.19.8 please !
http://forum.virtuemart.net/index.php?topic=136826.0

First this is bad $modelOrder = new VirtueMartModelOrders(); they should use VmModel::getModel('orders'). And you should really try the new version, because I worked a lot on the emails and in special the creation of orders and the loops. Vm has now a lot more program internal caches and sending emails should be faster.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/