dongyanju0945 2016-03-10 17:07
浏览 22

Fedex如何在PHP中设置首选货币

Fedex seems to have very intuitive documentation and no code samples (besides the downloaded modules). I want to change the currency for the rates from fedex. In documentation/XML file I have found something like preferredCurrency. Similar to other attributes I'm trying to set it like this:

if($var == 'preferredcurrency') Return 'HUF';

but this is totally ignored (I tried also PreferredCurrency) and the returned rate is always $USD. Anyone is familiar with FEDEX API and can help?

UPDATE:

It's basically about requesting and receiving response. I have some function where I set parameters like:

function getProperty($var){
if($var == 'shipper') Return array(
        'Contact' => array(
            'PersonName' => 'Sender Name',
            'CompanyName' => 'Sender Company Name',
            'PhoneNumber' => '1234567890'
        ),
        'Address' => array(
            'StreetLines' => array('Address Line 1'),
            'City' => 'SomeCity',
            'StateOrProvinceCode' => 'SomeState',
            'PostalCode' => '3434343',
            'CountryCode' => 'US',
            'Residential' => 1
        )
    );
}

and then in another file a request to fedex is made, like :

$request['RequestedShipment']['Shipper'] = array(
    'Address'=>getProperty('address1')
); 

All of this values are defined in an XML file, I'm trying to get rate including CurrencyExchangeRate like this:

$request['CurrencyExchangeRate'] = array(
    'FromCurrency' => array('USD'),
    'IntoCurrency' => array('HUF'),
    'Rate' => array(1.0)
);

But this request is ignored and I don't know why.

  • 写回答

1条回答 默认 最新

  • dongtu4028 2018-01-09 07:26
    关注

    Maybe you just have a misssing Element. The Docs are here: Shipment Docs.

    $request['RequestedShipment']['PreferredCurrency'] = 'HUF' and $request['RequestedShipment']['RateRequestTypes'] = 'PREFERRED'

    评论

报告相同问题?

悬赏问题

  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢
  • ¥15 不小心不正规的开发公司导致不给我们y码,