Closed Martin-1182 closed 2 years ago
Hi Martin!
I checked the SDK code and I didn't find any code that reformats the cod amount value. Can you double-check your code, please? (maybe somewhere you reset the cod amount value?)
Step 1, in parcel model:
$parcel = ParcelFactory::new()->model(['CODAmount' => round(29.899999999, 2)]);
output: ["CODAmount"]=>float(29.9)
Step 2, in the request:
$request = new PrepareLabels(); $request->addParcel($parcel);
output: ["CODAmount"]=>float(29.9)
Step 3, in the request payload:
$client->payload($request)
output: ["CODAmount"]=>float(29.9)
Thank you!
Hi, I've checked it many times. I will not rewrite or otherwise manipulate the amount of cash on delivery, I will just pull it out of the database and set it in the object. I don't get it, because not every amount is bad. It's irregular about every 5 cash on delivery has the wrong amount ...
Hi I have a problem with codamount. It is irregular that the amount of cash on delivery is set incorrectly. I have no idea where such a big float comes from when I pull out a double with the database and also round 2. I don't know where an error can be bit. Well thank you.
$parcel->setCodAmount(round($cart->codAmount($value), 2))
// 21.9
$request = new PrepareLabels();
--log obj $request[codAmount:protected] => 21.9
--log Client.php
$this->payload($request)
'CODAmount' => 21.899999999999999