summaryrefslogtreecommitdiff
path: root/engines/billing/app/views/payments/new.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'engines/billing/app/views/payments/new.html.haml')
-rw-r--r--engines/billing/app/views/payments/new.html.haml37
1 files changed, 20 insertions, 17 deletions
diff --git a/engines/billing/app/views/payments/new.html.haml b/engines/billing/app/views/payments/new.html.haml
index e9a8273..67018b2 100644
--- a/engines/billing/app/views/payments/new.html.haml
+++ b/engines/billing/app/views/payments/new.html.haml
@@ -1,17 +1,20 @@
-%h1
- = t(:Donation)
-- if logged_in?
- = t(:donation_not_payment)
-- if @result and @result.errors.size > 0
- %div{:style => "color: red;"}
- = h @result.errors.size
- error(s)
-- if @result and @result.transaction and @result.transaction.status != 'success'
- %div{:style => "color: red;"}
- = t(:processor_declined)
-= braintree_form_for :transaction, :html => {:autocomplete => "off"} do |f|
- = f.label :amount, t(:amount)
- = f.text_field :amount
- = render :partial => 'non_customer_fields', :locals => {:f => f}
- = hidden_field_tag :tr_data, @tr_data
- = f.submit "Submit Donation", :class => 'btn btn-primary'
+%h2.mbs
+ = t(:new_donation)
+%br/
+= form_tag confirm_payment_path, id: "checkout-form" do
+ - if current_user and !current_user.has_payment_info?
+ = render 'customer_form' unless current_user.is_anonymous?
+ %p
+ = t(:donation_info)
+ %div{:id => "payment-form" }
+ %div{:id => "coinbase-container-id" }
+ %input{:name => "amount", :placeholder => "#{t(:donation_amount)}", :type => "text"}
+ %input.btn.btn-primary{:type => "submit", :value => "#{t(:donate)}"}
+%script{:src => "https://js.braintreegateway.com/v2/braintree.js"}
+:javascript
+ var clientToken = "#{@client_token}";
+ braintree.setup(clientToken, "dropin", {
+ container: "payment-form",
+ form: "checkout-form",
+ coinbase: { container: "coinbase-container-id" }
+ });