コード例 #1
0
 public void Notify(NotifyStatus status)
 {
     if (NotifyEvent != null)
     {
         NotifyEvent.Invoke(this, new NotifyEventArgs(status));
     }
 }
コード例 #2
0
        /// <summary>
        /// Creates a payment request (a transfer token payload)
        /// and sends it to a potential payer.
        /// </summary>
        /// <param name="tokenClient">initialized SDK</param>
        /// <param name="payee">payee Token member</param>
        /// <param name="payerAlias">payer Token member alias</param>
        /// <returns>a transfer Token</returns>
        public static NotifyStatus NotifyPaymentRequest(
            Tokenio.User.TokenClient tokenClient,
            UserMember payee,
            Alias payerAlias)
        {
            // We'll use this as a reference ID. Normally, a payee who
            // explicitly sets a reference ID would use an ID from a db.
            // E.g., an online merchant might use the ID of a "shopping cart".
            // We don't have a db, so we fake it with a random string:
            string       cartId         = Util.Nonce();
            TokenPayload paymentRequest = new TokenPayload
            {
                Description = "Sample payment request",
                From        = new TokenMember {
                    Alias = payerAlias
                },
                To = new TokenMember {
                    Alias = payee.GetFirstAliasBlocking()
                },
                Transfer = new TransferBody {
                    Amount = "100.00", Currency = "EUR"
                },
                RefId = cartId
            };


            NotifyStatus status = tokenClient.NotifyPaymentRequestBlocking(paymentRequest);

            return(status);
        }
コード例 #3
0
 /// <summary>
 /// Create token request.
 /// </summary>
 /// <param name = "notificationId">notification id</param>
 /// <param name = "notifyStatus">notify status</param>
 /// <returns>notify result</returns>
 public static NotifyResult Create(string notificationId, NotifyStatus notifyStatus)
 {
     return(new NotifyResult
     {
         NotificationId = notificationId,
         NotifyStatus = notifyStatus
     });
 }
コード例 #4
0
        public NotifyMessage(NotifyStatus status, String arguments = null, IImmutableDictionary <String, Object> input = null, Exception exception = null)
        {
            Status = status;

            Arguments = arguments;
            Input     = input;

            Exception = exception;
        }
コード例 #5
0
ファイル: MultiPartedHTTPGetter.cs プロジェクト: mingkof/pbs
 public IWorker initProperties(int num, EventWaitHandle jobSingal, NotifyStatus notifyCallBack)
 {
     notifier          = notifyCallBack;
     _downloadSingal   = jobSingal;
     this.threadNumber = num;
     worker            = new Thread(Work);
     worker.Start();
     return(this);
 }
コード例 #6
0
ファイル: BaseNotify.cs プロジェクト: JeyKip/DataBaseSynchro
 protected void Notification(string message, NotifyStatus status)
 {
     if (Notify != null)
     {
         Notify(this, new NotifyEventArgs()
         {
             Message = message,
             Status = status
         });
     }
 }
コード例 #7
0
        protected void Notify(string janCode, string message, NotifyStatus reportState, ProcessStatus processState = ProcessStatus.Start)
        {
            var eventArgs = new ExecutingStateEventArgs()
            {
                JanCode       = janCode,
                Message       = message,
                NotifyStatus  = reportState,
                ProcessStatus = processState
            };

            OnExecutingStateChanged(eventArgs);
        }
コード例 #8
0
        public void TriggerBalanceStepUpNotificationTest()
        {
            using (Tokenio.Tpp.TokenClient tokenClient = TestUtil.CreateClient())
            {
                TppMember member = tokenClient.CreateMemberBlocking(TestUtil.RandomAlias());

                NotifyStatus status = member.TriggerBalanceStepUpNotificationBlocking(
                    (new[] { "123", "456" }).ToImmutableList());

                Assert.NotNull(status);
            }
        }
コード例 #9
0
 public void Notify(string message, NotifyStatus reportState)
 {
     if (ExecutingStateChanged != null)
     {
         var eventArgs = new ExecutingStateEventArgs()
         {
             ExecDate     = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"),
             Message      = message,
             NotifyStatus = reportState,
         };
         ExecutingStateChanged.Invoke(this, eventArgs);
     }
 }
コード例 #10
0
        /// <summary>
        /// Illustrate provisioning a new device for an already-existing member.
        /// </summary>
        /// <param name="tokenClient">SDK client</param>
        /// <param name="alias">member's alias</param>
        /// <returns>key which we hope member will approve</returns>
        public static Key ProvisionDevice(Tokenio.User.TokenClient tokenClient, Alias alias)
        {
            // generate keys, storing (private and public) locally
            DeviceInfo deviceInfo = tokenClient.ProvisionDeviceBlocking(alias);
            Key        lowKey     = deviceInfo.Keys.FirstOrDefault(k => k.Level == Key.Types.Level.Low);


            // ask user (on "regular" device) to approve one of our keys
            NotifyStatus status = tokenClient.NotifyAddKeyBlocking(
                alias,
                (new[] { lowKey }).ToImmutableList(),
                new DeviceMetadata {
                Application = "SDK Sample"
            }
                );

            return(lowKey);
        }
コード例 #11
0
        public void NotifyPaymentRequestSampleTest()
        {
            using (Tokenio.User.TokenClient tokenClient = TestUtil.CreateClient())
            {
                Alias      payerAlias = TestUtil.RandomAlias();
                UserMember payer      = tokenClient.CreateMemberBlocking(payerAlias);
                UserMember payee      = TestUtil.CreateMemberAndLinkAccounts(tokenClient);


                LinkMemberAndBankSample.LinkBankAccounts(payer);

                NotifyStatus status = NotifySample.NotifyPaymentRequest(
                    tokenClient,
                    payee,
                    payerAlias);
                Assert.NotNull(status);
            }
        }
コード例 #12
0
 public NotifyMessage(NotifyStatus status, Exception exception)
     : this(status, null, (ImmutableDictionary <String, Object>)null, exception)
 {
 }
コード例 #13
0
 public NotifyActivationMessage(NotifyStatus status, String arguments = null, IImmutableDictionary <String, Object> input = null, String model = null, Exception exception = null)
     : base(status, arguments, input, exception)
 {
     Model = model;
 }
コード例 #14
0
 public NotifyActivationMessage(NotifyStatus status, String arguments = null, NotificationUserInput input = null, String model = null, Exception exception = null)
     : this(status, arguments, input?.ToImmutableDictionary(pair => pair.Key, pair => (Object)pair.Value), model, exception)
 {
 }
コード例 #15
0
 public NotifyActivationMessage(NotifyStatus status, Exception exception)
     : base(status, exception)
 {
 }
コード例 #16
0
        /// <summary>
        /// Record notification results in the database
        /// </summary>
        /// <param name="logText"></param>
        /// <param name="notificationID"></param>
        /// <param name="status"></param>
        /// <param name="notificationType"></param>
        public void RecordNotification(string logText, int notificationID, int transactionID, NotifyStatus status, NotifyTypes notificationType)
        {
            RecordNotification recordNotification = null;

            try
            {
                recordNotification = new RecordNotification();
                /*Error or Notification response is recorded*/
                recordNotification.LogText        = logText;
                recordNotification.NotificationID = notificationID;
                recordNotification.TransID        = transactionID;
                recordNotification.Status         = status;
                recordNotification.NotifyType     = notificationType;
                recordNotification.Execute();
            }
            catch (Exception ex)
            {
                /*Debug Object values for reference*/
                LogBook.Debug(recordNotification, this);

                /*Write exception log*/
                LogBook.Write("Error has occurred while inserting record notification parameters into 'ttNotificationLog' table", ex, "CooperAtkins.NotificationClient.NotificationComposer.EmailNotificationComposer");
            }
            finally
            {
                recordNotification.Dispose();
            }
        }
コード例 #17
0
 public NotifyEventArgs(NotifyStatus notifyStatus)
 {
     NotifyStatus = notifyStatus;
 }
コード例 #18
0
ファイル: NotifyLock.cs プロジェクト: filmackay/live
        private NotifyStatus ModifyStatus(NotifyStatus[] map)
        {
            int oldStatus, newStatus;
            do
            {
                oldStatus = _status;
                newStatus = (int)map[_status];
            } while (Interlocked.CompareExchange(ref _status, newStatus, oldStatus) != oldStatus);

            return (NotifyStatus)oldStatus;
        }
コード例 #19
0
 public void RaiseNotifyEvent(string message, NotifyStatus status)
 {
     Notification(message, status);
 }
コード例 #20
0
 public NotifyMessage(NotifyStatus status, String arguments, ValueSet input, Exception exception = null)
     : this(status, arguments, input?.ToImmutableDictionary(), exception)
 {
 }
コード例 #21
0
 public void Notify(NotifyStatus status)
 {
 }
コード例 #22
0
ファイル: NotifyLock.cs プロジェクト: filmackay/live
 private NotifyStatus StatusCompareExchange(NotifyStatus newValue, NotifyStatus oldvalue)
 {
     return (NotifyStatus)Interlocked.CompareExchange(ref _status, (int)newValue, (int)oldvalue);
 }