Skip to content

Commit

Permalink
Merge pull request #294 from spree/sp-167/allow-paymentmethod-registe…
Browse files Browse the repository at this point in the history
…r-custom-partial-view

Allow PaymentMethod to register a custom partial view to display above "Payment Provider Settings"
  • Loading branch information
rafalcymerys authored Jan 10, 2024
2 parents ae0d45a + b2249b5 commit 2ebeb2b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/views/spree/admin/payment_methods/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@

<% unless @object.new_record? %>
<div class="col-12 col-md-6">

<% if @object.respond_to?(:payment_configuration_guide) %>
<div class="card mb-3">
<div class="card-header">
<h5 class="mb-0"><%= Spree.t(:payment_method_configuration) %></h5>
</div>
<div class="card-body">
<%= render "spree/admin/payment_methods/configuration_guides/#{@object.payment_configuration_guide}" %>
</div>
</div>
<% end %>

<div class="card mb-3">
<div class="card-header">
<h5 class="mb-0"><%= Spree.t(:payment_provider_settings) %></h5>
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,6 @@ en:
taxes_section:
message_with_taxes: You're tax calculation is setup!
message_without_taxes: You can use tax services such as TaxJar or setup tax calculation manually
payment_methods:
edit:
payment_method_configuration: "Payment Method Configuration"

0 comments on commit 2ebeb2b

Please sign in to comment.