protected override void Destructor() { try { if (m_AffectedAccounts != null) { foreach (var account in m_AffectedAccounts.Values) { PaySystemHost.DoStoreAccountData(this, account); } } if (m_AffectedTransactions != null) { foreach (var tran in m_AffectedTransactions.Values) { PaySystemHost.DoStoreTransaction(this, tran); } } } finally { if (PaySystem != null) { lock (PaySystem.Sessions) PaySystem.Sessions.Remove(this); } } base.Destructor(); }
public Transaction FetchTransaction(object id) { Transaction result = null; if (m_AffectedTransactions != null && m_AffectedTransactions.ContainsKey(id)) { result = m_AffectedTransactions[id]; } if (result == null) { result = PaySystemHost.DoFetchTransaction(this, id); } return(result); }
public IActualAccountData FetchAccountData(Account account) { IActualAccountData result = null; if (m_AffectedAccounts != null && m_AffectedAccounts.ContainsKey(account)) { result = m_AffectedAccounts[account]; } if (result == null) { result = PaySystemHost.DoFetchAccountData(this, account); } return(result); }
protected PaySession(PaySystem paySystem, ConnectionParameters cParams, IPaySessionContext context = null) { if (paySystem == null || cParams == null) { throw new PaymentException(StringConsts.ARGUMENT_ERROR + this.GetType().Name + ".ctor((paySystem|cParams)=null)"); } PaySystem = paySystem; Context = context ?? PaySystemHost.GetDefaultTransactionContext(); ConnectionParameters = cParams; lock (PaySystem.Sessions) PaySystem.Sessions.Add(this); }
/// <summary> /// Generates new transaction ID for desired pay session and transaction type (Charge, Transfer). /// Context supplies host specific information about this transation i.e. user id /// </summary> public object GenerateTransactionID(TransactionType type) { return(PaySystemHost.DoGenerateTransactionID(this, type)); }