summaryrefslogtreecommitdiff
path: root/billing
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-05-02 10:53:42 -0700
committerAzul <azul@leap.se>2013-07-17 10:47:13 +0200
commitfe0ac266a797523492fe3b2c750e7862f51b152f (patch)
treecf83a73fd7e6f1361a088ee080db281445c26f64 /billing
parent7eab7e33730e12eeb460d2b3965a8712320aff54 (diff)
Added notices to redirects.
Diffstat (limited to 'billing')
-rw-r--r--billing/app/controllers/customers_controller.rb2
-rw-r--r--billing/app/controllers/payments_controller.rb4
-rw-r--r--billing/app/controllers/subscriptions_controller.rb2
3 files changed, 4 insertions, 4 deletions
diff --git a/billing/app/controllers/customers_controller.rb b/billing/app/controllers/customers_controller.rb
index e62472f..3479448 100644
--- a/billing/app/controllers/customers_controller.rb
+++ b/billing/app/controllers/customers_controller.rb
@@ -16,7 +16,7 @@ class CustomersController < BillingBaseController
def new
if customer = Customer.find_by_user_id(current_user.id)
- redirect_to edit_customer_path(customer.braintree_customer_id)
+ redirect_to edit_customer_path(customer.braintree_customer_id), :notice => 'Here is your saved customer data'
else
@tr_data = Braintree::TransparentRedirect.
create_customer_data(:redirect_url => confirm_customer_url)
diff --git a/billing/app/controllers/payments_controller.rb b/billing/app/controllers/payments_controller.rb
index 41b7b3e..49a0c8a 100644
--- a/billing/app/controllers/payments_controller.rb
+++ b/billing/app/controllers/payments_controller.rb
@@ -6,7 +6,8 @@ class PaymentsController < ApplicationController
@default_cc = @customer.default_credit_card(@braintree_data)
@tr_data = transparent_redirect(@customer.braintree_customer_id)
else
- redirect_to new_customer_path
+ # TODO: this requires user to add self to vault before making payment. Is that desired functionality?
+ redirect_to new_customer_path, :notice => 'Before making payment, please add your customer data'
end
else
# anonymous payment not attributed to any user (ie, donation)
@@ -29,7 +30,6 @@ class PaymentsController < ApplicationController
def transparent_redirect(braintree_customer_id = nil)
Braintree::TransparentRedirect.transaction_data(:redirect_url => confirm_payment_url,
:transaction => {:type => "sale", :customer_id => braintree_customer_id, :options => {:submit_for_settlement => true } })
-
end
diff --git a/billing/app/controllers/subscriptions_controller.rb b/billing/app/controllers/subscriptions_controller.rb
index 9735527..b248be5 100644
--- a/billing/app/controllers/subscriptions_controller.rb
+++ b/billing/app/controllers/subscriptions_controller.rb
@@ -7,7 +7,7 @@ class SubscriptionsController < ApplicationController
customer = Customer.find_by_user_id(current_user.id)
if subscription = customer.single_subscription
- redirect_to subscription_path(subscription.id)
+ redirect_to subscription_path(subscription.id), :notice => 'You already have an active subscription'
else
credit_card = customer.default_credit_card #safe to assume default?
@payment_method_token = credit_card.token