There always comes the time when shopkeeper decides that he want’s to inform his customer of shipping estimate on checkout, so they could know approximately when they will get their goods. And for that, many shops today rely on API-s like ones from USPS or FedEx. Both of which are available for Magento.
In this article I will be showing you how to override FedEx carrier to return shipping estimate for given rates.
We have already went through on how to configure integration and utilize Magento apis. But let’s see how to make our own module with custom API calls.
For those that don’t know, Magento added REST server functionality since version 1.7.0 < .
Before that, Magento had SOAP and XML-RPC server implementations which are also implemented in newest Magento versions.
I have to admit that even I had a lot of experience with Magento SOAP web services, it took a little bit time even for experienced developer like me, to figure out how Magento REST is implemented and how to take advantage of it. The biggest reason for that is the lack of official documentation.
When trying to access Magento SOAP web services v2 from Android, after some searching on web, I found that ksoap2-android project could be useful to implement SOAP client in android project. (Ksoap2-android is lightweight and efficient SOAP client library for android platform).
Next step was to figure-out how to use it.
After some additional investigation, I found that it is pretty simple to use, when you get used to it once.
Last few weeks, i often see confused people asking questions about difference between Magento’s API v1 and v2, and also bunch of questions about how to use WSDL and WS-I files when developing own or extending existing Magento soap API v2.
It is obvious that short articles about specific Magento API parts will not help them to get the bigger picture about Magento core API v2. Because of that, I decided to demystify practical usage of Magento API v2 and also to explain difference when using v1 and/or v2 API.
Let’s start from beginning, to everything clear later:
Using xDebug from NetBeans is pretty straightforward and after installing xDebug from their website does not require some special configuration in order to make it work.
If you visit the link above, you will notice that it’s enough to paste the source code of your phpinfo() and you will get directions what xDebug binary to download and how to set it.
In previous article, I wrote about setting up environment for Magento unit testing. Let’s expand our tests to test some Magento’s API calls with soap.
In some of previous posts on inchoo.net, colleague of mine – Branko Ajzele wrote about extending Magento API – v1.
Let say that mine extension is called: Inchoo Mapy and I will extend the customer API V2 first.
Although Magento has pretty rich set of API calls, in my project I found that some of the API calls should be extended to fit our project needs. In later posts I will write about that specific needs and possibilities, but now let’s concentrate to extending core API V2 first.
If you are in the business of developing a mobile application or external web/desktop or some other application/service that needs to communicate with Magento trough its API, then my friend you are out of luck. I am not going to say Magento API is a trash, I’ll simply say it massively lacks certain methods within the existing exposed classes that will make your external application usable.