Esempio n. 1
0
        /// <summary>
        /// Sends a NotificationRequest message to a store.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <NotificationRequest> NotificationRequest(NotificationRequestRecord request)
        {
            var body = new NotificationRequest()
            {
                Request = request,
            };

            var message = SendRequest(body, onBeforeSend: (m) => TryRegisterSubscription(request, nameof(request.Uuid), m, request));

            if (message == null)
            {
                TryUnregisterSubscription(request);
            }

            return(message);
        }
 /// <summary>
 /// Handles the NotificationRequest message from a customer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="request">The NotificationRequest message.</param>
 protected virtual void HandleNotificationRequest(IMessageHeader header, NotificationRequest request)
 {
     Notify(OnNotificationRequest, header, request);
 }