blob: 7ec92855235aace4d291c4b417fef3808692fb9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
module BillingHelper
def braintree_form_for(object, options = {}, &block)
options.reverse_merge! params: @result && @result.params[object],
errors: @result && @result.errors.for(object),
builder: BraintreeFormHelper::BraintreeFormBuilder,
url: Braintree::TransparentRedirect.url
form_for object, options, &block
end
def show_or_new_customer_link(user)
if (customer = Customer.find_by_user_id(user.id)) and customer.has_payment_info?
show_customer_path(user)
else
new_customer_path
end
end
end
|