Any help wanted, webhooks.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 2 ans
This is a bit of a long shot but I thought if any community would help it would be this one!

I've been working with nopCommerce for some time and love .net core and nopcommerce, however, after looking at SagePay/Opayo and their server integration I'm at a loss with webhooks.

There is information on google and other resources about webhooks but everything seems to be tailored with a server. If, and this is a big if, anyone has some time, perhaps 30 minutes, I didn't know if they would get in touch and potentially explain it to me and help me get my head around it, please.

Thank you in advance for anyone generous enough to give up a little of their time.
Il y a 2 ans
Have a look at SendInBlue Plugin has a webhook
Depends on the type of webhook
For non Post
Make a controller action for example
[IgnoreAntiforgeryToken]
public virtual async Task<IActionResult> PluginWebhook(int? orderId)
{
....
}

Make a route
endpointRouteBuilder.MapControllerRoute("Plugin.PaymentWebhook", "Plugin/Webhook/{orderId:regex(\\d*)}",
                new { controller = "PaymentPlugin", action = "PluginWebhook" });

Test with
yourwebsite.com/Plugin/Webhook/1
where 1 is your order number
This is also the URL you send to the remote gateway

But if it is a post Webhook add

        [HttpPost]
        [IgnoreAntiforgeryToken]
        public virtual async Task<IActionResult> PluginWebhook()

Then you will need to test with a way to Post i.e. PostMan
Il y a 2 ans
Thank you for the help Yidna,

I believe it is a POST webhook as Opayo/Sagepay send me a notification once the user has entered their details and I'm to response to it. That's my understanding anyway.
Il y a 2 ans
Yes either way they will hit the URL with a notification
but best check the documentation to find out which way they will do it
Il y a 2 ans
Hello again Yidna,

Just working my way through the above which definitely makes me realise I was on the right track, however, I'm struggling with IEndpointRouteBuilder, is this available in CORE 2.2?
Il y a 2 ans
routeBuilder.MapRoute("Nop.Plugins.Plugin.Name.Webhook", "Plugin/Webhook",
    new { controller = "Sendcloud", action = "PluginWebhook" });

See any other the other plugins that have a RouteProvider
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.