Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Introduce 3D Secure configuration flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cedum committed Oct 11, 2019
1 parent e0add97 commit 26ceb0f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

<% if current_store.braintree_configuration.credit_card? %>
<script src="https://js.braintreegateway.com/web/3.52.0/js/hosted-fields.min.js"></script>

<% if current_store.braintree_configuration.three_d_secure? %>
<script src="https://js.braintreegateway.com/web/3.52.0/js/three-d-secure.min.js"></script>
<% end %>
<% end %>

<% if current_store.braintree_configuration.apple_pay? %>
Expand Down
6 changes: 6 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ en:
activerecord:
models:
solidus_paypal_braintree/gateway: Braintree
attributes:
solidus_paypal_braintree/configuration:
paypal: PayPal
apple_pay: Apple Pay
credit_card: Credit Card
three_d_secure: 3D Secure
spree:
admin:
tab:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Add3dSecureToBraintreeConfiguration < SolidusSupport::Migration[4.2]
def change
add_column :solidus_paypal_braintree_configurations, :three_d_secure, :boolean, null: false, default: false
end
end

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def configurations_params
:paypal,
:apple_pay,
:credit_card,
:three_d_secure,
:preferred_paypal_button_locale,
:preferred_paypal_button_color,
:preferred_paypal_button_size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,37 @@
<% @configurations.each do |config| %>
<div class="row">
<fieldset>
<h1><%= config.store.name %></h1>
<legend><%= config.store.name %></legend>

<%= f.fields_for 'configuration_fields[]', config do |c| %>
<div class="field">
<%= c.label :paypal %>
<%= c.check_box :paypal %>
<%= c.label :paypal do %>
<%= tag.i class: 'fa fa-paypal' %>
<%= c.object.class.human_attribute_name(:paypal) %>
<% end %>
</div>

<div class="field">
<%= c.label :apple_pay %>
<%= c.check_box :apple_pay %>
<%= c.label :apple_pay do %>
<%= tag.i class: 'fa fa-apple' %>
<%= c.object.class.human_attribute_name(:apple_pay) %>
<% end %>
</div>

<div class="field">
<%= c.label :credit_card %>
<%= c.check_box :credit_card %>
<%= c.label :credit_card do %>
<%= tag.i class: 'fa fa-credit-card' %>
<%= c.object.class.human_attribute_name(:credit_card) %>
<% end %>
+
<%= c.check_box :three_d_secure %>
<%= c.label :three_d_secure do %>
<%= tag.i class: 'fa fa-shield' %>
<%= c.object.class.human_attribute_name(:three_d_secure) %>
<% end %>
</div>

<% config.admin_form_preference_names.each do |name| %>
Expand All @@ -32,5 +49,7 @@
</div>
<% end %>

<%= submit_tag %>
<div class="form-buttons filter-actions actions">
<%= submit_tag "Update", class: 'btn btn-primary' %>
</div>
<% end %>

0 comments on commit 26ceb0f

Please sign in to comment.