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 :)
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.
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
.dpm
value for the session store is empty.GetDefaultPaymentMethod
does check for this session value, and if it's not set, the value will be retrieved from the store.SetDefaultPaymentMethod
function.SetDefaultPaymentMethod
stores the id in thedpc
value, which overrides ourDefaultPaymentCountry
.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 :)
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
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!
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
is working on a reply...