Payment inconsistency occur on manual order.Finalize()
Hi Team,
There is an unusual issue found on a product that is a bundle. When finalizing order with the authorized amount. It ends up on an Inconsistent payment.
What could be the reasons?
I'm guessing it could be a rounding issue. In our payment providers we use order.TotalPrice.Value.WithVat which is a decimal, when you use WithVatFormattedWithoutSymbol this will be a string rounded to 2 decimal places.
Thanks, but in this case that is not the issue.I've tried order.TotalPrice.Value.WithVat too doesn't work. Actually it is not just a rounded value issue . Payment authorized and Finalized is having quite a big difference and vat also reduced.
PFA of my logs
No issues on another product not bundles with the same code.
Hmm, so just before finalize it all appears correct, but as soon as you finalize, it becomes different?
Do you have anything else hooked into the finalize event that could be altering the price? It appears to be a difference of 100 which is kind of a but suspicious.
Yeah sure,
In this case, we're using ManualFreight as a payment method. It means that a normal invoicing. But we've other payment methods like quikpay and invoicing with shipping API price that is fetched from TNT shipping api and we need to do add that shipping amount from TNT to our order shipping price. In this case, we using ShippingCalculator.
We've some custom logics for payment methods so we just created payments and do the API call and calculation from our code. So we need a manual order Finalize with our custom amounts
The code snippet I mentioned above is simply for an invoicing.
And the funny part is it is working on my local with bundle products too
Hmm, the best I could suggest at this moment is to maybe add a bunch of logging into your custom calculators to see if they are calculating what you expect as the TotalPrice is generated from a bunch of things, including those, so you really want to try and rule out your custom code first.
Payment inconsistency occur on manual order.Finalize()
Hi Team,
There is an unusual issue found on a product that is a bundle. When finalizing order with the authorized amount. It ends up on an Inconsistent payment. What could be the reasons?
PFA sample code snippet
Hi Vineeth,
I'm guessing it could be a rounding issue. In our payment providers we use
order.TotalPrice.Value.WithVat
which is a decimal, when you useWithVatFormattedWithoutSymbol
this will be a string rounded to 2 decimal places.Try switching them over and see if that helps
Matt
Thanks, but in this case that is not the issue.I've tried order.TotalPrice.Value.WithVat too doesn't work. Actually it is not just a rounded value issue . Payment authorized and Finalized is having quite a big difference and vat also reduced.
PFA of my logs
No issues on another product not bundles with the same code.
Hmm, so just before finalize it all appears correct, but as soon as you finalize, it becomes different?
Do you have anything else hooked into the finalize event that could be altering the price? It appears to be a difference of 100 which is kind of a but suspicious.
Yes exactly that is happening,
We're using OrderLineCalculator and ShippingCalculator.
From where is your method being called? Generally Finalize is only called via a payment provider, but it doesn't look like that's what this is.
Can you explain your flow?
Yeah sure, In this case, we're using ManualFreight as a payment method. It means that a normal invoicing. But we've other payment methods like quikpay and invoicing with shipping API price that is fetched from TNT shipping api and we need to do add that shipping amount from TNT to our order shipping price. In this case, we using ShippingCalculator.
We've some custom logics for payment methods so we just created payments and do the API call and calculation from our code. So we need a manual order Finalize with our custom amounts
The code snippet I mentioned above is simply for an invoicing.
And the funny part is it is working on my local with bundle products too
Hmm, the best I could suggest at this moment is to maybe add a bunch of logging into your custom calculators to see if they are calculating what you expect as the TotalPrice is generated from a bunch of things, including those, so you really want to try and rule out your custom code first.
Yeah, I will get back to you then.Thanks
is working on a reply...