Copied to clipboard

Flag this post as spam?

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


  • Jeffrey Veer 41 posts 308 karma points
    Sep 07, 2022 @ 10:01
    Jeffrey Veer
    0

    Invalid DefaultPaymentCountry

    Hi,

    We've been working on the Vendr implementation for our website, and it works great! However, we are running in to a small issue while adding multiple currencies to our store.

    We set the default payment country and currency through the VendrApi when the visitor logs in. However, when creating a new empty order we get the following error:

    Can't set order country / region to one not allowed by the order Currency

    After debugging, I think I found the cause of this issue, which seems to be in the DefaultPaymentMethod.

    • Because we don't set this property when the customer logs in, the dpm value for the session store is empty.
    • The function GetDefaultPaymentMethod does check for this session value, and if it's not set, the value will be retrieved from the store.
    • After retrieving the default value from the store, it attempts to store it in the session store with the SetDefaultPaymentMethod function.
    • However, the SetDefaultPaymentMethod stores the id in the dpc value, which overrides our DefaultPaymentCountry.

    For now I will try to set the default payment method on log in of the customer, but I think this should be easily fixable for you.

    Please let me know if you need any more information from me :)

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 07, 2022 @ 10:20
    Matt Brailsford
    100

    Oh wow, nice find. That must have been wrong for quite a while so not sure why that hasn't popped up before 🤯

    What version of Vendr are you running? I'm currently applying the fix to a 2.3.5-beta0002 unstable patch build and to the current v3 RC. If you are on a latest version of either of those, you could upgrade to the unstable build to get it working.

    Unstable builds are on our unstable nuget feed at https://nuget.outfield.digital/unstable/vendr/v3/index.json

  • Jeffrey Veer 41 posts 308 karma points
    Sep 07, 2022 @ 11:02
    Jeffrey Veer
    0

    That was quick!

    We are using 2.3.4 and I've just installed the patch build; which solved the issue for us.

    Thank you!

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 07, 2022 @ 11:07
    Matt Brailsford
    1

    Awesome!

    I should be pushing out a new v2 this week so this will be in that release.

    Thanks for reporting the issue and for debugging it so well 👍

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft