class ActiveMerchant::Billing::EncryptedNexioCard

Constants

ALLOWED_CARD_BRANDS

Attributes

brand[R]
encrypted_number[RW]
one_time_token[RW]
own_form[RW]

Public Instance Methods

short_year() click to toggle source
# File lib/active_merchant/billing/encrypted_nexio_card.rb, line 12
def short_year
  year % 100 if year
end

Private Instance Methods

validate_card_brand_and_number() click to toggle source
# File lib/active_merchant/billing/encrypted_nexio_card.rb, line 18
def validate_card_brand_and_number
  errors = []

  if empty?(brand)
    errors << [:brand, 'is required'] if own_form
  elsif !ALLOWED_CARD_BRANDS.include?(brand)
    errors << [:brand, 'is invalid']
  end

  errors << [:encrypted_number, 'is required'] if empty?(encrypted_number)

  errors
end