<%= render :partial => 'kaui/custom_fields/list_bar', :locals => {:custom_fields => custom_fields} %> <% if payment.capturable? || payment.voidable? || (payment.refundable? && (can?(:refund, Kaui::Payment) || can?(:chargeback, Kaui::Payment))) %>
<% if payment.refundable? %> <% if can? :refund, Kaui::Payment %> <% if payment.target_invoice_id.present? %> <%= link_to ' Refund'.html_safe, kaui_engine.new_account_refund_path(payment.account_id, :params => {:payment_id => payment.payment_id, :invoice_id => payment.target_invoice_id}) %> <% else %> <%= link_to ' Refund'.html_safe, kaui_engine.new_account_transaction_path(payment.account_id, :payment_id => payment.payment_id, :payment_method_id => payment.payment_method_id, :amount => payment.amount_refundable, :currency => payment.currency, :transaction_type => 'REFUND') %> <% end %> <% end %> <% if can? :chargeback, Kaui::Payment %> <% if payment.target_invoice_id.present? %> <%= link_to ' Chargeback'.html_safe, kaui_engine.new_account_chargeback_path(payment.account_id, :payment_id => payment.payment_id, :invoice_id => payment.target_invoice_id) %> <% else %> <%= link_to ' Chargeback'.html_safe, kaui_engine.new_account_transaction_path(payment.account_id, :payment_id => payment.payment_id, :payment_method_id => payment.payment_method_id, :amount => payment.amount_refundable, :currency => payment.currency, :transaction_type => 'CHARGEBACK') %> <% end %> <% end %> <% end %> <% if payment.capturable? %> <%= link_to ' Capture'.html_safe, kaui_engine.new_account_transaction_path(payment.account_id, :payment_id => payment.payment_id, :payment_method_id => payment.payment_method_id, :amount => payment.amount_capturable, :currency => payment.currency, :transaction_type => 'CAPTURE') %> <% end %> <% if payment.voidable? %> <%= link_to ' Void'.html_safe, kaui_engine.new_account_transaction_path(payment.account_id, :payment_id => payment.payment_id, :payment_method_id => payment.payment_method_id, :transaction_type => 'VOID') %> <% end %>
<% end %> <% gateway_url = gateway_url(payment_method, payment) %> <% unless gateway_url.nil? %> <% end %>
<% (payment.transactions || []).each do |transaction| %> <% end %>
Date Type Amount Transaction external key First id Second id Gateway code Gateway message Status
<%= format_date(transaction.effective_date, account.time_zone).html_safe %> <%= transaction.transaction_type %> <% if transaction.amount.present? %> <%= humanized_money_with_symbol Kaui::Transaction.amount_to_money(transaction) %> (<%= transaction.currency %>) <% end %> <%= transaction.transaction_external_key %> <%= transaction.first_payment_reference_id %> <%= transaction.second_payment_reference_id %> <%= transaction.gateway_error_code %> <%= transaction.gateway_error_msg %>
  • <%= colored_transaction_status(transaction.status) %> <% if current_user.root? %> <%= link_to ' '.html_safe, kaui_engine.new_account_transaction_path(payment.account_id, :payment_id => payment.payment_id, :transaction_id => transaction.transaction_id) %> <% end %>
  • <% if transaction.next_retry_date %>
  • Scheduled retry: <%= transaction.next_retry_date %> <% if can? :trigger, Kaui::Payment %> <%= link_to ''.html_safe, kaui_engine.payment_cancel_scheduled_payment_path(payment.payment_id, :account_id => payment.account_id, :transaction_external_key => transaction.transaction_external_key), :method => :delete %> <% end %>
  • <% end %> <% (transaction.properties || []).sort_by { |p| p.key }.each do |property| %> <% next if property.value.blank? %>
  • <%= property.key %> : <%= is_json?(property.value) ? "
    #{JSON.pretty_generate(JSON.parse(property.value))}
    ".html_safe : property.value %>
  • <% end %>
<%= javascript_tag do %> $(document).ready(function() { $('#payment_<%= payment.payment_id %>').dataTable({ "dom": "t", "paging": false }); }); <% end %>