News:

Support the VirtueMart project and become a member

Main Menu

Order confirmation email sent before PayPal payment processed

Started by davidm, May 01, 2008, 12:57:41 PM

Previous topic - Next topic

wastedspace

I tried to download the patch today, but on the download screen it says 'Sorry, your download limit has been reached'(!). I haven't even downloaded it yet! Anyone else seeing this?

wastedspace

Just checked the site again, and download link seems to be working now :)

MoneyMagnets

Hi everyone,

I'm using Angek's patch for testing and I've got something a little strange that someone may be able to help me with.....

I had the test mode set to Yes and the new field set to Yes (to send invoice) and it worked with the invoice being sent visa email. However my testing set up was wrong since I wasn't getting confirmation from paypal.

So I set the test mode to No and still used the sandbox. The New field for the invoice is still set to Yes but this time for a new order instead of receiving the invoice the user received an email for order status change to pending and then when the payment was confirmed they received another order status change. They didn't receive an invoice at all.

Has anyone else got that patch working in a live environment?
If so how?
What have I missed since it was working fine in test mode?

Thanks for any help. I wouldn't have got this far with Virtuemart if it wasn't for the posters on this forum!

Regards,
Karen     

wastedspace

Hi MoneyMagnets,

Have you updated your IPN settings in your Paypal account? I had set my IPN Notification URL in Paypal to the notify_gen_transaction.php url, however...

I too haven't managed to get this patch working right. Everything seems to be working apart from the fact I still get the Purchase Order email before any payment has been made. I was under the impression that the PO email was going to be sent out AFTER payment confirmation...

If anyone has got this working in test mode & live, please let us know if you had to make any tweaks.

Many thanks!


MoneyMagnets

Hi WastedSpace,

Do I have to change the IPN for paypal sandbox? Every thing other the patch is working fine for the paypal sandbox. The issue happened when I switched the test mode to No, which I understand is what I am meant to do for sandbox testing....

This is new to me so I may have something wrong...

Regards,
Karen   

   

MoneyMagnets

I set up an IPN on my sandbox account and it didn't make any difference....
That's assuming I'm doing it right  :)   

ladumeni

Hi MoneyMagnets/WastedSpace,

I'm not quite sure if you guys are talking about my patch as described here http://www.b-planet.com/VirtueMart/paypal-patch.html or a previous patch posted on this forum....

You should normaly always (production and sandbox) set "Test Mode" to "no". If you still get an Purchase Order email sent out before the payement then the file checkout.index.php wasn't correctly patched (you can check the source code on the last checkout page. It should contain a form with the paypal URL in it)...

You shoudn't need to change your IPN Notification URL in Paypal to notify_gen_transaction.php as this is sent with the form via a hidden field

MoneyMagnets

Hi ladumeni ,

I did specify that I was using AngeK's patch.

I have since restored my files since I couldn't get that patch to work (and don't understand the coding enough to be able to change it myself although I did have a look).

Thanks for clarifying about the IPN.

I'm going to try your Bplanet patch later today  :)

Regards,
Karen   

wastedspace

Quote from: ladumeni on July 24, 2009, 20:57:52 PM
Hi MoneyMagnets/WastedSpace,

I'm not quite sure if you guys are talking about my patch as described here http://www.b-planet.com/VirtueMart/paypal-patch.html or a previous patch posted on this forum....

You should normaly always (production and sandbox) set "Test Mode" to "no". If you still get an Purchase Order email sent out before the payement then the file checkout.index.php wasn't correctly patched (you can check the source code on the last checkout page. It should contain a form with the paypal URL in it)...

You shoudn't need to change your IPN Notification URL in Paypal to notify_gen_transaction.php as this is sent with the form via a hidden field

Hi ladumeni,

Apologies to MoneyMagnets. I thought AngeK's patch was the b-planet one. I am indeed talking about the b-planet patch. I still cannot get it to work properly. The source code on the last page doesn't actually display the paypal url, nor the paypal form. Yet it goes to Paypal.

I have checked, and definitely uploaded the patched checkout.index.php page. Is there any way you can help me get it working?

ladumeni

In the configuration of the payement module, have you set the "Generate Transaction on Confirmation" to "yes" ?

The first step is defenetily to get the form apear on the last checkout page....

wastedspace

Yes, I have now. And I see the Paypal form. When I submit an order through the sandbox, everything seems to work (ie. Paypal says it was a successful transaction), but when returning to the store, it says 'failure' - 'The payement of your order hasn't yet been confirmed by the payement gateway', etc. And also the order doesn't appear in the Orders list in Virtuemart. And no emails were sent to my customer email from VM.

There appears to be an entry in the temp table in the database however.

Any ideas? I presume it shouldn't matter if the customer is a registered user on the site or not?

Thanks :)

ladumeni

Hey wastedspace,

So the first step works, now it seems there are some problems with the notify_gen_transaction.php script. Questions:

a) Is this file on your server and is it accessible to be called by PayPal (to make sure call the file directly using a browser)?

b) For the IPN notification to work you need to set set up your Paypal sandbox correctly:
   
1. Enter into your sandbox business account
2.  Go to "my account" -> "profile" -> "Instant payment  notification" -> "Edit IPN settings" and enter your notification url (example: http://yoursite.com/administrator/component/com_virtuemart/notify_gen_transaction.php).  Finally check "Receive IPN messages (Enabled) ยป and save.

c) If your mail is set up correctly (joomla notifications) you should receive emails with status notifications (the emails have subject like "PayPal IPN XXXX"). Do you receive any if yes please post content?

d) Look at your php error log. There should be some entries if an error has been triggered through the notify script. Can you see any entries similar to "1. Finished Initialization of the notify.php script" ?

Cheers, larsen

wastedspace

Yes to all of the above, apart from c & d. Now I used to get Payapl IPN emails with the standard Paypal module. But not with this patched version.

I've looked in my error log, and there are a number of PHP notices (mostly about constants already being defined), but noticed one error that could be significant:

PHP Parse error:  syntax error, unexpected $end in mysitepath/administrator/components/com_virtuemart/notify_gen_transaction.php on line 572

I didn't however see any entries similar to "1. Finished Initialization of the notify.php script"...

Cheers,

Ali.

ladumeni

Indeed that error is significant. Very strange as this file has only 567 lines. I just downloaded the patch from our site to make sure there was no corruption and everything works fine here. If you call directly
http://www.yoursite.com/administrator/components/com_virtuemart/notify_gen_transaction.php do you get that error displayed ?

Try to upload again the notify_gen_transaction.php file just to make sure there is no corruption ...

Larsen

wastedspace

Thanks Larsen,

I think that was it. A corrupted file. I re-uploaded the notify file, and now receiving the purchase order AFTER payment, and also an email notifying me of the status update to confirmed. AND the order is 'confirmed' in the order list in VM. Woohoo!

A couple of points though:

1. After clicking the 'return to merchant' button on Paypal, it takes me back to the site, but I see an error - 'Order not found , 42_960eda3802d57edd763077248714a !'. I presume it's trying to find the order in the temp table in the database? But I guess you delete the order entry upon a successful transaction? So should the code be looking for the order in the main orders table instead?

2. I'd prefer when you first get taken to Paypal, to list the multiple items in your basket. I already have code that does this for the normal Paypal module, but I'll have a go an integrating it into the 'payement_extra_info.php' code...

Excellent work though! And many thanks for your prompt help.

Now I've also got to get this working with Worldpay... Will it be fairly seamless?