コード例 #1
0
        public void Add(string planAddOnCode, AddOn.Type addOnType, int quantity = 1)
        {
            var unitAmount = _subscription.Plan.AddOns.Find(ao => ao.AddOnCode == planAddOnCode).UnitAmountInCents[_subscription.Currency];
            var sub        = new SubscriptionAddOn(planAddOnCode, addOnType, unitAmount, quantity);

            base.Add(sub);
        }
コード例 #2
0
        public void Add(string planAddOnCode, AddOn.Type addOnType, int quantity = 1)
        {
            if (_subscription == null)
            {
                throw new ValidationException(
                          "SubscriptionAddOnList must be initialized with a Subscription in order to use this method. Try Add(string planAddOnCode, AddOn.Type addOnType, int quantity, int unitAmountInCents) instead."
                          , new Errors());
            }
            var unitAmount = _subscription.Plan.AddOns.Find(ao => ao.AddOnCode == planAddOnCode).UnitAmountInCents[_subscription.Currency];
            var sub        = new SubscriptionAddOn(planAddOnCode, addOnType, unitAmount, quantity);

            base.Add(sub);
        }
コード例 #3
0
        public void Add(string planAddOnCode, AddOn.Type addOnType, int quantity, int unitAmountInCents)
        {
            var sub = new SubscriptionAddOn(planAddOnCode, addOnType, unitAmountInCents, quantity);

            base.Add(sub);
        }