If you’ve built an online store on Magento 1.x, you’ve definitely come to the point of adding at least one shipping method and a payment method too.
This article is meant for those who chose to use FAN Courier as their main shipping option and PayU as a payment service provider and discovered that there are some tweaks to be made.
Magento 1.x and FAN Courier go a long way together. You can find modules and extensions provided by FAN Courier for some of the most used eCommerce platforms in Romania like Magento, OpenCart, Prestashop and WooCommerce. If you want to find out the top 5 eCommerce platforms used in 2016 you can read our article about this topic. We also wrote another one about the strengths and weaknesses for some of these eCommerce solutions.
I came across several things when we implemented FAN Courier:
- Having diacritics in our regions (like Neamț) was causing some troubles when creating an API request to FAN Courier due to the encoding.
- Having cities with multiple words like “Piatra Neamt” broke the generated URL FAN Courier used to build a request.
- Having a onepage checkout meant we needed to use the default region, city, street and postcode set in the admin and use them to get an initial shipping estimation.
We only encountered one issue with the official PayU module version 1.0.1 and that was that we kept receiving the error “PayU returned “Invalid Signature” for order”. The reason for this is because the signature is calculated based on a string composed of the values below with their corresponding lengths prepended. The parameters that composed the string are the following, in the exact same order:
Figure 1. Parameters that have to be sent to PayU in this exact same order to enable the payment request. More info in the PayU Implementation Manual.
We were missing the ‘DESTINATION_STATE’ and ‘SELECTED_INSTALLMENTS_NO’ parameters which was causing the “Invalid signature” error thrown.
After adding these two extra parameters, we could successfully place orders on our store.
I hope these small tips helped you in debugging your shipment and payment modules used in your online store. Feel free to comment if you found other issues when you implemented FAN Courier and/or PayU.