Closed bernatfabregat closed 4 years ago
Do you have some example code that can explain the issue?
Yes, just setting a price with decimals in a addItem request of Tradding API, like this:
$item->StartPrice = new Types\AmountType(["value" => 19.99]);
when I look up the generated xml, there is a comma! We have a standard Spanish configuration, and the direct conversion puts a comma.
Thanks!
Cheers for the example. Will take a look into the issue.
So just to confirm. At the moment doing the below in the SDK.
$item->StartPrice = new Types\AmountType(["value" => 19.99]);
Results in the following incorrect XML been generated?
<StartPrice>19,99</StartPrince>
And that the SDK should ignore the locale settings and instead generate
<StartPrice>19.99</StartPrince>
Exactly!
Hi, In my locale configuration (Spain), the decimal separator is comma and, I suppose, the direct conversion of a double value (like amounts) to string in xml request build, sets the property with comma, and API rejects it. I cannot change my locale configuration (Spanish users use to use the comma). But, anyway, the conversion should always use a dot. Now I correct this in my code using number_format (\DTS\eBaySDK\Types\BaseType::encodeValueXml, line 586) but, it will be interesting to keep on using the repository code. And, thanks for the great work with this SDK!