I am writing an eWay responsive redirect plugin (similar to the existing paypal one) and I've found the plugin and code base a pleasure to work with.
I do have one question though. My payment plugin has the following main classes.
public class eWayPaymentProcessor
Public void PostProcessPayment(PostProcessPaymentRequest req)
var ewayclient = createEwayClient();
//I need this later!
var accessCode = ewayClient.AccessCode;
public class eWayPaymentController
public IActionResult HandleResponse(...)
var ewayClient = createEwayClient()
var processor = _paymentService.LoadPaymentMethodBySystemName("Payments.eWay") as eWayPaymentProcessor;
if (processor == null || !processor.IsPaymentMethodActive(_paymentSettings) || !processor.PluginDescriptor.Installed)
throw new NopException("eWay module cannot be loaded");
var accessCode = ??
ewayClient.RetrieveTransaction(accessCode)
Now I could store the accessCode in the paymentProcessor, but what happens if there are multiple transactions occuring at once? I'm fairly sure LoadPaymentMethodBySystemName instantiates a fresh object and would not return the correct one.
How can I retrieve sessions parameters and retrieve them? I could store the access code in the return redirect URL but I thought there may be a nicer code only way.