VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: nicole2292 on November 20, 2011, 10:29:58 AM

Title: PayPal Plugin order status and emails not working correctly
Post by: nicole2292 on November 20, 2011, 10:29:58 AM
Hello,

I have been trying to configure a new shop on Joomla 1.7.3 - VM 1.9.8m and I am having endless problems with the paypal plugin.

The shop was supposed to be live last week in time for Christmas so this is quite an urgent matter now.

I will detail the problems I am having with the paypal payment method below:

1. Order status remains "pending" even after successful (live not sandbox) paypal payment and the customer being returned successfully to the site and seeing the message "Thank you for your order!".
The order status is always "pending" regardless of the settings. Even if I set the configuration "Order Status for Pending Payments" to "Confirmed". It is even still always pending.

2. No order emails are being sent to the customer or the store owner. I know this is a problem with the paypal plugin as if I use the standard payments plugin I get order emails even though the status of the order in that case is still pending as the payment has not actually received.

Whilst these two issues exist the site cannot go live. Please provide a solution asap. I certainly don't have time to wait for another release candidate or the stable version.

I know someone will surely say I shouldn't be using VM2 for a (nearly) live shop as it is not yet a stable release. Well I will tell you that I have a number of stores still running VM on Joomla 1.5 and these sites are so outdated now that they have been repeatedly hacked. I simply cannot risk running such an outdated version of Joomla for this new client due to the security issues it presents. Therefore I have no choice but to use the not yet stable VM2 so I can use a more recent and secure version of Joomla. As a long time Joomla and VM user I am actually extremely disappointed it has taken this long for VM2 stable to be released, but that is a separate matter.

Your assistance with this urgent paypal matter is greatly appreciated.

Nicole
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on November 20, 2011, 18:47:09 PM
Hi,

Please try to apply that fix first:
http://forum.virtuemart.net/index.php?topic=93021.new;topicseen#new

If your problem remains, tell me , i will try to see how i can help you.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: nicole2292 on November 21, 2011, 00:34:26 AM
Hi Atalak,

Thanks for your fast reply and suggestion. I have made the changes as suggested in http://forum.virtuemart.net/index.php?topic=93021.new;topicseen#new

My code now looks like this:

foreach ($returnValues as $returnValue) {
if ($returnValue !== null  ) {
if ($returnValue == 1 )   {
//We delete the old stuff
JRequest::setVar('html' , $html);
// send the email only if payment has been accepted
// update status?
if ($new_status) {
    if (!class_exists('VirtueMartModelOrders'))
require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );
    $modelOrder = new VirtueMartModelOrders();
    $orders[$orderID]['order_status'] = $new_status;
    $orders[$orderID]['virtuemart_order_id'] = $orderID;
    $orders[$orderID]['customer_notified'] = 0;
    $orders[$orderID]['comments'] = '';
    $modelOrder->updateOrderStatus($orders, $orderID); //
}
$this->sentOrderConfirmedEmail($order->getOrder($orderID));
$this->emptyCart();
} elseif ($returnValue == 0 )   {
    // error while processing the payment
$mainframe = JFactory::getApplication();
$mainframe->enqueueMessage($html);
$mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'),JText::_('COM_VIRTUEMART_CART_ORDERDONE_DATA_NOT_VALID'));

}
break;
}
//Returnvalue 'null' must be ignored; it's an inactive plugin so look for the next one
}


Still the exact same problem is existing. It does seem to be somewhat related to the cart not emptying as even after I have successfully made the purchase and returned to the site and I see "Thankyou for your order!" If I go back to the cart the cart still has the product(s) in it. It really should be empty if it was working correctly.

The order has gone into the system and is shown as pending only.

The return url from paypal looks like this http://www.mydomain.com/index.php?option=com_virtuemart&view=paymentresponse&task=paymentresponsereceived&pelement=paypal&pm=1 so theorhetically it should work...

Any further suggestions?
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on November 21, 2011, 08:15:28 AM
Hi,

If you did that modification it should work.

Stupid question, but i must ask for it: are you testing on a whebhosing or locally? Locally it will not work because Paypal cannot reach your web host.

Since it does not, can you do the following:
1) Set to Yes   the debug mode in the paypal payment.
2) Go in the logs folder and check the content of the file "paypal.log". It logs everything that it happening when receiving a notification.

If you don't have that file, may be you can check that Paypal is acctually calling you by checking your web site log.

You have a debug option in paypal configuration. Can you set it to on. And after look at the file in log/paypal.log ?



Title: Re: PayPal Plugin order status and emails not working correctly
Post by: nicole2292 on November 21, 2011, 22:14:04 PM
This is a live site on web hosting and using a real paypal merchant account and I am testing live payments with a different paypal account and a using real credit card. So everything is totally live, exactly as it needs to be for the store.
It's is waiting on going public until this issue can be resolved.

There is definitely something very serious wrong as there is nothing in my logs folder. Even after I have enabled debug and run through a live payment. You are talking about the normal logs folder in the root director of the Joomla installation aren't you? I have even made this logs folder 777 permissions in case permissions were the reason I have not logs at all.

As I said the return URL is http://www.mydomain.com/index.php?option=com_virtuemart&view=paymentresponse&task=paymentresponsereceived&pelement=paypal&pm=1
Isn't that all that is needed to tell Virtuemart the transaction has been successful? Doesn't that mean paypal is doing everything correctly and VM is just not doing the right thing with this URL?

I will point out again that I am seeing "Thankyou for your order!" on return to the Joomla site, although the cart has not been emptied after the successful transaction.

Your further help is greatly appreciated.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on November 22, 2011, 08:23:02 AM
Hi,

QuoteYou are talking about the normal logs folder in the root director of the Joomla installation aren't you?
yes i am.

QuoteAs I said the return URL is http://www.mydomain.com/index.php?option=com_virtuemart&view=paymentresponse&task=paymentresponsereceived&pelement=paypal&pm=1
This is the retourn URL from paypa, but it is not this URL that will update the order status.
The order status is updated with a server-to-server call notification.

QuoteEven after I have enabled debug and run through a live payment.
The debug option in Paypal, logs everything that is going on when a notification is recevied. If there are no files called paypal.log, then maybe there is a problem with the notification.

Is your website blocked by an .htpassword? if so, then the notification cannot be executed.

To check that a notification is sent to your website, you have to inspect your website logs.

QuoteI will point out again that I am seeing "Thankyou for your order!" on return to the Joomla site, although the cart has not been emptied after the successful transaction.
The cart should be emptied. I will check that point, and give you feed back.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: nicole2292 on November 22, 2011, 22:46:39 PM
Hi Alatak,

Thanks again for your help.

The website is not not blocked by htpassword - it is literally a live site on standard web hosting. It's just not advertised to the public yet due to this issue. We just have a temporary index.html file in the root site directory.

I have no idea why this is not working on why there are no logs. The entire Joomla site and all other plugins work correctly on this server and for the most part Virtuemart works correctly as well - the standard payments work fine, just not paypal.

I'm really struggling here and getting quite desperate as I'm running out of options and I simply don't know what to do to get this site live for the client...

Nicole
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on November 22, 2011, 23:02:07 PM
Hi,

1)
Did you check that you are getting the paypal notification?
To check that you have to go on your web site.

2) if you get the paypal notification, then you should at least have the paypal.log file created.
The file is in [root]/logos/paypal.log


Title: Re: PayPal Plugin order status and emails not working correctly
Post by: nicole2292 on November 23, 2011, 09:33:42 AM
Alatak: I don't quite know what you mean by the "paypal notification". The paypal payments are going through perfectly. I receive emails that the payments are through and the money has been transferred. I'm not sure what other notification you are referring to.

All of the payment data is correctly stored in the database. If I go to the orders page in admin and view an order all of the payment data is stored in there perfectly.

Payment Method
Payment Name   Paypal
Full amount of the customer's payment   2.10
Currency   AUD
Invoice   58adf03f
eligibility   Ineligible
Unique customer ID   L8P8XJA34NLYN
Tax   0.00
Date/time of the IPN   23:53:15 Nov 22, 2011 PST
Payment_status   Completed
Customer's first name   Nicole
Customer's last name   REMOVED FOR PRIVACY
Transaction fee   0.35
Customer's primary email address   REMOVED FOR PRIVACY
Email address or account ID of the payment recipient   REMOVED FOR PRIVACY
Primary email address of the payment recipient   REMOVED FOR PRIVACY
Transaction subject   375b77d0ef16390e20eacce2e6c85bf0
ISO 3166 country code   AU

I have spent the entire day looking at this in between tearing my hair out and and contemplating throwing the computer out the window... oh and also wishing I had used proprietary ecommerce software as it would have worked out far easier and cheaper than this.

Needless to say I have not solved the problem. I have narrowed it down to the fact that if I look in the file plugins/vmpayment/paypal/paypal.php at the function plgVmOnPaymentResponseReceived the problem seems to be in there somewhere.

I have found that although the values are stored in the database as per above if I echo $html that the values for "Order Number" and "Amount" are actually empty. Even though they exist and were stored in the database just fine.
This seems to be the root of the problem. As if I manually define $paypal_data['invoice'] then it all works correctly and I recieve the order emails (albeit to the email address for the order / invoice number I have manually defined).

function plgVmOnPaymentResponseReceived(&$virtuemart_order_id, &$html) {
// the payment itself should send the parameter needed.
$virtuemart_paymentmethod_id = JRequest::getInt('pm', 0);
$pelement = JRequest::getWord('pelement');

if ($this->_pelement != $pelement) {
    return null;
}

$vendorId = 0;
if (!($payment = $this->getPaymentMethod($virtuemart_paymentmethod_id))) {
    return null; // Another method was selected, do nothing
}
$params = new JParameter($payment->payment_params);
$paypal_data = JRequest::get('post');
$paypal_data['invoice'] = '26abf3c4'; //NICOLES NOTE: THIS MAKES IT WORK AND EMAILS ARE RECEIVED
$order_number = $paypal_data['invoice'];
$return_context = $paypal_data['custom'];
if (!class_exists('VirtueMartModelOrders'))
    require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );
$virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($order_number);
$payment_name = $this->getPaymentName($payment);
$html = $this->_getPaymentResponseHtml($paypal_data, $payment_name);
return true;
    }


So where to from here? Sorry my php knowledge is far to limited to take this any further and I simply cannot spend any longer on this. I am falling extremely far behind on my other work.

Therefore PLEASE PLEASE PLEASE can someone who has better php knowledge than me try to solve this ASAP.

Also I find it hard to believe no one else is having this issue as well. Surely I'm not the only one? Is anyone else having this problem?
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: mattprudente on January 25, 2012, 15:20:53 PM
Yes! I am having the same problems. Virtuemart isn't sending out order emails with the PayPal payment, but will send out when you use standard payment. The order details don't update to confirmed when paid either.

I've noticed similar questions asked throughout the forum, but no one has a response. I'm trying to figure out how to change the code to work, but like you I do not have a vast PHP knowledge. My clients are asking for a resolution to this problem.

Any help would be greatly appreciated here too!
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: fmp.martins on February 03, 2012, 00:21:30 AM
Same problem here!

I've passed the last two weeks bug fixing VM2 stuff... Some bugs seem like the code was writen and no one even bothered to test it once!...
Anyway, this is the last bug I must fix for the go live, so all help is welcome...


Edit: I've just found out that after the payment has been made, if I don't click the "take me back to the store" link and wait the 10 seconds for the automatic redirect to get back to the store, it works fine!
I'm using Sandbox, since I'm still developing it.

Edit: I've just found out that sometimes the "click here" link does work as expected. The problem is that it is non-deterministic!
I've also analyzed the 2.0.1 build from 02/Feb but the problems seem to remain.

I've tried to trick it using different techniques, the last one is saving the data in the session and use it if it was not post back.
Here's what i've tried in plugins\vmpayment\paypal\paypal.php
- plgVmConfirmedOrder (just right  before the function return:
        $session_post =& JFactory::getSession();
   $session_post->set( 'backup_paypal_post', array_merge($post_variables, $dbValues) );

- plgVmOnPaymentResponseReceived just before any usage of $payment_data:
      // PayPal return bug hack!
      if (empty($payment_data)) {
                $session_post = JFactory::getSession();   
      $payment_data = $session_post->get('backup_paypal_post');
      $payment_data['mc_currency'] = $payment_data['currency_code'];
      $payment_data['mc_gross'] = $payment_data['amount'];
      }

Yep, I'm desperate here!... :D
With this ugly hack one has the information required to display the message on the screen...
But the mains problem remains...
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on February 04, 2012, 11:29:11 AM
Hi,

QuoteI've passed the last two weeks bug fixing VM2 stuff... Some bugs seem like the code was writen and no one even bothered to test it once!...
That is not true. We do test it :).

Can you please try this version http://forum.virtuemart.net/index.php?topic=96945.0, and tell me if your problem is still there?
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: John2400 on February 05, 2012, 08:21:41 AM
Hi alatak,

I've just done a new updated site and am running - Joomla 1.7.5 and VM 2.0.1 (d) - versions .

* I did the test Payments and I receive all emails from my server sent - lots of ways,   except the Paypal shop order from VM itself.The Vendor nor Buyer receive an email from VM when Paypal payment option is chosen.

Once it goes to paypal site - Then that's their problem. ( i'm not concerned at present about the actual emails from them)

* All other payment opitions - send an email

* I can run the store after a paypal invoice comes to me by logging into my site and looking up orders in admin. ( so it will work)

* I see there might be other areas - in this post related to this in regards to confirmation etc - but that's different.

* Information _ In regards to paypal confirmation not changing orders in the backend

The old VM 1  would not chnge orders if ( you did not configure at least one email on the host server as real ie you can have as many forwarder eamils as you like but you must have one configured eg admin@snoopdog.com
The old VM always did not like the Paypal email account @snoopdog .com etc different from the paypal email login. Paypal liked them to be the same. Thus you often got emails bouncing back from paypal and not changing the status of products.
This is just in the old version - sometimes.

Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on February 06, 2012, 08:54:37 AM
Hi,

Just to make sure that we are talking about the same thing.
The checkout worflow in VM2 is not the same as the workflow in VM1.
In the case of Paypal, the order email is only sent if a payment has been done. Not before.

Quote* I did the test Payments and I receive all emails from my server sent - lots of ways,   except the Paypal shop order from VM itself.The Vendor nor Buyer receive an email from VM when Paypal payment option is chosen.
In my test the emails are sent, so i need to understand what you have you done exactly in order to find out what is going on.

In paypal there is a debug option, that logs infos in a file in log/paypal.log. Can you turn that option on? and give me the output of that file?
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: John2400 on February 06, 2012, 11:48:37 AM
Ok,  Is this true?

In VM 1 - Virtuemart sent the first lot of Emails to the vendor and the buyer.

In VM 2 - Virtuemart will only send the emails if and when a  correct payment is done and completed through Paypal?

VM 2 Virtuemart will then send an email after paypal emails have arrived as confirmed. ( That's two to the buyer in total and two to the vendor) Is this true?

* Back the front from VM1 or as Alatak says" different work flows"
----------------------------------------------------------------------------------------------------------------------------------------

* If this is so, were are trusting possible sales to the transaction in paypal - ( I have see in the past  lots of customers order through the payment Paypal - then forget their login or things go wrong .

The vendor would have receive the initial VM 1 email and has contacted them and finished the sale personally.

Am I correct in the first statements and just a though about the last.

Thanks

* Maybe a visual diagram of the work flow "payment for paypal" would clear this post up?
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: Talleyrand on February 06, 2012, 13:39:40 PM
Hi all,

In case of Paypal payment validated, vendor and client do not get any email. How Alatak get an email ? Debug is off for me.

Luc
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: John2400 on February 06, 2012, 21:55:10 PM
Alatak,

My log - debug file : whole message

2012-02-06 20:45:50
message: plgVmConfirmedOrder order number: 33233c83

* If this is perfect then the issue is that when you test Paypal payment option - you must test with a sandbox option on in Paypal otherwise we will not see the completed transaction.

* The reason then is that In VM one I did not have to test this payment option inthe sand box because I always receive the VM1 emails orders first and I know paypal look after their own.

* Again - Its just in the explaination of the work flow?

I appreciate the time and hope your answer says I am good to go.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: lt635 on February 07, 2012, 06:22:56 AM
Hi,

I am stuck on this problem.  Currently testing on a live server getting it ready to move to it's own server in hopefully 1 weeks time.  Using PayPal sandbox, no emails to customer or vendor from vm.  After completion of order and you come back to the shop the cart is not cleared. If you registered when checking out and are logged in, the cart will clear when you log out.

I need a solution for this before I can go live with this site.  Any help will be much appreciated.

Thank you
Regards
Lene
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on February 07, 2012, 08:44:08 AM
Hi,

Quote2012-02-06 20:45:50
message: plgVmConfirmedOrder order number: 33233c83
This means that the order has been created and Paypal trigger is called.
Obviously you did not receive the paypal notification since you don't have an entry in the log file. Can you go on your web site server log, and check if around the time of your test, you ave an entry like thath

should look like "index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component"
and check if the HTTP status is 200 or 500. 


Go on the BE, in the order,check if have a new entry in the history, saying that the payment has been confimed, and the email sent.

Let's try that first.
If i don't get any good explanation , then i will contact you by MP.

Title: Re: PayPal Plugin order status and emails not working correctly
Post by: Talleyrand on February 07, 2012, 10:50:23 AM
I'm doing real testing with a valid paypal account (client & shop).

It seems that on calling plgVmOnPaymentResponseReceived, $payment_data is null. I checked at virtuemart_order_id value, it's empty. No mail sent, cart not cleared...
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: fmp.martins on March 02, 2012, 21:15:19 PM
Quote from: alatak on February 04, 2012, 11:29:11 AM
Hi,

QuoteI've passed the last two weeks bug fixing VM2 stuff... Some bugs seem like the code was writen and no one even bothered to test it once!...
That is not true. We do test it :).
I have no doubt that you test it. What I'm stating is that the tests performed are week and not enough, specially for a product that took years of development.

Anyway, I'm not here to criticise but to help improving VM and to get help on critical issue...

Quote
Can you please try this version http://forum.virtuemart.net/index.php?topic=96945.0, and tell me if your problem is still there?
Done.
The problem seems to have been solved in 2.0.2H (but I still need to run more tests in order to be shure).

But now, this shows up during the screen that takes the user to PayPal:
vmError: VmTableData::store failed - Unknown column 'virtuemart_shipmentmethod_id' in 'field list' SQL=INSERT INTO `fuw1o_virtuemart_shipment_plg_weight_countries` (`id`,`virtuemart_order_id`,`order_number`,`virtuemart_shipmentmethod_id`,`shipment_name`,`order_weight`,`shipment_weight_unit`,`shipment_cost`,`shipment_package_fee`,`tax_id`,`created_on`,`created_by`,`modified_on`,`modified_by`) VALUES ('0','4','14d79ffe','0','Levantamento na lojaLevantamento na loja','0','KG','0','0','0','2012-03-02 20:11:11','42','2012-03-02 20:11:11','42')
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on March 02, 2012, 22:03:12 PM
Hi,

That table should have those fields:

'id' => 'INT(1) UNSIGNED NOT NULL AUTO_INCREMENT',
       'virtuemart_order_id' => 'INT(11) UNSIGNED DEFAULT NULL',
       'order_number' => 'CHAR(32) DEFAULT NULL',
       'virtuemart_shipmentmethod_id' => 'MEDIUMINT(1) UNSIGNED DEFAULT NULL',
       'shipment_name' => 'VARCHAR(5000)',
       'order_weight' => 'DECIMAL(10,4) DEFAULT NULL',
       'shipment_weight_unit' => 'CHAR(3) DEFAULT \'KG\' ',
       'shipment_cost' => 'DECIMAL(10,2) DEFAULT NULL',
       'shipment_package_fee' => 'DECIMAL(10,2) DEFAULT NULL',
       'tax_id' => 'SMALLINT(1) DEFAULT NULL'

If you don't have those fields, you should delete the table with PhpMyAdmin, and go back to your shipemnt method, and store it. The table will be created again.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: fmp.martins on March 03, 2012, 17:22:05 PM
Done.  ;)
That went just fine.

Know I'm facing a new problem, when I select the billing address, the login/register form shows up, but I have the "Only registered users can checkout" uncheked.
Also, I can enter the payment and shipping selection forms with no problem whatsoever (they just show up blank since they depend on the address and It's empty because the user must login/register)...
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: dron_gr on March 04, 2012, 16:07:52 PM
I have an issue about sending an order e-mail after successfull PayPal payment like in Standart Payment same with the many people here. I dont understand why it is ignored by developers? There is nowhere information about how to solve that issue! PLease it is really urgent to be solved - e-shop cannot work properly!

Any help is really appreciated! Thanks in advance!
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on March 04, 2012, 17:37:11 PM
Hi,

We don not ignore your messages.:)
I also need to understand why you don't get the emails.
I have been twice on some web sites trying to find out why they don't get the emails, and it appears that it was a misunderstanding. ;

With Paypal you only get emails if and only if the payment has been made. Other wise you don't have the email.

Are you using the VirtueMart 2.0.2 ?

Title: Re: PayPal Plugin order status and emails not working correctly
Post by: dron_gr on March 04, 2012, 18:55:29 PM
My version of VM is 2.0.0 i cant change it to VM 2.0.2 and joomla 1.6. So i have it on my website and i tested it by paying some fees and after PayPal payment is finish it gives message that in 10 seconds u will be redirected on shop website. After redirecting there is only "THANK YOU" message and nothing else. The only e-mail i took was from PayPal about payment and order number. But it was not like an email in Standart Payment.

Thanks a lot for your help!
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: John2400 on March 05, 2012, 09:25:36 AM
dron_gr,
Hi - I guess the developers are really asking why you cannot upgrade and solve the issue? 

Today I see they posted 2.0.3 version test.
------------------------------------------------------------------------------------------------------------------------------------------------------------------
On many of the upgrades this issue may have been resolved So I presume that Alatak was really saying that
she has helped quite a few people and often the answer was not in the software but in the understanding of how the emails and payments work and they differ _ depending on the way (you the customer Pays)

Standard works one way , and paypal works another.

In the new upgrades in the backend in paypal - you will see a message that says "    "
PAYPAL
     Warning - In VM2, the vendor and buyer will ONLY receive an email when the transaction is complete."
Thus paypal invoices and emails are a different process than if you pay by another method.


* When I received my first paypal email It was confusing and a few minutes later I received an email from VM - which stated what the customer ordered.
* so from here - you might need to test on a real product through paypal - make the product $1.00 and see what happens - then post a response.

I must say that Alatack - is the key to your issues best of luck.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on March 05, 2012, 11:58:31 AM
Hi,

Thanks John2400.
QuotePAYPAL
     Warning - In VM2, the vendor and buyer will ONLY receive an email when the transaction is complete."
Yes we have decided to add that together :)
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: dron_gr on March 05, 2012, 15:00:22 PM
Hi John2400 and Alatak.

THe problem in upgrading is that i made a plenty of changes in code so VM 2.0.0 could work for me fine. When i upgrading i loose every change i made. Im not a php programmer and sure i could make some mistakes but now VM 2.0.0 works really ok and the only problem is that after PayPal payment it doesnot send me an order e-mail. John2400 i was doing exactly what you telling me now - which is testing with 1$ product. PayPal sends me an e-mail VM doesnt. So what kind of solution i could have in that case?
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: carbon-uk on March 15, 2012, 13:10:21 PM
I have a similar issue.

If orders are not paid, ie user clicks cancel & return to site. The order is not logged in VM, but the order confirmation e-mail is still sent out. It even has order number & order password.

We have orders not completed set to cancel, so if you try to use the login it does not exist. So if the order doesn't exist surely the confirmation should not go out?

Thanks
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: John2400 on March 15, 2012, 13:32:26 PM
Hi carbon-uk,

Could you just expand on your problem and tell us what you are using to pay.  That is, are you using paypal , what country and if not try and tell us what payment option you are using. Does this happen on only paypal or other cancelled orders.

* Also what versions of software - joomla and VM - .    Does your purchaser have to register on your site to buy a product.   Although Alatak will be able to answer better than I can .

I'm just wondering that if a customer has to register to purchase a product and then cancel.  The computer may still send them an email not because they purchased something but becasue It is trying to tell them their registered password.

* It is a bit like registering at a shop and telling them your phone number and address and then ringing you later to check if its true and them if you do wish to purchase something later - you have a direct line and a password. Even though you bought nothing.  Also It might help you to not set to cancel as you might want to see why they cancelled. I have seen many a sale when the customer does not finalise the purchase- you have their details. You call them and you get a sale.??

Maybe Alatak might solve this another way. 
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: nanthakumar on March 31, 2012, 11:59:00 AM
Hi,

We have installed joomla 1.5 and virtuemart 2.0.2 version. In this, we are not getting emails after completing the payment from paypal. We have checked with paypal.log file.

It is coming like this.


2012-03-31 07:52:01
message: plgVmConfirmedOrder order number: 911f013

2012-03-31 07:54:01
message: paypal_data 25.00   911f013   Ineligible   confirmed   PBQYW3F2UUJ56   0.00   1 Main St   00:53:53 Mar 31, 2012 PDT   Pending   windows-1252   95131   Test   US   Test User   3.4   kojjovscf5ghpmpko4nu1ocj76   verified   United States   San Jose   1   AVwCMswuun6bg22HFn5Boj-W-nNkAGi9WZXdK02zpOH-hOzIR--Nf5.3   sugany_1196140593_per@zen-e-solutions.com   7R191756P52008538   instant   User   CA   suganya@zen-e-solutions.com   unilateral   web_accept   Order Number: 911f013   SGD      US   1   0.00   kojjovscf5ghpmpko4nu1ocj76      0.00   76ac44e3835b1

2012-03-31 07:54:01
message: process IPN

2012-03-31 07:54:01
message: process IPN OK

2012-03-31 07:54:01
message: plgVmOnPaymentNotification return new_status:P

We didnt get the notification related message in our log file. We tracked the code.

plgVmOnPaymentNotification() - this function in plugins/vmpayment/paypal.php is having that mail sending part.

               if (empty($paypal_data['payment_status']) || ($paypal_data['payment_status'] != 'Completed' && $paypal_data['payment_status'] != 'Pending')) {
         //return false;
      }

      $new_status = $this->_getPaymentStatus($method, $paypal_data['payment_status']);

      $this->logInfo('plgVmOnPaymentNotification return new_status:' . $new_status, 'message');

      $modelOrder = VmModel::getModel('orders');

      $order = array();
      $order['order_status'] = $new_status;
      $order['customer_notified'] =1;
      $order['comments'] = JText::sprintf('VMPAYMENT_PAYPAL_PAYMENT_STATUS_CONFIRMED', $order_number);

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

      $this->logInfo('Notification, sentOrderConfirmedEmail ' . $order_number . ' ' . $new_status, 'message');

      //// remove vmcart
      $this->emptyCart($return_context);

Can you please help on this? We need it very urgently.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: John2400 on March 31, 2012, 12:48:37 PM
nanthakumar ,

Just wondering firstly ? joomla 1.5 as you said you just installed it?

Why not use 2.5.3 Joomla and VM 2.0.2 and beyond?

The forum could spend  a long time answering your question when 1.5 joomla is being phased out.

try updating and then test.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: freeme on March 31, 2012, 16:41:05 PM
Hi I am running Joomla 2.5.3 with VM 2.0.3.e and I am having also the problem that after successfull PayPal payment, there is not confirmation mail sent to the buyer (with the purchased download file).

My log files looks like this:

2012-03-31 14:35:48
message: plgVmConfirmedOrder order number: fe4d0100

2012-03-31 14:36:19
message: paypal_data 3.66   fe4d0100   Ineligible   UXFWKLZP8SKRY   0.00   07:36:15 Mar 31, 2012 PDT   Pending   windows-1252   Alexander   0.42   3.4   261ebb03467271da39d866cf16870684   verified   alexan_1331804194_biz@schuch.at   1   AuW.w9z8OXNbvAHoOONECsIwtNKNAd4aTwf7bGcYnN6oy2PRVYcr.sYX   alex15_1331152169_pre@schuch.at   3GP808690C022273P   instant   Schuch   alexan_1331804194_biz@schuch.at      YVHTRMD7A3JDE   paymentreview   web_accept   Bestellnummer: fe4d0100   EUR      DE   1   0.00   261ebb03467271da39d866cf16870684      0.00   b60a1a9e1fc1b

2012-03-31 14:36:19
message: process IPN

2012-03-31 14:36:19
message: process IPN OK

2012-03-31 14:36:19
message: plgVmOnPaymentNotification return new_status:P

2012-03-31 14:36:19
message: Notification: emptyCart
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: DeepaVaith on April 16, 2012, 18:19:31 PM
Unrelated to your problem, but did the cart empty?
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: melina on May 25, 2012, 03:53:22 AM
Hi there! I have the same issue woth mercado pago payment, I guess its the same than paypal and in both cases I will get the email after payment. I will try that and check it, but I have a very important question here.
I bought a product as a customer on my live site and choosed paypal. I was sent to paypal, saw that was working and left the page to try a real payment later (no time now for all).
Now I have no emails (now I know why) but the order IS on my BE. Good so far. I can see the account on FE for this "customer" and I can see the order pending there. But I cant choose to pay for it after I left paypal the first time. So... If for some reason a customer cant finish the payment part and decide to come back to the shop later to pay and finish the process to buy all the things he already choosed before, he cant. He has to go all over again through the whole process to pay and that is a bit bad for some cases. Lets say I spent half an hour or one hour choosing several gifts for people and when I have to pay the light goes off.... I have to do all of that again? Cant I have a button or link to pay for the order later?
I have the same problem with paypal and mercado pago. Cant seem to get a solution myself so I ask you guys... ideas?

Thank you!!
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on May 25, 2012, 09:59:53 AM
Hi,

@Melina, i understand your point.
It is a matter of taste. Some shop owners do not want to have a lot of orders not completed. Others do, like you.
I can add some configuration parameters in the Paypal config to have both options.
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: melina on May 26, 2012, 00:55:13 AM
Hi! Yes, I would like to have the option for paypal and mercado pago. When a user goes to the account and see the list of orders I would like them to be able to click a pay link or something like that so they can pay an order they already have. Do you think I can do that somehow on my shop?
Not that I want them to have incomplete orders but eventually you can have the electricity out or an urgency or whatever that make them stop and them come back to finish.
Do you think there is a way for me to add that to my shop? I have it all done and I will launch the site this week, just wanted to add that possibility. =) Both plugins (paypal and mercado pago) have the same not getting emails until the payment its done and no option to pay later. I know mercado pago is not your plugin so maybe I think there is a way for me to add some link or something?...
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: melina on May 31, 2012, 13:36:46 PM
Hi Alatak! Did you find how to solve this? There is many people needing to have some link to pay orders later on account orders list or something like that. I found out I am not the only one. Tried to find a way to do it but cant seem to find it...
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: John2400 on June 10, 2012, 09:17:02 AM
melina,


http://forum.virtuemart.net/index.php?topic=53768.0;topicseen

Wish list ? maybe
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: melina on June 11, 2012, 14:34:59 PM
mmm thank you, but its not what I need. Lets say you make an order on my shop and when you are about to pay electricity goes out. You cant pay and you get back to it when the electricity is back. By then you can login and see your list of orders on my shop, but you cant pay it so you have to go and do all the process again... its just ridiculous. You can loose many orders like that. electricity out is one of the options. You can be choosing gifts for so long that you didn't see the time and you have to run to a meeting... whatever. As a client you should have the possibility of entering later to your account and pay an order but I cant seem to find a way for people to do that...
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: John2400 on June 11, 2012, 15:02:34 PM
Hi this exact issue is has been discussed in DEv forum forum.

http://forum.virtuemart.net/index.php?topic=92779.msg343566#msg343566

You could try your luck pressing the point here-

I do know what  you mean - I think someone will set it up as an extension - it might need a time setting on it too.

Like delete all stored orders after 6 months.?
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: melina on June 11, 2012, 15:06:59 PM
mmm no, this topic is about not saving cart but in my case the cart is not  problem...
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: thiagu on July 16, 2012, 11:46:15 AM
i am using joomla vertion 1.5.20.
for payment i am using paypal in that after success payment order status showing pending,please advice for this the site is in live now
Title: Re: PayPal Plugin order status and emails not working correctly
Post by: alatak on August 29, 2012, 11:07:57 AM
Hello,

On your order: if you only have one pending status, then it means that your client has not payed.
If he has payed, then you should have twice the "pending" status, in that case, go at the bottom of the page, and check why Paypal has returned a pending status

The best, and that is something we have done for versions > VM2.0.10
is to create a "Confirmed by shopper" status, and to configure in the payment method the parameter "pending status"
Like this there is a difference between "pending orders" which means the order has been created, and "Confirmed by shopper" which means the client has payed, but paypal returned a pending status for some reason.