Magento - routing to paypal IPN script - magento

I have a multi language site and am having Magento (1.7.0.2) "Add Store Code to Urls" (config/system/web).
I have overridden the app/code/core/Mage/Paypal with my own app/code/local/Mage/Paypal as I have added extra backend functionality.
I can hit the IPN scripts manually (as expected) through the URL by going to:
mysite.com/uk/paypal/ipn/ in the browser (which shows as a GET request in my apache access log, with a 200 status). However when paypal posts to the same URL (which shows as a POST request in the log) it results in a 404.
I don't understand why there is a difference in GET and POST to this URL but maybe it is something to do with Magento's routing?
Anyway, what can I do so that the IPN script can be hit by paypal, and I can still use store codes in the URLs?

After logging each class method I found that Magneto was trying to load a website with $scopeCode = 'us' in run() method in /var/www/simplesteps/site/src/app/code/core/Mage/Core/Model/App.php.
This is a throw-back to the time when we have a USA website, but this website had been removed, yet a reference to it was being used.
I am not sure where this reference was being set, after looking through CMS settings I could not find it. If anyone could tell me I'd appreciate that.
I fixed the issue by reinstating the USA website, which, it turns out should not have been removed.
The reason the IPN script was being correctly hit through the browser URL (GET 200) but not paypal (POST 404) is probably to do with it being called within the scope of the active website via the URL, and not a default or legacy reference to US site.
Hope this helps someone who may find a similar frustrating situation.

Related

Shipping methods are not showing at checkout. estimate shipping methods giving 404

Whenever we go the checkout page on step 1 it shows no shipping methond
On debug found taht https://base-url/rest/V1/carts/mine/estimate-shipping-methods is giving 404.
As you can see in this screenshot
Tried ways
Enabled the swagger and check whether this end point available or not. It was avaialbe.
Create one other custom api to check whether it is calling or not. Our custom api was also giving 404. As you can see in this screenshot
After tried many different ways we found this one was the issue of the varnish cache. So if you are also facing this issue then please confirm whether cart pages are cached or not. The cart pages are never supposed to be cached.
So add a rule in default Varnish configuration where some of the routes concerning checkout by default are bypassed from being cached.
Hopefully bypassing the path "carts" and "rest" to make it work fine for your store.
Thank You!
Abbas

What is the correct magento CE 1.9 paypal success url?

We have magento CE 1.9 which we are trying to get some analytics on and I have seen many posts on the internet about setting up paypal with magento. I believe we have everything setup correctly for paypal standard checkout except for the return URL.
Some of the sources I found on the internet say to use
http://www.storename.com/checkout/onepage/success/
Where others say to use
http://www.storename.com/paypal/standard/success/
which one is actually correct?
An order finally reached analytics via:
http://www.storename.com/paypal/standard/success/
Other orders were completed but did not reach alalytics, I can only speculate on the reason for this. One possible cause I have read about, is premature closing of the browser window. This could prevent our sites success page from loading the analytics javascript.

Magento - Checkout not redirecting to success page

I'm working on a store deployed using Magento. It has one module which I wrote, which has event observers for checkout_type_onepage_save_order_after, checkout_type_multishipping_create_orders_saved_after, and admin_created_order_after.
When a customer places his/her order, Magento does not redirect to a success page when my module is enabled. When I disable my module, it redirects just fine. With or without my module, the order still goes through but it's not very user-friendly if there's no thank you message of some kind.
Anyone have any ideas what the problem is? There's no entry in any error log (Apache, PHP, Magento, or database).
Using magento 1.6.2.0 on PHP 5.
In case anyone else is having the same or similar problem, I just solved a very similar issue thanks to TonyTheJet's comment here. I am using onepagecheckout in Magento CE 1.7.02
If you have a stray echo command in your code, which will send raw text to the browser, this will cause a problem on the browser side in onepagecheckout.js . It does not correctly un-encode a subsequent JSON string sent by the server to say that the order was processed successfully. Because of that, the browser fails to send a GET to trigger the onepagecheckout controller successAction().
If you are using a protocol analyser or a tool like Firefox Firebug, the crucial JSON string should look like this. The order_creates=true is what should trigger a browser request for the success page:
{"success":true,"error":false,"order_created":true}

Magento 'place order' redirects to shopping cart

Every time I try to place an order rather than an order actually being placed I simply get redirected to the shopping cart.
Paypal express works fine however paypal standard payments gets the problem as above.
Lucas
You have to examine the ajax request. You can use Firefox with the "HTTPfox" extension to track the single requests. Just look for the step, where the redirect is executed - and start the http tracker. Then you see the response.
In the response you can see, what went wrong. I've got this error some weeks ago and it printed a full html page (with the report-number you can look up in the var/log/reports folder) or you can see a php error (maybe syntax error or bad sql query for example). If you get a blank page, you have to set the error_reporting to E_ALL.
I thinkk that step is help.
Log into Magento Admin
Hover over "System" Click "Configuration"
On the next page in the left menu under "Advanced"
Under the check "Mage_Paypal" is Enable or Disable. if is Disable then Enable this options.
Then After the paypal is not redirect to paypal site. then please check your template code.
hope this will sure help you

Magento Payment Module like PayPal (external URL redirect)

i need help in magento payment module programming.
I want to develop a payment module for magento which should working like the "PayPal Standard Payment".
The Module in the backend is done. I can choose my new module and can activate/deactivate it.
In The Frontend i see my new payment-type on the Payment-Information site.
Now, the next step which i don't know how to start it is, to tell magento, when my new payment-type is chosen and the order is placed, redirect to the acquirers site(and send chosen data with POST-form), where the customer can fill his credit card informations and so on.
I have searched for information and tutorials but still not found any good tutorials.
Thanks a lot for any helpful answers,
brush51
If you go to Mage_Checkout_OnepageController and in savePaymentAction you can see that it loads the redirect url in session.
So what you need to do is, you implement in your payment model the method getCheckoutRedirectUrl() which basically returns the url from config or from hard coded value.
Magento will handle the rest.

Resources