C# 易趣API将配送地址转换为国际地址格式
我正在构建eBay应用程序,以获取买家的发货地址 我打电话给你 并接收此xml作为回报:C# 易趣API将配送地址转换为国际地址格式,c#,paypal,ebay-api,C#,Paypal,Ebay Api,我正在构建eBay应用程序,以获取买家的发货地址 我打电话给你 并接收此xml作为回报: <AddressAttribute type="AddressAttributeCodeType"> AddressAttributeType (string) </AddressAttribute> <AddressID> string </AddressID> <AddressOwner> AddressOwnerCodeTyp
<AddressAttribute type="AddressAttributeCodeType"> AddressAttributeType (string) </AddressAttribute>
<AddressID> string </AddressID>
<AddressOwner> AddressOwnerCodeType </AddressOwner>
<CityName> string </CityName>
<Country> CountryCodeType </Country>
<CountryName> string </CountryName>
<ExternalAddressID> string </ExternalAddressID>
<Name> string </Name>
<Phone> string </Phone>
<PostalCode> string </PostalCode>
<ReferenceID> string </ReferenceID>
<StateOrProvince> string </StateOrProvince>
<Street1> string </Street1>
<Street2> string </Street2>
</AddressAttribute >
如果国家为冰岛,则结果应为以下字符串:
Company
Name or Department
Street name + number + *apartment number (optional)
Postal code + Town
Country
Name
Streetname + Number
Complements
Postal code + Place
如果国家为美国,则结果应为:
Name of addressee
House number and street name
Name of town, State abbreviation + ZIP code
(typical handwritten format)
等等
我如何能自动做到这一点?我正在使用一个小页面,用PHP获取我的易趣物品详细信息。我还没有到那里,但一旦我进入地址打印,我也计划解决这个问题 我正在使用GetItemTransactions获取地址详细信息。这一呼吁有:
<Name>John Doe</Name>
<Street>Nowhere St. 11</Street>
<Street1>Nowhere St. 11</Street1>
<CityName>Berlin</CityName>
<StateOrProvince>
<Country>DE</Country>
<CountryName>Germany</CountryName>
<Phone>Invalid Request</Phone>
<PostalCode>11508</PostalCode>
我认为在开始时进行一些微调和监控非常简单。您可以读取C代码中的XML文件,并根据需要设置格式?
<Name>
<Street>
<Street1> // if not the same
<PostalCode><CityName>
<CountryName>
if($Country == 'UK|UK|CA|AU')
{
echo $CityName." ".$StateOrProvince." ".$PostalCode;
}