This repository has been archived by the owner on Nov 29, 2019. It is now read-only.
forked from railsdog/spree-paypal-express
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add paypalexpress partials to source_forms and source_views
- Loading branch information
Showing
2 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
app/views/spree/admin/payments/source_forms/_paypalexpressuk.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 %> | |||
|
110 changes: 110 additions & 0 deletions
110
app/views/spree/admin/payments/source_views/_paypalexpressuk.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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> |