app/models/tang/subscription.rb in tang-0.0.9 vs app/models/tang/subscription.rb in tang-0.1.0
- old
+ new
@@ -35,12 +35,12 @@
validates :customer, presence: true
validates :plan, presence: true
validates :stripe_id, presence: true, uniqueness: true
validates :application_fee_percent, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true
validates :quantity, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true
- validates :tax_percent, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true,
- format: { with: /\A\d+(?:\.\d{0,4})?\z/ }
+ # validates :tax_percent, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true,
+ # format: { with: /\A\d+(?:\.\d{0,4})?\z/ }
# before_save :nil_if_blank
before_update :update_stripe_subscription
# before_destroy :destroy_stripe_subscription
before_save :check_for_upgrade
@@ -52,10 +52,10 @@
subscription = Subscription.find_or_create_by(stripe_id: stripe_subscription.id) do |s|
s.customer = customer
s.plan = plan
s.application_fee_percent = stripe_subscription.application_fee_percent
s.quantity = stripe_subscription.quantity
- s.tax_percent = stripe_subscription.tax_percent
+ # s.tax_percent = stripe_subscription.tax_percent # removed from api in favor of tax rates
s.trial_end = stripe_subscription.trial_end
s.coupon = Coupon.find_by(stripe_id: stripe_subscription.discount.coupon.id) if stripe_subscription.discount.present?
s.status = stripe_subscription.status
end
return subscription