VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: melingmeier on June 03, 2012, 23:16:52 PM

Title: VM doesn't recognize the payment status when using PayPal
Post by: melingmeier on June 03, 2012, 23:16:52 PM
According to the unregarded Thread in the payment section I want to ask for support because of a serious bug in the paypal module.
http://forum.virtuemart.net/index.php?topic=96896.0 (http://forum.virtuemart.net/index.php?topic=96896.0)

With VM1 the Paypal payment works perfect.

Now with VM2 it doesnt recognize the payment status after the payment process. Currently with 2.0.6 there is an order saved in the database everytime a user is forwarded to the paypal site, even the payment was not successful. If it was, the status stays the same and VM ignores the settings I made under Paypal/configuration/back to shop (Sucessfull transaction=Order Confirmed).

Nice to have: It would be nice if the customer would be redirected to my shop after paying automaticaly.

Does someone work on this? I guess for a lot of users with small shops the paypal module is very essential, so it would be great if you could focus on that issue. Thanks for your help and for this great shopsystem
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: DaggaTora on July 16, 2012, 11:23:52 AM
Same here with 2.0.8d.

If you go to paypal an order appears in the BE without payment. If you reload page, one more order.

Once paid, order status remains pending.
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: Garf on July 27, 2012, 12:46:55 PM
Me three.....   Joomla 2.5, VM 2.06 /2.08  My BE order isn't even populating with the $POST data returned from PayPal. The PayPal data is accurate and completed. Order is created and status remains Pending. Anyone have a working solution?



Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: slammy on August 03, 2012, 18:25:14 PM
hi,

I´ve just tested paypal today in sandbox-mode with vm SR 2.0.8_e and jml 2.5.6 on a testenvironment.
I have the same issue: After paying and without paying, virtuemart stores an order in the backend and orderstatus won´t be updated the configured way.

Whatever I choose under

VM backend -> Payments -> Paypal -> status for successfull payment
OR
VM backend -> Payments -> Paypal -> status for cancelled transactions

the order in the backend still stays on "pending", both with success- and unsuccessfull payments.
I will give it a test this weekend without sandbox-environment and post my finals here.

regards slammy
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: DaggaTora on August 03, 2012, 18:43:25 PM
I solved setting the ipn in paypal!
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: Garf on August 03, 2012, 21:31:39 PM
Quote from: DaggaTora on August 03, 2012, 18:43:25 PM
I solved setting the ipn in paypal!

Hey DaggaTora,

Can you say a little more about what you did to fix this? Are you speaking the sandbox or live version?

Quote from: slammy on August 03, 2012, 18:25:14 PM
hi,

I´ve just tested paypal today in sandbox-mode with vm SR 2.0.8_e and jml 2.5.6 on a test environment.
I have the same issue: After paying and without paying, virtuemart stores an order in the back end and order status won´t be updated the configured way.

Whatever I choose under

VM backend -> Payments -> Paypal -> status for successful payment
OR
VM backend -> Payments -> Paypal -> status for cancelled transactions

the order in the back end still stays on "pending", both with successful and unsuccessful payments.
I will give it a test this weekend without sandbox-environment and post my finals here.

regards slammy

Hi slammy,

Not sure this will help you, but when I setup a XAMPP environment on my development machine, used noip.com to create a dynamic port and set my router to NAT port 80 to my machine, transactions record and complete properly. However, as soon as I debug (curerently using NuSPhere) , the message is returned properly from PayPal in the $Global_Post variable and I can see it is completed successfully, but it is not being recognized by VM to update the order status or record the IPN information returned. It looks like VM always writes the cart as an order now, and records IPN information secondary in the PayPal section of the order if it gets some.

I've tested this both with my dynamic DNS so http://test.hopto.org  as well as http://localhost . . . localhost does not work.

If I try to debug paypal and VM, I get the correct response, but it does not write to the order. I see this response in the $GLOBALS_POST variable being returned as well as the debug message from VM:

vmdebug MONEYBOOKERS plgVmOnPaymentResponseReceived Var1:
Array
(
    [mc_gross] => 129.00
    [invoice] => cfec07
    [protection_eligibility] => Ineligible
    [payer_id] => EP2L8DBDR9828
    [tax] => 0.00
    [payment_date] => 12:18:07 Aug 03, 2012 PDT
    [payment_status] => Completed
    [charset] => windows-1252
    [first_name] => john
    [mc_fee] => 4.04
    [notify_version] => 3.5
    [custom] => eqeogfc5fdegvje6b0trdr3p17
    [payer_status] => verified
    [business] => gflaud_1343079866_biz@hotmail.com
    [quantity] => 1
    [payer_email] => japple_1340168166_per@hotmail.com
    [verify_sign] => AMTkCwXjaT5qE5-sX2q-lN2asrdXArkgLcM9lTAuvDpC-5U3JQVetAR4
    [txn_id] => 00791098S1894612J
    [payment_type] => instant
    [last_name] => apple
    [receiver_email] => gflaud_1343079866_biz@hotmail.com
    [payment_fee] =>
    [receiver_id] => N9NKCB23LFXFA
    [txn_type] => web_accept
    [item_name] => Order Number: cfec07
    [mc_currency] => CAD
    [item_number] =>
    [residence_country] => CA
    [test_ipn] => 1
    [handling_amount] => 0.00
    [transaction_subject] => eqeogfc5fdegvje6b0trdr3p17
    [payment_gross] =>
    [shipping] => 0.00
)


Does anyone know the exact point where the returned IPN is checked in the code to determine if a proper response was received? I'm at a loss to describe why VM is not posting when I have an external debugger running using the very same address and seeing the data returned properly! ...just VM refuses to update the data????

Cheers,

Garf


Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: DaggaTora on August 03, 2012, 21:48:07 PM
:) Of course, but i don't know what else to say. Worrying about why google analytics didn't get my transactions with virtuemart i found this plugin: System - Virtuemart Tracking Extension and installing it i discover that i had to go to my profile in paypal and enable IPN entering: www.yoursite.xxx/index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&pm=YOUR_PAYMENTH_METHOD_ID

hope it helps!
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on February 12, 2013, 02:47:36 AM
I have the same problem with VM2.0.18a.  It doesn't change the order status after the payment is processed.  It remains as Pending.  Is there a fix for this? 
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on March 01, 2013, 01:04:38 AM
Any update on this?  The VM status remains as Pending after a sale.  What are we suppose to change to get this to work?
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on March 09, 2013, 21:57:06 PM
Any update on when this will be fixed?
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: jjk on March 09, 2013, 23:07:37 PM
@cas
just in case you missed it - did you check for example this already? http://forum.virtuemart.net/index.php?topic=104994.msg349666#msg349666 (http://forum.virtuemart.net/index.php?topic=104994.msg349666#msg349666)
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on March 10, 2013, 00:30:49 AM
Maybe I don't understand correctly, but when I read the link in your post, it looks like that's for when PayPal puts the status to "Payment Review".   I don't have that situation.  In my case the payment goes through PayPal just fine, but the VM status remains as Pending after the sale.  How do I get the VM status to change to Confirmed when the sale goes through?

Thanks,
Chuck
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: jjk on March 10, 2013, 20:32:13 PM
If you look at an order, which was paid with PayPal, which information do you have in the ipn fields, marked red in the screenshot below?
Also, please check the setting in your payment method configuration for PayPal 'Order Status for Successful transactions'. I suppose it should be set to 'Confirmed'.

[attachment cleanup by admin]
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on March 10, 2013, 21:53:59 PM
This is all I have in the Payment Method section of an Order.  As you can see it's missing most of the info that's shown in your order.   And this is an order that was successfully paid for with PayPal via VM.

[attachment cleanup by admin]
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: alatak on March 12, 2013, 08:59:01 AM
Hello
Can the reason be that one: http://forum.virtuemart.net/index.php?topic=113773.msg383056#msg383056
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on March 14, 2013, 00:31:28 AM
Quote from: alatak on March 12, 2013, 08:59:01 AM
Hello
Can the reason be that one: http://forum.virtuemart.net/index.php?topic=113773.msg383056#msg383056

I do not get any errors.  Everything works fine, except the order status is left in the Pending status even after the customer pays using PayPal.  I'm just wondering if there is some additional setup in VM or PayPal that I am suppose to do?

Thanks,
Chuck
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: jjk on March 14, 2013, 09:03:14 AM
Just in case you didn't read this already :-)
http://forum.virtuemart.net/index.php?topic=110463.0

I suppose you do have a 'merchant' account at PayPal and your shop email address ist listed in your PayPal account and you are using the VirtueMart PayPal implementation and not any third party PayPal plugin...

Maybe have a look at this again for troubleshooting ideas: https://www.x.com/developers/paypal/documentation-tools/ipn/integration-guide/IPNTesting
and http://www.paypalobjects.com/en_US/ebook/PP_OrderManagement_IntegrationGuide/ipn.html (http://www.paypalobjects.com/en_US/ebook/PP_OrderManagement_IntegrationGuide/ipn.html)
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on March 20, 2013, 07:51:23 AM
Here is what I discovered from going through topic: http://forum.virtuemart.net/index.php?topic=110463.0

The PayPal HTTP response code is 200, so that is good.  But when I look at the table #_virtuemart_payment_plg_paypal' on column paypalresponse_raw, the data is cut off at 512 characters based on the column defined as varchar(512).  In PayPal the same record IPN Message contains 1048 characters.  Could this be why the status in VM remains as Pending even though all else works fine?  or is there something else I should check? 
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: jjk on March 20, 2013, 10:03:01 AM
Just checked the entries in my paypalresponse_raw fields. Entries are truncated after 512 characters indeed, but nevertheless payment statuses work.
But reading the entries I have, I noticed that PayPal sends them encoded charset=windows-1252. You might check the language encoding in your PayPal account profile. (Difficult to find when logged into PayPal - I only found it using the search field on their help page). I don't have an encoding selected in my account (fields are blank). Perhaps it works if you set it to utf-8.
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on March 21, 2013, 04:47:50 AM
It worked!  And you're right that it was hard to find the language encoding page in PayPal.  In my case both fields were set to Windows-1252, so when I set them both to utf-8 or blank, it worked.  I tried both utf-8 and blank and it worked both ways, so I left them set to blank like yours is set.  Now when a product is paid for in PayPal, the VM order status is automatically changed from Pending to Confirmed.  Thanks for the help!

For anyone else with the same problem, here is what I did:

Login to PayPal and click the "Profile" menu item, then click on "My Selling Tools" on the left side, and then at the bottom of the page click on the link "PayPal Button Language Encoding", then click the button "More Options".  This will open the page where the two encoding fields are located.  Set both fields to blank and save it.  Now when a product is paid for with PayPal, it will change the status in the VM order to Confirmed.
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: alatak on March 25, 2013, 13:51:46 PM
Hello

concerning the character encoding, i have done the following change:
in the file plugins/vmpayment/paypal/paypal.php
line 270
old line:
$html .= '<form action="' . "https://" . $url . '" method="post" name="vm_paypal_form"  accept-charset="UTF-8">';

replaced by:
replaced by
$html .= '<form action="' . "https://" . $url . '" method="post" name="vm_paypal_form"  accept-charset="UTF-8">';


and added this line
$html .='<input type="hidden" name="charset" value="utf-8">';

In my case with french characters it works
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: alatak on March 26, 2013, 18:47:10 PM
Hello
I think i found one possibilble reason for the order not being confirmed
In some case, the url rewritting is not done properly for the notify URL
Can you try by replacing

in file
plugins/vmpayment/paypal/paypal.php
replace
    "notify_url" => JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component'),

with
"notify_url" =>  JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component',


@cas: can you try that?
Title: Re: VM doesn't recognize the payment status when using PayPal
Post by: cas on March 27, 2013, 01:26:30 AM
Hi Valerie,

Mine started working correctly on March 20 when I did what jjk told me try by going into PayPal and changing the language encoding from windows-1252 to either blank or utf-8. 

Regards,
Chuck