JeremyDunn / php-fedex-api-wrapper

This library provides a fluid interface for constructing requests to the FedEx web service API.
269 stars 184 forks source link

UAE Currency Issue with DHS and AED #174

Closed hmimthiaz closed 2 years ago

hmimthiaz commented 3 years ago

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.

github-actions[bot] commented 2 years ago

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

github-actions[bot] commented 2 years ago

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