Class: Workarea::Payment::Tender::CreditCard
Instance Method Summary
collapse
Methods included from CreditCard
#card_change?, #expired?, #number=, #number_changed?, #to_active_merchant
#authorized_amount, #build_transaction, #capturable?, #capturable_amount, #captured_amount, #has_amount?, #name, #refundable?, #refundable_amount, #refunded_amount, #uncaptured_amount
#guard_negative_price
#releasable?
add_worker, assert_valid_config!, async, caching_classes?, disable, enable, inline, #run_callbacks, workers, workers_list
#embedded_children
Instance Method Details
#saved? ⇒ Boolean
13
14
15
|
# File 'app/models/workarea/payment/tender/credit_card.rb', line 13
def saved?
saved_card_id.present?
end
|
#saved_card ⇒ Object
21
22
23
24
25
|
# File 'app/models/workarea/payment/tender/credit_card.rb', line 21
def saved_card
@saved_card ||= profile.credit_cards.find(saved_card_id) if saved?
rescue
nil
end
|
#slug ⇒ Object
27
28
29
|
# File 'app/models/workarea/payment/tender/credit_card.rb', line 27
def slug
:credit_card
end
|
#to_token_or_active_merchant ⇒ Object
31
32
33
|
# File 'app/models/workarea/payment/tender/credit_card.rb', line 31
def to_token_or_active_merchant
token.presence || to_active_merchant
end
|
#tokenized? ⇒ Boolean
17
18
19
|
# File 'app/models/workarea/payment/tender/credit_card.rb', line 17
def tokenized?
super || saved?
end
|