mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Improve code readability a little
This commit is contained in:
@@ -21,16 +21,7 @@ angular.module('admin.payments').factory 'Payment', (AdminStripeElements, curren
|
||||
year: @form_data.card_year
|
||||
verification_value: @form_data.card_verification_value
|
||||
}
|
||||
when 'stripe'
|
||||
angular.extend munged_payment.payment, {
|
||||
source_attributes:
|
||||
gateway_payment_profile_id: @form_data.token
|
||||
cc_type: @form_data.cc_type
|
||||
last_digits: @form_data.card.last4
|
||||
month: @form_data.card.exp_month
|
||||
year: @form_data.card.exp_year
|
||||
}
|
||||
when 'stripe_sca'
|
||||
when 'stripe', 'stripe_sca'
|
||||
angular.extend munged_payment.payment, {
|
||||
source_attributes:
|
||||
gateway_payment_profile_id: @form_data.token
|
||||
|
||||
@@ -149,13 +149,12 @@ module Spree
|
||||
end
|
||||
|
||||
def stripe_payment_method?
|
||||
@payment_method.try(:type) == "Spree::Gateway::StripeConnect" ||
|
||||
@payment_method.try(:type) == "Spree::Gateway::StripeSCA"
|
||||
["Spree::Gateway::StripeConnect",
|
||||
"Spree::Gateway::StripeSCA"].include? @payment_method.try(:type)
|
||||
end
|
||||
|
||||
def stripe_provider?(provider)
|
||||
provider.name.ends_with?("StripeConnect") ||
|
||||
provider.name.ends_with?("StripeSCA")
|
||||
provider.name.ends_with?("StripeConnect", "StripeSCA")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -30,8 +30,8 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
def card_required?
|
||||
payment.payment_method.is_a?(Spree::Gateway::StripeConnect) ||
|
||||
payment.payment_method.is_a?(Spree::Gateway::StripeSCA)
|
||||
[Spree::Gateway::StripeConnect,
|
||||
Spree::Gateway::StripeSCA].include? payment.payment_method.class
|
||||
end
|
||||
|
||||
def card_set?
|
||||
|
||||
Reference in New Issue
Block a user