Module: TbCommerce::Admin::TransactionsHelper
- Defined in:
- app/helpers/tb_commerce/admin/transactions_helper.rb
Instance Method Summary collapse
- #link_to_for_stripe_charge(transaction) ⇒ Object
- #stripe_base_url ⇒ Object
- #tb_commerce_status_label_for_transaction(status) ⇒ Object
- #url_for_stripe_charge(stripe_charge_id) ⇒ Object
Instance Method Details
#link_to_for_stripe_charge(transaction) ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/helpers/tb_commerce/admin/transactions_helper.rb', line 16 def link_to_for_stripe_charge(transaction) if transaction.captured? return link_to transaction.stripe_charge_id, url_for_stripe_charge(transaction.stripe_charge_id), :target => :blank else return '--' end end |
#stripe_base_url ⇒ Object
28 29 30 |
# File 'app/helpers/tb_commerce/admin/transactions_helper.rb', line 28 def stripe_base_url return "https://dashboard.stripe.com" end |
#tb_commerce_status_label_for_transaction(status) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/tb_commerce/admin/transactions_helper.rb', line 3 def tb_commerce_status_label_for_transaction(status) if status == 'captured' cls = 'success' elsif status == 'fail' cls = 'important' elsif status == 'refunded' || status == 'voided' cls = 'warning' else cls = 'default' end content_tag :span, status.titleize, :class => "label label-#{cls}" end |
#url_for_stripe_charge(stripe_charge_id) ⇒ Object
24 25 26 |
# File 'app/helpers/tb_commerce/admin/transactions_helper.rb', line 24 def url_for_stripe_charge(stripe_charge_id) return "#{stripe_base_url}/payments/#{stripe_charge_id}" end |