JeremyDunn/php-fedex-api-wrapper

UAE Currency Issue with DHS and AED

hmimthiaz opened this issue · 2 comments

Woocommerce Currency for UAE is AED and fedex backend returns the currency value in DHS. We spoke to Fedex and they are not able to give a solution. So I made a quick hack on the plugin and please check if it is worth including to your next update.

File: php-fedex-api-wrapper/src/FedEx/RateService/ComplexType/Money.php

Change:

     public function setCurrency($currency)
     {
+        if (defined('OVERRIDE_FEDEX_MONEY_DHS_TO_AED')) {
+            if ($currency == 'DHS') {
+                $currency = 'AED';
+            }
+        }
         $this->values['Currency'] = $currency;
         return $this;
     }

CleanShot 2021-04-18 at 13 05 28@2x

This will work only if the constant is defined else it will work as expected.

This issue is stale because it has been open for 30 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.