Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #180 from adammathys/match-solidus-cc-interface
Browse files Browse the repository at this point in the history
Add fields to match Spree::CreditCard's interface
  • Loading branch information
gmacdougall authored Jul 27, 2018
2 parents 891dc44 + 7f86063 commit ebe1396
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/models/solidus_paypal_braintree/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ class Source < SolidusSupport.payment_source_parent_class
scope(:with_payment_profile, -> { joins(:customer) })
scope(:credit_card, -> { where(payment_type: CREDIT_CARD) })

delegate :last_4, :card_type, to: :braintree_payment_method, allow_nil: true
delegate :last_4, :card_type, :expiration_month, :expiration_year,
to: :braintree_payment_method, allow_nil: true

# Aliases to match Spree::CreditCard's interface
alias_method :last_digits, :last_4
alias_method :month, :expiration_month
alias_method :year, :expiration_year
alias_method :cc_type, :card_type


# we are not currenctly supporting an "imported" flag
def imported
Expand Down

0 comments on commit ebe1396

Please sign in to comment.