Exemple #1
0
        private void InitializeLifetimes(bool isStatic)
        {
            if (isStatic == false)
            {
                if (Owner is Card)
                {
                    _lifetimes.Add(new OwningCardLifetime());
                }

                if (UntilEot)
                {
                    _lifetimes.Add(new EndOfTurnLifetime());
                }

                if (SourceCard.Is().Attachment)
                {
                    _lifetimes.Add(new AttachmentLifetime());
                }
            }

            foreach (var lifetime in _lifetimes)
            {
                lifetime.Initialize(Game, this);
            }
        }
Exemple #2
0
        private void InitializeLifetimes(bool isStatic)
        {
            if (isStatic == false)
            {
                if (Owner is Card)
                {
                    // if modifier is applied to a card in
                    // the battlefield it should be removed
                    // when the card it is aplied to leaves
                    // the battlefield
                    _lifetimes.Add(new OwningCardLifetime());
                }

                if (UntilEot)
                {
                    _lifetimes.Add(new EndOfTurnLifetime());
                }

                if (SourceCard.Is().Attachment&&
                    /* when attachment applies modifier to itself e.g Avarice Amulet this should not apply */
                    SourceCard != Owner)
                {
                    // when modifier is given by an attachment
                    // it should become invalid when attachment
                    // becomes detached
                    _lifetimes.Add(new AttachmentLifetime());
                }
            }

            foreach (var lifetime in _lifetimes)
            {
                lifetime.Initialize(Game, this);
            }
        }
Exemple #3
0
        public bool CreateCardDetails()
        {
            try
            {
                SourceCard card = new SourceCard();
                card.Number          = this.Number;
                card.ExpirationYear  = this.ExpirationYear;
                card.ExpirationMonth = this.ExpirationMonth;
                card.Cvc             = this.Cvv;
                card.Name            = this.Name;
                StripeCardService       cardService = new StripeCardService(Params.stripeApiKey);
                StripeCardCreateOptions cardoption  = new StripeCardCreateOptions();
                cardoption.SourceCard = card;
                var cardinfo = cardService.Create(this.CustomerId, cardoption);
                if (!string.IsNullOrEmpty(cardinfo.Id))
                {
                    this.CardId = cardinfo.Id;
                    return(true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }

            return(false);
        }
        public static StripeChargeCreateOptions DisputedCard()
        {
            var cardOptions = new SourceCard()
            {
                AddressCountry = "US",
                AddressLine1 = "320 Fowler Street",
                AddressLine2 = "ATTN: Barone Family",
                AddressCity = "Lynbrook",
                AddressState = "NY",
                AddressZip = "11563",
                Cvc = "1223",
                ExpirationMonth = "10",
                ExpirationYear = "2021",
                Name = "Ray Barone",
                Number = "4000000000000259",
            };

            return new StripeChargeCreateOptions()
            {
                SourceCard = cardOptions,
                Description = "Golf Clubs",
                StatementDescriptor = "ref# 1251",
                Amount = 50000,
                Currency = "usd"
            };
        }
Exemple #5
0
        public static StripeChargeCreateOptions InvalidCard()
        {
            var cardOptions = new SourceCard()
            {
                AddressCountry  = "US",
                AddressLine1    = "24 Lynbrook St",
                AddressCity     = "Yeehaw Beebop ChickyChicky",
                AddressState    = "NC",
                AddressZip      = "90210",
                Cvc             = "1223",
                ExpirationMonth = 10,
                ExpirationYear  = 2004,
                Name            = "Joe Meatballs",
                Number          = "425221"
            };

            return(new StripeChargeCreateOptions()
            {
                SourceCard = cardOptions,
                Description = "Joe Meatball Charge",
                StatementDescriptor = "Joe Meatball Sub",
                Amount = 5153,
                Currency = "usd"
            });
        }
Exemple #6
0
        private StripeCustomer GetCustomer()
        {
            var        mycust = new StripeCustomerCreateOptions();
            SourceCard card   = new SourceCard();

            card.Number          = "4242424242424242";
            card.Name            = "Yathiraj U";
            card.ExpirationMonth = "10";
            card.ExpirationYear  = "2016";
            card.AddressCountry  = "USA";
            card.ReceiptEmail    = "*****@*****.**";
            card.AddressCity     = "abc";
            mycust.Email         = "uryathi834 @gmail.com";
            card.Cvc             = "123";
            mycust.PlanId        = "123456";
            // mycust.TrialEnd =
            mycust.Description = "Rahul Pandey([email protected])";
            mycust.SourceCard  = card;
            //  mycust.SourceCard = "USA";

            //  mycust.CardExpirationMonth = "10";
            //  mycust.CardExpirationYear = "2016";
            // mycust.PlanId = "100";

            //mycust.TrialEnd = getrialend();
            var customerservice = new StripeCustomerService("sk_test_CQT723mQ9B3Qhzs7pxUtINLv");

            return(customerservice.Create(mycust));
        }
Exemple #7
0
        public static StripeChargeCreateOptions ValidCard()
        {
            var cardOptions = new SourceCard()
            {
                AddressCountry  = "US",
                AddressLine1    = "24 Beef Flank St",
                AddressLine2    = "Apt 24",
                AddressCity     = "BIGGIE",
                AddressState    = "NC",
                AddressZip      = "27617",
                Cvc             = "1223",
                ExpirationMonth = 10,
                ExpirationYear  = 2021,
                Name            = "Joe Meatballs",
                Number          = "4000000000000077"
            };

            return(new StripeChargeCreateOptions()
            {
                SourceCard = cardOptions,
                Description = "Joe Meatball Charge",
                StatementDescriptor = "Joe Meatball Sub",
                Amount = 5153,
                Currency = "usd",
                Metadata = new Dictionary <string, string>
                {
                    { "A", "Value-A" },
                    { "B", "Value-B" }
                }
            });
        }
        public static StripeChargeCreateOptions DisputedCard()
        {
            var cardOptions = new SourceCard()
            {
                AddressCountry  = "US",
                AddressLine1    = "320 Fowler Street",
                AddressLine2    = "ATTN: Barone Family",
                AddressCity     = "Lynbrook",
                AddressState    = "NY",
                AddressZip      = "11563",
                Cvc             = "1223",
                ExpirationMonth = 10,
                ExpirationYear  = 2021,
                Name            = "Ray Barone",
                Number          = "4000000000000259",
            };

            return(new StripeChargeCreateOptions()
            {
                SourceCard = cardOptions,
                Description = "Golf Clubs",
                StatementDescriptor = "ref# 1251",
                Amount = 50000,
                Currency = "usd"
            });
        }
 public void Bounce(Card source)
 {
     ActionAvailable = true;
     MoveAvailable   = true;
     UpdateHasActedIndicators();
     Tile.Creature = null;
     SetSpriteColor(Color.white); // reset sprite color in case card is greyed out
     ResetToBaseStats();
     SourceCard.MoveToCardPile(SourceCard.Owner.Hand, source);
 }
Exemple #10
0
        public static StripeCustomerCreateOptions ValidCard(string _planId = null, string _couponId = null, DateTime?_trialEnd = null, bool _trialEndNow = false)
        {
            // obsolete: var cardOptions = new StripeSourceOptions()
            var cardOptions = new SourceCard()
            {
                AddressCountry  = "US",
                AddressLine1    = "234 Bacon St",
                AddressLine2    = "Apt 1",
                AddressState    = "NC",
                AddressZip      = "27617",
                Cvc             = "1661",
                ExpirationMonth = "10",
                ExpirationYear  = "2021",
                Name            = "Johnny Tenderloin",
                Number          = "4242424242424242",
            };

            var stripeCustomerCreateOptions = new StripeCustomerCreateOptions()
            {
                // obsolete: Source = cardOptions,
                SourceCard     = cardOptions,
                Email          = "*****@*****.**",
                Description    = "Johnny Tenderloin ([email protected])",
                AccountBalance = 100,
                Metadata       = new Dictionary <string, string>
                {
                    { "A", "Value-A" },
                    { "B", "Value-B" }
                }
            };

            if (_planId != null)
            {
                stripeCustomerCreateOptions.PlanId = _planId;
            }

            if (_couponId != null)
            {
                stripeCustomerCreateOptions.CouponId = _couponId;
            }

            if (_trialEnd != null)
            {
                stripeCustomerCreateOptions.TrialEnd = _trialEnd;
            }

            if (_trialEndNow)
            {
                stripeCustomerCreateOptions.EndTrialNow = true;
            }

            return(stripeCustomerCreateOptions);
        }
    private void CreateOnTileActual(Tile tile)
    {
        // move card from player's hand and parent it to the board
        if (Board.Instance != null)
        {
            SourceCard.MoveToCardPile(Board.Instance, null);
        }

        // resize structure and stop treating it as a card and start treating is as a structure
        (SourceCard as StructureCard).SwapToStructure(tile);

        tile.Structure = this;
        Tile           = tile;

        // turn on FoF border
        UpdateFriendOrFoeBorder();
    }
        public static StripeCustomerCreateOptions ValidCard(string _planId = null, string _couponId = null, DateTime? _trialEnd = null, bool _trialEndNow = false)
        {
            // obsolete: var cardOptions = new StripeSourceOptions()
            var cardOptions = new SourceCard()
            {
                AddressCountry = "US",
                AddressLine1 = "234 Bacon St",
                AddressLine2 = "Apt 1",
                AddressState = "NC",
                AddressZip = "27617",
                Cvc = "1661",
                ExpirationMonth = "10",
                ExpirationYear = "2021",
                Name = "Johnny Tenderloin",
                Number = "4242424242424242",
            };

            var stripeCustomerCreateOptions = new StripeCustomerCreateOptions()
            {
                // obsolete: Source = cardOptions,
                SourceCard = cardOptions,
                Email = "*****@*****.**",
                Description = "Johnny Tenderloin ([email protected])",
                AccountBalance = 100,
                Metadata = new Dictionary<string, string>
                {
                    { "A", "Value-A" },
                    { "B", "Value-B" }
                }
            };

            if (_planId != null)
                stripeCustomerCreateOptions.PlanId = _planId;

            if (_couponId != null)
                stripeCustomerCreateOptions.CouponId = _couponId;

            if (_trialEnd != null)
                stripeCustomerCreateOptions.TrialEnd = _trialEnd;

            if (_trialEndNow)
                stripeCustomerCreateOptions.EndTrialNow = true;

            return stripeCustomerCreateOptions;
        }
Exemple #13
0
 public static bool IsLegal(SourceCard sc)
 {
     return(true);
 }
Exemple #14
0
 public void source_should_not_be_null()
 {
     SourceCard.Should().NotBeNull();
     SourceCard.Card.Should().NotBeNull();
 }
Exemple #15
0
 public bool HasKeyword(Keyword k) => SourceCard.HasKeyword(k);
Exemple #16
0
 public void RemoveKeyword(Keyword k) => SourceCard.RemoveKeyword(k);
Exemple #17
0
 public void AddKeyword(Keyword k) => SourceCard.AddKeyword(k);
Exemple #18
0
 public bool IsType(CardType type) => SourceCard.IsType(type);