VirtoCommerce/vc-module-order

PostProcessPayment used wrong payment methods

tatarincev opened this issue · 1 comments

I have 2 payment modules but PostProcessPaymentAsync is always coming back in 1 first module, while user has used the second one. I'm revieving this function in the orders module , could there be a bug in the function taking always the first payment for giving throught the handling for processing.
var paymentMethod = store.PaymentMethods.Where(x => x.IsActive).FirstOrDefault(x => x.ValidatePostProcessRequest(parameters).IsSuccess);
if (paymentMethod != null) in https://github.com/VirtoCommerce/vc-module-order/blob/master/VirtoCommerce.OrderModule.Web/Controllers/Api/OrderModuleController.cs

I debugged OrderModule for sure is bug. Should be query on payment modules equal like ProcessPayment. Now the wrong payment module is dispatched, only the first active, not the one selected by client.
Please help to fix this, because in ProcessOrderPayments paymentId is coming in as a parameter. In PostProcess I think it should be given with by the callback to fix this.