0

*Hello,

I create a new payment method and I need to display some properties, saved with the virtoCommerce Manager, in the Order.cshtml view. I know I can use the GetPaymentMethod method (PaymentClient class) but I don't know how to initialize my PaymentClient paymentClient variable.

Do you have any idea ?

1 Answers1

0

The frontend is using Dependency Injection, so all you need to do is to add "PaymentClient paymentClient" to ctor method of your controller class.

For example if you have a OrderController.cs:

PaymentClient _paymentClient = null;
public OrderController(PaymentClient paymentClient)
{
  _paymentClient = paymentClient;
}

You can now use payment client object to get methods.

Woland
  • 2,881
  • 2
  • 20
  • 33