module ActiveMerchant::Billing::CyberSourceCommon

Public Instance Methods

address_names(address_name, payment_method) click to toggle source
# File lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb, line 14
def address_names(address_name, payment_method)
  names = split_names(address_name)
  return names if names.any?(&:present?)

  [
    payment_method&.first_name,
    payment_method&.last_name
  ]
end
check_billing_field_value(default, submitted) click to toggle source
# File lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb, line 4
def check_billing_field_value(default, submitted)
  if submitted.nil?
    nil
  elsif submitted.blank?
    default
  else
    submitted
  end
end
eligible_for_zero_auth?(payment_method, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb, line 31
def eligible_for_zero_auth?(payment_method, options = {})
  payment_method.is_a?(CreditCard) && options[:zero_amount_auth]
end
lookup_country_code(country_field) click to toggle source
# File lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb, line 24
def lookup_country_code(country_field)
  return unless country_field.present?

  country_code = Country.find(country_field)
  country_code&.code(:alpha2)
end