Order email confirmation and user registration confirmation is not working

Started by rupesh1989, January 17, 2012, 12:18:46 PM

Previous topic - Next topic

deewhyweb

Anyone using the paypal payment method, i have found the following works:

edit plugins/vmpayment/paypal.php
In the function function plgVmOnPaymentResponseReceived
add in the following:

$modelOrder = VmModel::getModel ('orders');
$order = array();
$order['order_status'] = 'C';
$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);

before $cart = VirtueMartCart::getCart (); around line 387



ngenge

Thank you so much deewhyweb!!!!!!!!!!!  ;D
I put those 4 lines in paypal.php. It's working perfectly.
You helped me a lot. You made my day!  ;)
Thanks Thanks Thanks ... ....


Quote from: deewhyweb on September 14, 2012, 14:01:45 PM
Anyone using the paypal payment method, i have found the following works:

edit plugins/vmpayment/paypal.php
In the function function plgVmOnPaymentResponseReceived
add in the following:

$modelOrder = VmModel::getModel ('orders');
$order = array();
$order['order_status'] = 'C';
$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);

before $cart = VirtueMartCart::getCart (); around line 387




alatak

Hello
the function plgVmOnPaymentResponseReceived shoud not update the order status.
Only the paypal IPN notification.
Are you testing locally? in this case, you do not receive the notification, and it is normal that your order is not updated.

You are not testing locally ? Then check on your web log if you received the IPN notification.

ngenge

Hello alatak

I tested from web, not locally. I made two changes to send confirmed mail to vendor and buyer.
1) Inside Virtuemart > Configuration > CheckOut > Default Order Status to send an invoice


2) edit plugins/vmpayment/paypal.php
In the function function plgVmOnPaymentResponseReceived
add in the following:

$modelOrder = VmModel::getModel ('orders');
$order = array();
$order['order_status'] = 'C';
$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);

before $cart = VirtueMartCart::getCart (); around line 387


After those two steps,
- I received the mail of confirmed order by buyer and Buyer received the mail of confirmed order at mysite.com.
- Inside Virtuemart > Orders & Shoppers > Orders, Order status is updated, please check


Log file that you mention is error.php inside logs folder. is it? If so, please check

I think it's because of Confirmed status is not updated inside Orders & Shoppers > Orders, only Pending before I put those 4 lines inside paypal.php.

alatak

Hello

Quote2) edit plugins/vmpayment/paypal.php
In the function function plgVmOnPaymentResponseReceived
add in the following:

$modelOrder = VmModel::getModel ('orders');
$order = array();
$order['order_status'] = 'C';
$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);

before $cart = VirtueMartCart::getCart (); around line 387

As i said, this should not be done. It is the IPN that must update the status.

QuoteLog file that you mention is error.php inside logs folder. is it? If so, please check
No , it is not this file i meant.

I meant the server logs. It is on your host server. It logs all the page requests. You do a checkout, and then after search for the word notification.
Ecahc line is
the ip address of the request, the timestamp, the method + page link, the HTTP status code. The resulting status code. "200" is success.
If the number is 200, then everything is ok. If it is something else 500 for example, then something is wrong.
There is no reason why it is not 200. But this is the first step to check.

Once you are sure you get the 200 status code, then we must find out why the order status is not updated.
Go in Virtuemart>payment method>paypal, and set the debug on.
Do another checkout.
Open the file under the folder log, called paypal.log. You should have some debug infos inside. You can copy /paste those infos. And i will try to understand what is going on.


QuoteI think it's because of Confirmed status is not updated inside Orders & Shoppers > Orders, only Pending before I put those 4 lines inside paypal.php.
Yes I understand, but it is not correct. You must check if you get the IPN, and why the order is not updated.

ngenge

Hello alatak,

My site is at shared server. Inside Raw access  logs, I saw the list like following. is it correct?
66.249.74.146 - - [25/Sep/2012:20:04:57 +0800] "GET /accessories/art/results,1-16.html HTTP/1.1" 200 60097 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"


I cannot find the date of last two day transaction inside logs list. Record is started from yesterday evening. Can you help me to let me know How can I trace back last two days record to see whether 200 or 500?


If it's not corrected, I should remove these following 4 lines. is it? After that you ask me to do another check out and check whether 200 or 500 inside the server log first. Then copy infos from paypal.logs to let you know.

$modelOrder = VmModel::getModel ('orders');
$order = array();
$order['order_status'] = 'C';
$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);

Thank you for your help. :)


[attachment cleanup by admin]

alatak

Hello

yes it is correct the raw access logs.
Look in the error log also what do you have.
May be you have to setup something in "Choose log programs"?

ngenge

"Choose log programs" is locked by administrator.

If those code are not correct, I should remove these following 4 lines. is it? After that you ask me to do another check out and check whether 200 or 500 inside the server log first. Then copy infos from paypal.logs to let you know.

$modelOrder = VmModel::getModel ('orders');
$order = array();
$order['order_status'] = 'C';
$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);


Quote from: alatak on September 26, 2012, 11:33:41 AM
Hello

yes it is correct the raw access logs.
Look in the error log also what do you have.
May be you have to setup something in "Choose log programs"?

ngenge

By the way, I received the confirmation order in this morning. Order date is 22 September. But received confirmation order mail is 26 September.


[attachment cleanup by admin]

alatak

Hello

ok, llok at the bottom of your order, you will have the Paypal details, and you will have the timestamp of the paypal IPN.
May be that will help us to know why it took soo long.

ngenge

Please check it. Hope it could help!


[attachment cleanup by admin]

alatak

Ok,


Strange that all the fields are not filled in.
which version of VM do you have? Have you updated the AIO also?You can update both either with the live update, or using the Joomla Installer.
In both case, if the tables need to be updated , they will be update.

And you have a strange error concerning the dates. The IPN was sent the 21/09 (this is the paypal timestamp), your order was created 22/09 (this is your server timestamp), and the IPN was received by Virtuemart the 26/09 (your server timestamp).
what is wrong s the IPN recevied before the order was created.

ngenge

Hello alatak,

Quote
Strange that all the fields are not filled in.
which version of VM do you have? Have you updated the AIO also?You can update both either with the live update, or using the Joomla Installer.
In both case, if the tables need to be updated , they will be update.
Actually all fields are filled in. Because I think those are customers infos. so, I just keep it hid. I use VM 2.0.10 which is latest version. Kindly let me know if you would like to know those info in order to trace the cause of not sending confirmed mail.


Quote
And you have a strange error concerning the dates. The IPN was sent the 21/09 (this is the paypal timestamp), your order was created 22/09 (this is your server timestamp), and the IPN was received by Virtuemart the 26/09 (your server timestamp).
I checked out payment from singapore. Do you think is that error caused by due to time difference?

Quote
what is wrong s the IPN recevied before the order was created.
Where can I see what's wrong with IPN received before order was created? Two days after checked out, I don't receive any auto confirmed mail except paypal mail, so, I changed order-status to Confirmed manually in order to send confirmed mail to customer. Four days after checked out, I received auto confirmed mail, my customer also received too. It's on 26 September. Kindly help me! Thank you

Best regards,
Ngenge

ngenge

This time I checked out with Real payment of Paypal.
Hope someone can help me.   :'(

Best regards,
ngenge

[attachment cleanup by admin]

Ffragrances

Some detail: As of today I have the very latest versions of Joomla 2.5 and VM2 installed on ultimate hosting on Godaddy.

Well, it seems I have the same issue here: I turned on the debug in the PayPal module, and I did a test purchase. Check the log from Paypal module and it returns this.   
2012-10-24 02:50:14
message: plgVmConfirmedOrder order number: 0791060

Admin received an E-mail from PayPal for the completed transaction and so did the User. This has been going on since I migrated from the older versions of both Joomla and VM. In the Orders> details backside in VM these orders all show "pending" even though they are in fact complete. If I manually change them to confirmed then the Vendor and the User gets confirmation emails. Admin does not. This is very weird. As I have read through this thread it seems that "ngenge" has tried this addition to the PHP and it worked for them. And the developers seem to be saying this as not the proper solution. Is it?, and if not what is possible the issue here. All other normal emails seem to be working fine on the site.