Yidna wrote:The first problem you have is that the Order is not created at the time PaymentInfo is displayed
So you would need to store the values somewhere temporarily just as Nop.Plugin.Payments.Manual does to store the Credit Card details
Examine how Nop.Plugin.Payments.Manual stores the Credit Card details
You can use the same flow and methods to do similar for the information you create
Then you can store the data in the Order once it is created.
i.e. using ProcessPaymentResult
See SaveOrderDetailsAsync in src\Libraries\Nop.Services\Orders\OrderProcessingService.cs
Maybe you dont need new fields in the order and can reassign the fields used for Credit Card details
Hi, thank you for your support, I followed your suggestions and now I can save the new field on Order table.
The problem I have now is on the calculation of the fees when I select the payment from dropdownlist I created in my bank transfer plugin. I found the method "GetAdditionalHandlingFeeAsync" in my plugin that calls CalculatePaymentAdditionalFeeAsync, I copyed the calculation logic inside CalculatePaymentAdditionalFeeAsync as here:
public async Task<decimal> GetAdditionalHandlingFeeAsync(IList<ShoppingCartItem> cart )
{
int fee = 10;
var orderTotalWithoutPaymentFee = (await _orderTotalCalculationService.GetShoppingCartTotalAsync(cart, usePaymentMethodAdditionalFee: false)).shoppingCartTotal ?? 0;
var result = (decimal)((float)orderTotalWithoutPaymentFee * (float)fee / 100f);
return result;
}
I need to call back inside this method two things for my calculation fee:
1) the value from selected payment dropdownlist
2) the selected shipment method in the previous view.
According to selected payment method and selected shipment method I need to select from my custom table a percentage fee I'll use in this method to calculate additonal fee that will substitute
fee variable in my method (in this case int fee = 10).
I tryed to add to method signature "IFormCollection form" as parameter to get my selected dropdown payment:
public async Task<decimal> GetAdditionalHandlingFeeAsync(IList<ShoppingCartItem> cart ,"IFormCollection form")
but it's broken other piece of codes.
Please help me