News:

Support the VirtueMart project and become a member

Main Menu

PayPal Payment completed status - missing!?

Started by atb, December 16, 2011, 20:45:26 PM

Previous topic - Next topic

atb

Hi,
So, I have succeeded in getting a PayPal (Sandbox) payment made and acknowledged, with a link back to the Shop by adding a blank file "..\components\com_virtuemart\views\cart\tmplmail_raw_footer.php", as suggested.   I do not know what the intended content of this file, whether it is purely for rendering the result and/or performing other operations.

However, as it is, I note that NO CHANGE of status of an Order appears to take place!  Surely some element within the table
"virtuemart_payment_plg_paypal" should change in order that the payment acceptance is recorded as confirmed.  Currently the status remains as "Pending", which may be correct.  But surely one of the "paypal_response_...." data items should change state and then be reflected in the "Purchase Order" screen of the Back End "Orders & Shoppers  Orders" screen.  Also presumably the "Paid" status should be visible on the Front End, other than the initial hand-back from PayPal.

By the way, there are also many other data fields in the Back-end "Purchase Order" view for each Order (under "Payment Method") BUT they are all "0"!



VM1.7.3  JM RC3(final)  IE8

alatak

#1
Hi

QuoteI do not know what the intended content of this file, whether it is purely for rendering the result and/or performing other operations.
The file will be overwritten when you will update with the final version.
It contains vendor infos.

Concerning Paypal, please turn on the debug in the Vm Paypal config. It logs the info of the transaction in file placed in [root of your site]/log/paypal.log, and send it to me.

alatak

Hi,

I have checked with the RC3 version and Joomla 1.7.3. Evrything works fine for me.
To check why it is not working for you, i need the log file.

atb

#3
Quote from: alatak on December 17, 2011, 15:52:43 PM
Hi

Concerning Paypal, please turn on the debug in the Vm Paypal config. It logs the info of the transaction in file placed in [root of your site]/log/paypal.log, and send it to me.

Hi, thanks for the response. I have tried again, after setting on the PayPal log - the order still remains at "Pending".
So here is the further info:
The PayPal log file seems OK.
2011-12-17 20:37:15
message: plgVmConfirmedOrder order number: 2690466b

However the Confirmation email is incorrect as the root name (dec7) is stated twice hence fails.  But if the link is edited to a single instance of the root name then the page is available (which is where the "Pending" status still persists.
Note: The IP is the local address of a Windows2003/IIS6 server, which is also accessible through the NAT router using a public IP address, which is what is entered in the "Shop" information URL, not the local IP (This propably provides the clue to the problem)
Confirmation email link:
  http://192.168.20.99/dec7//dec7/index.php/component/virtuemart/orders/details?order_number=2690466b&order_pass=p_79cf99


Update:  Ah, I reckon there may be an issue relating to use of a Web site that is not at the actual system root, i.e. in this case it is ...root\dec7\.   In which case the Web address is concatenated with a VM file location which then creates the duplication.  In the case of a Web site actually at the root of an IP address then nothing will be concatenated with nothing and hence, in this case would would have been
http://192.168.20.99/index.php/component/virtuemart/........  , which would then work!
Thus, it appears to me that it was because I had set up a Web site within a sub-folder, which in basic non VM mode, would work correctly as a Web site at http://192.168.20.99/dec7/index.php or its public IP equivalent.

Further update:
"Admin" does receive an email "....confirmed an order with a total...", not the "Order Unknown" message.  Hence the fact that "Pending" is not updated to "Confirmed" must occur later than line 344 in paypal.php.

JM1.7.3  VM RC3(final)  IE8   Server: local Windows 2003 Server IIS6, public access for testing only on port 80 forwarded via NAT router.

alatak

Hi,

Txs for this nice big answer.

Quotemessage: plgVmConfirmedOrder order number: 2690466b
This log message means that the order has been created, and that the redirection to Paypal has been done.
The order workflow is the following:
1) create the order
2) redirect to Paypal
then 2 possibilities:
1) the shopper uses cancel and returns back to the web site: the order is deleted, the cart is ther, the shopper can either add a new product, either change his payment method because may be he does not have money on Paypal for example
2) the shopper pays via Paypal. Paypal send an IPN notification, the VM order status is updates according to Paypal status. IPN notification is a server to server call., which means, that you web site must be accessible from the outside world.

You are using an adress 192.168.20.x : it is a local address. Paypal cannot reach your website, therefore, the order status is not updated.
I can also see that , because in your log file you don't have messages "IPN notification".


QuoteFurther update:
"Admin" does receive an email "....confirmed an order with a total...", not the "Order Unknown" message.  Hence the fact that "Pending" is not updated to "Confirmed" must occur later than line 344 in paypal.php.
Thatis what I don't understand.  You should have that also in your log file
"ERROR plgVmOnPaymentNotification: virtuemart_order_id not found "
together with the email.


atb

Hi, thanks for the response

Quote from: alatak on December 18, 2011, 16:25:27 PM
2) the shopper pays via Paypal. Paypal send an IPN notification, the VM order status is updates according to Paypal status. IPN notification is a server to server call., which means, that you web site must be accessible from the outside world.

You are using an adress 192.168.20.x : it is a local address. Paypal cannot reach your website, therefore, the order status is not updated.
I can also see that , because in your log file you don't have messages "IPN notification".
Yes, I understand the local IP issue.  However I have not found how PayPal receives the IP address of my server.  I did code the public IP address into the VM Shop detail but clearly that does not work.  Could you please explain how my server's  IP is discovered and passed to the PayPal payment request? 
I have tried to provide my local IIS6 server with dual IP references (local & public), but that did not help.   The server is externally accessible, but clearly the public IP has to be passed to PayPal.

The other issue was the problem with the incorrect path sent in the return email, which I presume is caused by my use of a "sub-Web" (in this case"root\dec7) mode of operation, where the Web site is not at the main root of the server. The incorrect confirmation link is:
  http://192.168.20.99/dec7//dec7/index.php/component/virtuemart/orders/details?order_number=2690466b&order_pass=p_79cf99
Can you identify in the code (presumably paypal.php) where the URL reference is formed, as it seems to duplicate the sub folder name, presumably by taking the "dec7" directory name as the end part of the IP address AND the initial part of the local file reference (including the 2 // between this duplication!).
I would imagine that this problem would disappear if I moved the test side to the main root, but it may be worth ensuring that VM could manage in the case where a "sub-Web" location is used. 

Thanks

Milbo

The IP is NOT transmitted within the content.

The IP comes from the TCP/IP protokoll, you cant change it and when you do, then you get problems with ssl and so on.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

atb

Quote from: Milbo on December 19, 2011, 13:26:43 PM
The IP is NOT transmitted within the content.

The IP comes from the TCP/IP protokoll, you cant change it and when you do, then you get problems with ssl and so on.

Thanks for that  information - I believe that I can provide dual (private & public)  IPs for the local IIS6 Web server, but that is well outside the scope of assistance from this forum, so I'll take that aspect as finished.

However, I would still like to persue the "sub-Web" component of the question.  If you reckon that hosting a Web site at a sub-directory is too off-beat I will understand, but I reckon that it does happen and is legitimate.