I'm writing a plugin for a local (Colombia) payment system. That payment system has several languages on which the user can make his/her transaction. When the user is redirected to the payment gateway, I want him/her to arrive on the correct language!
I need to know what language the store is using (example: "en" for english OR "es" for spanish).
I tried using this property "postProcessPaymentRequest.Order.Customer.Language.LanguageCulture" but it is null at that point in checkout.
What object/property can i use to grab this information.
Check out IWorkContext.WorkingLanguage. You can get the current instance by adding a paramter of type IWorkContext in the payment method's constructor.
Dependency Injection is a common design pattern in enterprise applications that injects dependencies into dependent objects. If you search for DependencyRegistrar classes you will find all the dependencies that are registered for injection.
You can find a sample plugin with dependency injection on my blog. http://blog.csharpwebdeveloper.com
This works because of the use of Autofac (its an inversion of control container). It it used to instantiate plugins, among other things (like controllers, services, etc). It can automatically create classes having constructor parameters as long as it knows how to resolve each parameter. Have a look at Nop.Web.Framework.DependencyRegistrar to see how the implementations are registered in the container.