lib/pay/billable.rb in pay-2.6.2 vs lib/pay/billable.rb in pay-2.6.3
- old
+ new
@@ -40,11 +40,11 @@
self.processor_id = nil if processor_changed?
@payment_processor = nil
end
def processor
- super.inquiry
+ super&.inquiry
end
delegate :charge, to: :payment_processor
delegate :subscribe, to: :payment_processor
delegate :update_card, to: :payment_processor
@@ -110,21 +110,24 @@
ActiveSupport::Deprecation.warn("This will be removed in the next release. Use `@billable.payment_processor.upcoming_invoice` instead.")
payment_processor.upcoming_invoice
end
def stripe?
+ ActiveSupport::Deprecation.warn("This will be removed in the next release. Use `@billable.processor.stripe?` instead.")
processor == "stripe"
end
def braintree?
+ ActiveSupport::Deprecation.warn("This will be removed in the next release. Use `@billable.processor.braintree?` instead.")
processor == "braintree"
end
def paypal?
card_type == "PayPal"
end
def paddle?
+ ActiveSupport::Deprecation.warn("This will be removed in the next release. Use `@billable.processor.paddle?` instead.")
processor == "paddle"
end
def has_incomplete_payment?(name: Pay.default_product_name)
subscription(name: name)&.has_incomplete_payment?