VM doesn't recognize the payment status when using PayPal

Started by melingmeier, June 03, 2012, 23:16:52 PM

Previous topic - Next topic

cas

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

jjk

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
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

cas

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? 

jjk

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.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

cas

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.

alatak

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

alatak

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?

cas

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