Module: Reji::InteractsWithPaymentBehavior
- Extended by:
- ActiveSupport::Concern
- Included in:
- Subscription, SubscriptionBuilder, SubscriptionItem
- Defined in:
- lib/reji/concerns/interacts_with_payment_behavior.rb
Instance Method Summary collapse
-
#allow_payment_failures ⇒ Object
Allow subscription changes even if payment fails.
-
#error_if_payment_fails ⇒ Object
Prevent any subscription change if payment is unsuccessful.
-
#payment_behavior ⇒ Object
Determine the payment behavior when updating the subscription.
-
#pending_if_payment_fails ⇒ Object
Set any subscription change as pending until payment is successful.
Instance Method Details
#allow_payment_failures ⇒ Object
Allow subscription changes even if payment fails.
8 9 10 11 12 |
# File 'lib/reji/concerns/interacts_with_payment_behavior.rb', line 8 def allow_payment_failures @payment_behavior = 'allow_incomplete' self end |
#error_if_payment_fails ⇒ Object
Prevent any subscription change if payment is unsuccessful.
22 23 24 25 26 |
# File 'lib/reji/concerns/interacts_with_payment_behavior.rb', line 22 def error_if_payment_fails @payment_behavior = 'error_if_incomplete' self end |
#payment_behavior ⇒ Object
Determine the payment behavior when updating the subscription.
29 30 31 |
# File 'lib/reji/concerns/interacts_with_payment_behavior.rb', line 29 def payment_behavior @payment_behavior ||= 'allow_incomplete' end |
#pending_if_payment_fails ⇒ Object
Set any subscription change as pending until payment is successful.
15 16 17 18 19 |
# File 'lib/reji/concerns/interacts_with_payment_behavior.rb', line 15 def pending_if_payment_fails @payment_behavior = 'pending_if_incomplete' self end |