Smart2Pay SDK .NET Notification

We offer you the possibility to receive notifications for every type of service used. We will notify you about the status changes to the Notification URL you setup in the Merchant Dashboard.

In order to receive notifications you need to expose REST – endpoint which accepts POSTs.

You need to implement the INotificationCallback Interface. The interface exposes asynchronous methods that return Task<bool> and uses true/false values to indicate success/failure.

Please make sure to handle your exceptions; if the SDK catches an exception it will consider that the callback has failed. The SDK will return Http 204 (No content) if the callback succeeds or it will return Http 500 (Internal Server Error) if the callback returns false or if an exception is caught.

In your POST action handler you will need an reference of INotificationProcessor type, you will need to read the Notification Body as a string and pass that string as an argument to ProcessNotificationBodyAsync method.

For more information, please visit our sections on GitHub: ASP.NET Core 1.1 and ASP.NET WebApi. Please note that examples do not implement security, but you will have to do it in your application.

To ensure that a notification has been securely processed you will need to validate the authorization header using your SiteID and API Key in the same manner you compute the authorization header for a request. For more details, please go to Authentication section.

Also, you will have to whitelist Smart2Pay’s IPs for Test and Live Environment.
Here you will find the complete list of GlobalPay’s Environments and IPs.