Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add paypalexpress partials to source_forms and source_views

  • Loading branch information...
commit d48f4649506e876b88244dcb4e5a86250e4ef8f0 1 parent 925613d
@radar radar authored
View
9 app/views/spree/admin/payments/source_forms/_paypalexpressuk.html.erb
@@ -0,0 +1,9 @@
+<% content_for :head do %>
+ <script type="text/javascript">
+ jQuery(document).ready(function(){
+ $("label:contains('<%= payment_method.name %>')").hide();
+ $("label:contains('<%= payment_method.name %>') input").disable();
+ });
+ </script>
+<% end %>
+
View
110 app/views/spree/admin/payments/source_views/_paypalexpressuk.html.erb
@@ -0,0 +1,110 @@
+<fieldset>
+ <legend><%= t('paypal_account') %></legend>
+
+ <table class="index">
+ <tr>
+ <th colspan="6"><%= t('account_details') %></th>
+ </tr>
+ <tr>
+ <td><label><%= t("email") %>:</label></td>
+ <td>
+ <%= payment.source.email %>
+ </td>
+ <td><label><%= t("payer_id") %>:</label></td>
+ <td>
+ <%= payment.source.payer_id %>
+ </td>
+ <td><label><%= t("payer_country") %>:</label></td>
+ <td>
+ <%= payment.source.payer_country %>
+ </td>
+ </tr>
+ <tr>
+ <td><label><%= t("payer_status") %>:</label></td>
+ <td colspan="5">
+ <%= payment.source.payer_status %>
+ </td>
+ </tr>
+ </table>
+</fieldset>
+
+<fieldset>
+ <legend><%= t('transactions') %></legend>
+
+ <% payment.log_entries.reverse.each do |log| %>
+ <% details = YAML.load(log.details) rescue "" %>
+ <table class="index">
+
+ <% if details.is_a? ActiveMerchant::Billing::PaypalExpressResponse %>
+ <tr>
+ <th colspan="6"><%= t('transaction') %> <%= details.params["transaction_id"] %> - <%= log.created_at.to_s(:date_time24) %></th>
+ </tr>
+ <tr>
+ <td width="12%;"><label><%= t('type') %>:</label></td>
+ <td width="20%;">
+ <%= details.params["transaction_type"] %>
+ </td>
+ <td width="8%;"><label><%= t("result") %>:</label></td>
+ <td width="20%;">
+ <%= details.message %>
+ </td>
+ <td width="15%;"><label><%= t("amount") %>:</label></td>
+ <td width="20%;">
+ <%= number_to_currency details.params["gross_amount"] %>
+ </td>
+ </tr>
+ <tr>
+ <td><label><%= t("comment") %>:</label></td>
+ <td colspan="3">
+ <%= details.params["message"] %>
+ </td>
+ <td><label><%= t("status") %>:</label></td>
+ <td>
+ <%= details.params["payment_status"] %>
+ </td>
+ </tr>
+ <% if details.params["payment_status"] == "Pending" %>
+ <tr>
+ <td><label><%= t("pending_reason") %>:</label></td>
+ <td colspan="5">
+ <%= details.params["pending_reason"] %>
+ </td>
+ </tr>
+ <% end %>
+ <% elsif details.is_a? ActiveMerchant::Billing::Integrations::Paypal::Notification %>
+ <tr>
+ <th colspan="6"><%= t('ipn_transaction') %> <%= details.params["txn_id"] %> - <%= log.created_at.to_s(:date_time24) %></th>
+ </tr>
+ <tr>
+ <td width="12%;"><label><%= t('type') %>:</label></td>
+ <td width="20%;">
+ <%= details.params["txn_type"] %>
+ </td>
+ <td width="8%;"><label><%= t("result") %>:</label></td>
+ <td width="20%;">
+ <%= details.params["payment_status"] %>
+ </td>
+ <td width="15%;"><label><%= t("amount") %>:</label></td>
+ <td width="20%;">
+ <%= number_to_currency details.params["mc_gross"] %>
+ </td>
+ </tr>
+ <tr>
+ <td><label><%= t("status") %>:</label></td>
+ <td colspan="5">
+ <%= details.params["payment_status"] %>
+ </td>
+ </tr>
+ <% else %>
+ <tr>
+ <th colspan="6"><%= t('unknown_transaction') %> - <%= log.created_at.to_s(:date_time24) %></th>
+ </tr>
+ <tr>
+ <td colspan="6"><pre style="overflow: hidden; width:600px;"><%= log.details %></pre></th>
+ </tr>
+
+ <% end %>
+ </table>
+ <% end %>
+
+</fieldset>
Please sign in to comment.
Something went wrong with that request. Please try again.