<%= @payment_method.new_record? ? "#{t('plugins.ecommerce.new_payment_methods')}" : "#{t('plugins.ecommerce.edit_payment_methods')}: #{@payment_method.name}" %>

<%= form_for @payment_method, url:{action: @payment_method.new_record? ? :create : :update}, html: {class: 'validate-payment_method', id: 'form-payment_method'} do |f| %>
<%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @payment_method} %>
<%= f.label t('plugins.ecommerce.table.name') %>
<%= f.text_field :name, :class => "form-control required" %>
<%= f.label t('plugins.ecommerce.table.description') %>
<%= f.text_area :description, :class => "form-control translatable", :rows => 4 %>
<% options = @payment_method.options rescue {type: 'bank_transfer'} options = params[:options] if params[:options].present? %>

<%= t('plugins.ecommerce.options_payment_methods') %>


<%= hidden_field_tag( "options[type]", 'bank_transfer') %>

<%= text_field_tag( "options[bank_transfer_number_account]", options[:bank_transfer_number_account], class: "form-control required") %>

<%= text_area_tag( "options[bank_transfer_detail]", options[:bank_transfer_detail], class: "form-control required") %>
Steps here: http://support.berta.me/kb/online-shop/how-to-get-paypal-api-username-password-and-signature-information <%= hidden_field_tag( "options[type]", 'paypal') %>

<%= text_field_tag( "options[paypal_login]", options[:paypal_login], class: "form-control required") %>

<%= text_field_tag( "options[paypal_password]", options[:paypal_password], class: "form-control required") %>

<%= text_field_tag( "options[paypal_signature]", options[:paypal_signature], class: "form-control required") %>
<%= hidden_field_tag( "options[type]", 'credit_card') %>

<%= text_field_tag( "options[cc_paypal_login]", options[:cc_paypal_login], class: "form-control required") %>

<%= text_field_tag( "options[cc_paypal_password]", options[:cc_paypal_password], class: "form-control required") %>

<%= text_field_tag( "options[cc_paypal_signature]", options[:cc_paypal_signature], class: "form-control required") %>
<%= hidden_field_tag('options[type]', 'authorize_net') %>

<%= text_field_tag('options[authorize_net_login_id]', options[:authorize_net_login_id], class: 'form-control required') %>

<%= text_field_tag('options[authorize_net_transaction_key]', options[:authorize_net_transaction_key], class: 'form-control required') %>
<%= hidden_field_tag('options[type]', 'on_delivery') %>

<%= hidden_field_tag('options[type]', 'stripe') %>

<%= text_field_tag('options[stripe_id]', options[:stripe_id], class: 'form-control required') %>

<%= text_field_tag('options[stripe_key]', options[:stripe_key], class: 'form-control required') %>
<% ecommerce_custom_payment_methods.each do |k, obj| %>
<%= hidden_field_tag('options[type]', k) %> <%= render obj[:settings_view_path], options: options %>
<% end %>
<% end %>