Skip to content

Commit

Permalink
Make payment.rb methods more concise
Browse files Browse the repository at this point in the history
  • Loading branch information
brchristian authored Aug 16, 2020
1 parent 1a4f85c commit 019d4d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/app/models/spree/payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ def validate_source
end

def source_required?
payment_method.present? && payment_method.source_required?
payment_method&.source_required?
end

def profiles_supported?
payment_method.respond_to?(:payment_profiles_supported?) && payment_method.payment_profiles_supported?
payment_method.try(:payment_profiles_supported?)
end

def create_payment_profile
Expand Down

0 comments on commit 019d4d7

Please sign in to comment.