Sha256: cadbb6b3a1963a4613341c47bdb94b6e7553bf8b20af5aa4b40a76ade08c5fa7

Contents?: true

Size: 305 Bytes

Versions: 6

Compression:

Stored size: 305 Bytes

Contents

module Workarea
  decorate Payment::SavedCreditCard, with: :forter do
    decorated do
      field :bin, type: String
      before_validation :set_bin
    end

    def set_bin
      if number.present?
        self.bin = ActiveMerchant::Billing::CreditCard.first_digits(number)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
workarea-forter-1.3.2 app/models/workarea/payment/saved_credit_card.decorator
workarea-forter-1.3.1 app/models/workarea/payment/saved_credit_card.decorator
workarea-forter-1.3.0 app/models/workarea/payment/saved_credit_card.decorator
workarea-forter-1.2.4 app/models/workarea/payment/saved_credit_card.decorator
workarea-forter-1.2.3 app/models/workarea/payment/saved_credit_card.decorator
workarea-forter-1.2.2 app/models/workarea/payment/saved_credit_card.decorator