diff options
author | azul <azul@leap.se> | 2015-10-19 11:19:43 +0200 |
---|---|---|
committer | azul <azul@leap.se> | 2015-10-19 11:19:43 +0200 |
commit | 04302654c223dba1c9a06922afaa7462966ea122 (patch) | |
tree | edd493015ce03bb1fb80cc61aa3076fdf8fc467f /engines/billing/app/views/payments/new.html.haml | |
parent | c2cc1a48a4faeff4088cdf5f56e6b0382acfb346 (diff) | |
parent | 8abadb0fe7618e978d9d297ce62fb6c0228c7191 (diff) |
Merge pull request #198 from claucece/develop
Braintree_implementation
Diffstat (limited to 'engines/billing/app/views/payments/new.html.haml')
-rw-r--r-- | engines/billing/app/views/payments/new.html.haml | 37 |
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" } + }); |