Module: AdminHelper

Defined in:
app/helpers/admin_helper.rb

Instance Method Summary collapse

Instance Method Details

#display_customer_token(account) ⇒ Object



3
4
5
# File 'app/helpers/admin_helper.rb', line 3

def display_customer_token()
  link_to_braintree (.customer_token || '#'), 'customers', .customer_token
end

#display_subscription_token(account) ⇒ Object



7
8
9
# File 'app/helpers/admin_helper.rb', line 7

def display_subscription_token()
  link_to_braintree (.subscription_token || '#'), 'subscriptions', .subscription_token
end


11
12
13
# File 'app/helpers/admin_helper.rb', line 11

def link_to_braintree(name, resource, id)
  link_to name, "https://#{Rails.env.production? ? 'www' : 'sandbox'}.braintreegateway.com/merchants/#{Braintree::Configuration.merchant_id}/#{resource}/#{id}"
end