0

I have read many discussions of this sort, but just couldn’t get my head around this issue.

I am testing my site locally and using paypal WPS as my module to process payments. As default, when my users are directed to paypal and makes the payment, they are not re-directed back to my site unless they click one of the paypal links to be redirected back and as a result no user account is created, no order is recorded and no order/welcome emails are fired, unless the user goes back to my site, which I do not want.

So I went to rules and replaced all the ‘Completing the checkout process’ events with ‘When an order is first paid in full’ events, so that I can have all the above actions triggered as soon as the payment is first made on paypal, but unluckily none of these rules are now working and I assume it’s because I am not receiving IPNs on localhost. I did look into the logs.

Here’s a quick list of questions I would need your advice on.

Q1. Am I really having these issues because of not receiving the IPNs in localhost. The way I looked for IPN was by looking into the admin>reports>Recent log messages. Please let me know if it’s the correct way?

Q2. If that is the reason, do I have to put my site live to test the IPNs. It might be a silly question but what if my users attempt to make payments while I my site is live and still in a test phase. Is there a way I can test this all locally first.

I hope it has nothing to do with rules and replacing all the ‘Completing the checkout process’ events with ‘When an order is first paid in full’ events is the right move to create accounts, orders and send emails when the payment is made, rather than when the user comes back to the site.

I am using xampp stack and paypal sandbox account to test my site.

  • do I have to put my site live to test the IPNs Definitely not, that's what the Sandbox system is for (assuming, of course, PayPal can reach you server through the network). PayPal have tools within their own developer centers that can help you debug the IPN, that would be the best place to look first. If you see anything other than 200 for the response codes, there's something wrong with the IPN delivery – Clive Nov 18 '15 at 14:47
  • Clive I read it at few places that paypal cannot send IPN to localhost. You have to make you site available to public somehow in order to receive the IPN, but if you say so, i will look into it. – Flora Merryfellow Nov 18 '15 at 15:12
  • Yes that's true, I mentioned the same thing in my comment... – Clive Nov 18 '15 at 15:55
  • I misunderstood it, but got your point now. Thanks :) – Flora Merryfellow Nov 18 '15 at 17:01
1

Q1

To test Paypal unfortunattely you need to test on a website which Paypal also can connect to. This is not necessaraly your live site. Maybe you should setup a test/demo environment somewhere else. If you don't want people to access that site you can setup an extra login with htpasswd, but it needs to be disabled during testing of the IPN. An easy way to do this is using the shield module.

Q2

You can always test using another payment method. For other tests I always use the Payment Example module which is provided with the Payment module in Drupal Commerce. This way you can test payments without having to deal with receiving IPNs.

  • I am happy to create my test/demo environment somewhere else, but how can i make sure whether paypal is able to connect to that environment/website. What if it doesnt connect to that envioronment too just like it doesnt connect to localhost. Are there some protocols or creteria to make sure. – Flora Merryfellow Nov 18 '15 at 15:07
  • If anyone can access the site from anywhere, Paypal can also connect to it. – absoludo Nov 18 '15 at 15:09
  • My payment workflow works perfectly fine as long as the user gets back to my site and I have similar settings in rules. As soon as I change the event to 'when the payment is first made in full' in rules, the payment workflow breaks .. Example module works fine because it has nothin to do with IPNs and it doesnt directs users off site .. – Flora Merryfellow Nov 18 '15 at 15:09
  • The Paypal WPS module does exactly the same, with the exception of the redirect and the IPN. The payment example module can be used to test the complete steps, the redirect back to your site can be made anywhere, even your local computer, but the IPN can only be posted in an environment which Paypal can send data to. So testing on a test/demo environment should work for your final tests. – absoludo Nov 18 '15 at 15:13
  • As long as my local site doesnt rely on IPN, all the orders, users and emails fire up in perfect order . It's only when I add a specific event ‘When an order is first paid in full’, all my orders, accounts and emails rely on receiving the IPN and so nothin fires up. So I guess I have to test my site in an evnioronment which is open to public as that is where my site can receive the IPNs. Thank you absoludo for giving me the direction :D – Flora Merryfellow Nov 18 '15 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.