Custom Payment Plugin Setting Not working

Tuesday, November 26, 2024 12:18:51 AM
  • Posted: Wednesday, April 29, 2020 6:51 PM
  • 20
I have been trying to create the plugin for Paytm payment method. Everything works well and I am able to save the settings in database too. But I got stuck in PostProcessPayment where I have to use the DB saved setting and unfortunately am only getting the new object instead of saved setting. Any help will be helpful . I have already wasted my lot of time on it.

Code Sample: I am injecting the dependency via constructor

public PaytmPaymentProcessor(IHttpContextAccessor httpContextAccessor, IGenericAttributeService genericAttributeService, ISettingService settingService, IServiceProvider serviceProvider,
            ILocalizationService localizationService,IOrderTotalCalculationService orderTotalCalculationService, IWebHelper webHelper,PaytmPaymentSettings paytmPaymentSettings)
        {
            _settingService = settingService;
            _serviceProvider = serviceProvider;
            _localizationService = localizationService;
            _orderTotalCalculationService= orderTotalCalculationService;
            _paytmPaymentSettings = paytmPaymentSettings;
            _webHelper = webHelper;
            _httpContextAccessor = httpContextAccessor;
            _genericAttributeService = genericAttributeService;
        }
Harshal
0
  • Posted: Thursday, April 30, 2020 5:33 AM
  • 953
Hi,

Please take a look at PayPal Payment plugin in our repository. The majority of redirect payment plugins works in that way so you can use this plugin as a base. Source code of PayPal Standard are available here: https://github.com/grandnode/grandnode/tree/develop/Plugins/Grand.Plugin.Payments.PayPalStandard
Best regards,
Patryk

GrandNode Team
0
  • Posted: Sunday, May 17, 2020 5:10 AM
  • 20
Hi Patryk,

Thank you. My issue gets resolved.
Harshal
0
back to top
Filters