Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vineeth 71 posts 291 karma points
    Jan 24, 2020 @ 10:03
    Vineeth
    0

    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
    enter image description here

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 24, 2020 @ 10:21
    Matt Brailsford
    0

    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 use WithVatFormattedWithoutSymbol this will be a string rounded to 2 decimal places.

    Try switching them over and see if that helps

    Matt

  • Vineeth 71 posts 291 karma points
    Jan 24, 2020 @ 10:36
    Vineeth
    0

    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

    enter image description here

    No issues on another product not bundles with the same code.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 24, 2020 @ 10:51
    Matt Brailsford
    0

    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.

  • Vineeth 71 posts 291 karma points
    Jan 24, 2020 @ 10:53
    Vineeth
    0

    Yes exactly that is happening,

    We're using OrderLineCalculator and ShippingCalculator.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 24, 2020 @ 10:57
    Matt Brailsford
    0

    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?

  • Vineeth 71 posts 291 karma points
    Jan 24, 2020 @ 11:03
    Vineeth
    0

    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

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 24, 2020 @ 11:19
    Matt Brailsford
    0

    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.

  • Vineeth 71 posts 291 karma points
    Jan 24, 2020 @ 11:21
    Vineeth
    0

    Yeah, I will get back to you then.Thanks

Please Sign in or register to post replies

Write your reply to:

Draft