payment processor plugin questions.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
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.
6 years ago
I may not be understanding the issue correctly, but look into utilizing the CustomValues property on ProcessPaymentRequest.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.