Example #1
0
 private ChargeBeeApi()
 {
     Addon               = new AddonActions(this);
     Address             = new AddressActions(this);
     Card                = new CardActions(this);
     Comment             = new CommentActions(this);
     Coupon              = new CouponActions(this);
     CouponCode          = new CouponCodeActions(this);
     CreditNote          = new CreditNoteActions(this);
     Customer            = new CustomerActions(this);
     Estimate            = new EstimateActions(this);
     Event               = new EventActions(this);
     HostedPage          = new HostedPageActions(this);
     Invoice             = new InvoiceActions(this);
     Order               = new OrderActions(this);
     PaymentSource       = new PaymentSourceActions(this);
     Plan                = new PlanActions(this);
     PortalSession       = new PortalSessionActions(this);
     ResourceMigration   = new ResourceMigrationActions(this);
     SiteMigrationDetail = new SiteMigrationDetailActions(this);
     Subscription        = new SubscriptionActions(this);
     TimeMachine         = new TimeMachineActions(this);
     Transaction         = new TransactionActions(this);
     UnbilledCharge      = new UnbilledChargeActions(this);
 }
Example #2
0
        private Transaction(IsolationLevel isolationLevel, Action <Exception> exceptionHandler)
        {
            this.exceptionHandler = exceptionHandler;
            switch (isolationLevel)
            {
            case IsolationLevel.Attach:
                if (!Scope <TransactionActions> .InScope)
                {
                    this.scope = Scope <TransactionActions> .Create(new TransactionActions());
                }
                this.actions = Scope <TransactionActions> .Current;
                break;

            case IsolationLevel.Supress:
                this.actions = new TransactionActions();
                break;
            }
            this.state = TransactionState.Active;
        }
Example #3
0
        // get transction information
        public TransactionInfo GetTransactionInfo(string transactionId, TransactionActions actionType)
        {
            GetTransactionResponse transactionResponse = GetTransactionResponseObject(transactionId);

            TransactionInfo transactionInfo = new TransactionInfo();

            transactionInfo.transactionType = actionType;
            switch (actionType)
            {
            case TransactionActions.ReceiveCoins:
                List <ICoin> receivedCoins = transactionResponse.ReceivedCoins;
                transactionInfo.TransactionFee = GetTransactionFee(transactionResponse.Transaction, receivedCoins);
                transactionInfo.outputsInfo    = GetInfoAboutCoins(receivedCoins);
                break;

            case TransactionActions.SpendCoins:
                List <ICoin> spentCoins = transactionResponse.SpentCoins;
                transactionInfo.TransactionFee = GetTransactionFee(transactionResponse.Transaction, spentCoins);
                transactionInfo.outputsInfo    = GetInfoAboutCoins(spentCoins);
                break;
            }

            return(transactionInfo);
        }