public void Notify(NotifyStatus status) { if (NotifyEvent != null) { NotifyEvent.Invoke(this, new NotifyEventArgs(status)); } }
/// <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); }
/// <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 }); }
public NotifyMessage(NotifyStatus status, String arguments = null, IImmutableDictionary <String, Object> input = null, Exception exception = null) { Status = status; Arguments = arguments; Input = input; Exception = exception; }
public IWorker initProperties(int num, EventWaitHandle jobSingal, NotifyStatus notifyCallBack) { notifier = notifyCallBack; _downloadSingal = jobSingal; this.threadNumber = num; worker = new Thread(Work); worker.Start(); return(this); }
protected void Notification(string message, NotifyStatus status) { if (Notify != null) { Notify(this, new NotifyEventArgs() { Message = message, Status = status }); } }
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); }
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); } }
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); } }
/// <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); }
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); } }
public NotifyMessage(NotifyStatus status, Exception exception) : this(status, null, (ImmutableDictionary <String, Object>)null, exception) { }
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; }
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) { }
public NotifyActivationMessage(NotifyStatus status, Exception exception) : base(status, exception) { }
/// <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(); } }
public NotifyEventArgs(NotifyStatus notifyStatus) { NotifyStatus = notifyStatus; }
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; }
public void RaiseNotifyEvent(string message, NotifyStatus status) { Notification(message, status); }
public NotifyMessage(NotifyStatus status, String arguments, ValueSet input, Exception exception = null) : this(status, arguments, input?.ToImmutableDictionary(), exception) { }
public void Notify(NotifyStatus status) { }
private NotifyStatus StatusCompareExchange(NotifyStatus newValue, NotifyStatus oldvalue) { return (NotifyStatus)Interlocked.CompareExchange(ref _status, (int)newValue, (int)oldvalue); }