I've seen various threads about Auto-Return and IPN on Drupal Commerce. I'm sorry to start my own but just wanted to clarify.
I am testing a new website with Paypal WPS via the Sandbox initially.
I have turned on auto-return on the Sandbox email account that Im using as the main Business account, aka the Sandbox user mysitetesting-facilitator@gmail.com that has a Business Account there.
(set as the 'PayPal e-mail address *' field on Paypal WPS [/admin/commerce/config/payment-methods/manage/commerce_payment_paypal_wps/edit/3]).
The other settings on that page I have are:
PayPal server: * Sandbox - use for testing, requires a PayPal Sandbox account
and
IPN logging: *Log notifications with the full IPN during validation and processing (used for debugging).
Im hoping to see something about IPN states/status in the /admin/reports/dblog but alas I only see commerce_paypal_wps send a 'Customer returned from PayPal with the following POST data:' which Im pretty sure I only get once I activated the Return Url on paypal.com... But this isnt the true IPN event correct? like if the user leaves paypal before it can redirect back to the website when order is completed.
After setting the return URL, my Orders have a status of 'Pending' but never see them completed.
Does IPN not working on Sandbox (in that POST data i see [test_ipn] => 1... does that mean i wont get a IPN returned since Im in a testing Sandbox mode or should it still run?)?
If it should run, any ideas for me to try to fix. Or is this one of those issues where IPN generally doesn't work well in Drupal Commerce and especially not well in Sandbox mode so I should start testing my site in Live Mode?
Notes:
1. I'm using the 'user' email that the Sandbox created for me to buy stuff, aka the mysitetesting-buyer@gmail.com who has a Personal Account
2. I don't have a 'Notification URL' set on paypal.com or 'Receive IPN messages (Enabled)' checked underneath it as I think Drupal Commerce dynamically sends the notification url via the initial visit to Paypal. Is that correct? or do I need to set them?
3. I have Auto-Return set as the main domain which seems to slightly help to at least moved from a 'Checkout: ???maybe Confirm or Payment???' state into a 'Pending' state if the user doesn't leave Paypal after completing payment and gets redirecting in browser back to my website.
Comments
Comment #2
armyofda12mnkeys commentedComment #3
armyofda12mnkeys commentedNote: hmm for first time i see "Attempt to validate IPN failed with error 400: Bad Request" i shall investigate/google it myself to see if a quick fix possible to get IPN working
Comment #4
armyofda12mnkeys commentedThink this issue is related:
Once i enabled this chr module according to steps here:
https://www.drupal.org/node/2263585#comment-11291333
then the sandbox IPN started working.
I now see in the logs in order:
Attempting to process IPN XYZ123456...etc..
IPN validated for Order 6 with ID XYZ123456...etc.
IPN processed for Order 6 with ID XYZ123456...etc
Seems good mostly but the Order status is still 'Pending', shouldn't it be 'Completed'?
I will wait a bit to see if it will change.
Comment #5
ericjenkins commentedThe instructions linked in #4 worked for me as well. I noticed that PayPal orders refuse to update on my local Drupal installation, but they work in our development environment. Maybe there is a firewall-related or SSL-related reason as to why Drupal Commerce orders update in one environment but not in another?