mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Extract setup and authorize to a new method called prepare_for_payment to fix rubocop ABCsize issue
It looks like this rubocop rule weights a raise over a return...
This commit is contained in:
@@ -61,14 +61,17 @@ class SubscriptionConfirmJob
|
||||
raise if order.errors.present?
|
||||
return unless order.payment_required?
|
||||
|
||||
prepare_for_payment!(order)
|
||||
order.process_payments!
|
||||
raise if order.errors.any?
|
||||
end
|
||||
|
||||
def prepare_for_payment!(order)
|
||||
setup_payment!(order)
|
||||
raise if order.errors.any?
|
||||
|
||||
authorize_payment!(order)
|
||||
raise if order.errors.any?
|
||||
|
||||
order.process_payments!
|
||||
raise if order.errors.any?
|
||||
end
|
||||
|
||||
def setup_payment!(order)
|
||||
|
||||
Reference in New Issue
Block a user