Vendr SetPaymentMethod with SetPaymentCountryRegion fails.
Hi
When i use SetPaymentMethod(new Guid("some guid")) and SetPaymentCountryRegion(model.BillingAddress.Country, null) on an order, i get en error: "InvalidOperationException: Cannot generate a payment form for order fb61acec-f8e8-41a7-a619-0183652185e5 as it has no associated payment method".
SetPaymentMethod works fine on its own, but when i add SetPaymentCountryRegion, it can no longer add the payment method. Even when the payment method is set to default on the chosen country, and the payment method is set to available to all countries. It changes the country on the order, but fails to add payment method.
This is why I was asking bout Vendr Checkout as I know this does have default logic to clear the payment method when you change the payment country region as it's designed to work over a multi-screen checkout flow so what you are trying to do it have it run in one save.
Vendr SetPaymentMethod with SetPaymentCountryRegion fails.
Hi
When i use SetPaymentMethod(new Guid("some guid")) and SetPaymentCountryRegion(model.BillingAddress.Country, null) on an order, i get en error: "InvalidOperationException: Cannot generate a payment form for order fb61acec-f8e8-41a7-a619-0183652185e5 as it has no associated payment method".
SetPaymentMethod works fine on its own, but when i add SetPaymentCountryRegion, it can no longer add the payment method. Even when the payment method is set to default on the chosen country, and the payment method is set to available to all countries. It changes the country on the order, but fails to add payment method.
Any help is appreciated.
Are you using any add in packages like Vendr Checkout?
Hi Matt
I tried both installing and uninstalling Vendr Checkout and still the same error.
I got it working by doing the following:
order.SetPaymentCountryRegion(model.BillingAddress.Country, null);
_vendrApi.SaveOrder(order);
order.SetPaymentMethod(new Guid(""));
_vendrApi.SaveOrder(order);
uow.Complete();
Hey Paw,
This is why I was asking bout Vendr Checkout as I know this does have default logic to clear the payment method when you change the payment country region as it's designed to work over a multi-screen checkout flow so what you are trying to do it have it run in one save.
Uninstalling Vendr Checkout should make it work.
is working on a reply...