Method: Epay::Subscription#card

Defined in:
lib/epay/subscription.rb

#cardObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/epay/subscription.rb', line 15

def card
  # The card number can be derived from last transaction
  if transactions.any?
    transactions.last.card
  else
    Card.new({
      :exp_year   => data['expyear'].to_i,
      :exp_month  => data['expmonth'].to_i,
      :kind       => data['cardtypeid'].downcase.to_sym,
      :number     => card_no
    })
  end
end