Adding IPNs
This commit is contained in:
26
app/views/ipns/index.html.erb
Normal file
26
app/views/ipns/index.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<html><body>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Name</th>
|
||||
<th>Item</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
<% @ipns.reverse!.each do |ipn| %>
|
||||
<tr>
|
||||
<td><%= ipn.payment_date %></td>
|
||||
<td><%= ipn.first_name %> <%= ipn.last_name %></td>
|
||||
<td><%= ipn.item_name %></td>
|
||||
<td><%= ipn.payment_gross %></td>
|
||||
<td>
|
||||
<% if ipn.payment.present? %>
|
||||
<%= link_to "Linked Payment", ipn.payment %>
|
||||
<% else %>
|
||||
<%= link_to "Try to link email '#{ipn.payer_email}' at membership level '#{ipn.payment_gross.to_i}'", link_ipn_path(ipn) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= link_to "Details", ipn %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</body></html>
|
||||
123
app/views/ipns/new.html.erb
Normal file
123
app/views/ipns/new.html.erb
Normal file
@@ -0,0 +1,123 @@
|
||||
<%= form_tag('/ipns') do |f| %>
|
||||
|
||||
<style type="text/css">
|
||||
label {
|
||||
width: 10em;
|
||||
display: inline-block;}
|
||||
</style>
|
||||
|
||||
<div class="actions">
|
||||
<%= submit_tag %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :first_name %>
|
||||
<%= text_field_tag :first_name, "John" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :last_name %>
|
||||
<%= text_field_tag :last_name, "Smith" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :payer_email %>
|
||||
<%= text_field_tag :payer_email, "jsmith@example.com" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :item_name %>
|
||||
<%= text_field_tag :item_name, "Associate Membership" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :payment_gross %>
|
||||
<%= text_field_tag :payment_gross, "25.00" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :transaction_subject %>
|
||||
<%= text_field_tag :transaction_subject, "" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :payment_date %>
|
||||
<%= text_field_tag :payment_date, Date.today.to_s %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :txn_type %>
|
||||
<%= text_field_tag :txn_type, "subscr_payment" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :subscr_id %>
|
||||
<%= text_field_tag :subscr_id, "I-1234567890" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :residence_country %>
|
||||
<%= text_field_tag :residence_country, "US" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :mc_currency %>
|
||||
<%= text_field_tag :mc_currency, "USD" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :business %>
|
||||
<%= text_field_tag :business, "hslfinances@gmail.com" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :payment_type %>
|
||||
<%= text_field_tag :payment_type, "instant" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :protection_eligibility %>
|
||||
<%= text_field_tag :protection_eligibility, "Ineligible" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :verify_sign %>
|
||||
<%= text_field_tag :verify_sign, "12ru9021j9f21j90fj1290fj2910fj0219fj0" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :payer_status %>
|
||||
<%= text_field_tag :payer_status, "verified" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :txn_id %>
|
||||
<%= text_field_tag :txn_id, "1234567890" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :receiver_email %>
|
||||
<%= text_field_tag :receiver_email, "hslfinances@gmail.com" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :payer_id %>
|
||||
<%= text_field_tag :payer_id, "V812314914" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :receiver_id %>
|
||||
<%= text_field_tag :receiver_id, "V90R1280182" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :payment_status %>
|
||||
<%= text_field_tag :payment_status, "Completed" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :payment_fee %>
|
||||
<%= text_field_tag :payment_fee, "0.85" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :mc_fee %>
|
||||
<%= text_field_tag :mc_fee, "0.85" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :mc_gross %>
|
||||
<%= text_field_tag :mc_gross, "25.00" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :charset %>
|
||||
<%= text_field_tag :charset, "windows-1252" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :notify_version %>
|
||||
<%= text_field_tag :notify_version, "3.7" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= label_tag :ipn_track_id %>
|
||||
<%= text_field_tag :ipn_track_id, "9d3d032d9070" %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= submit_tag %>
|
||||
</div>
|
||||
<% end %>
|
||||
17
app/views/ipns/show.html.erb
Normal file
17
app/views/ipns/show.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<h2>IPN Details</h2>
|
||||
|
||||
<% @ipn.attributes.except("data","payment_id").each do |attr| %>
|
||||
<p>
|
||||
<b><%= attr.first.to_s %>:</b>
|
||||
<%= @ipn.attributes[attr.first] %>
|
||||
</p>
|
||||
<% end %>
|
||||
<p>
|
||||
<% if @ipn.payment.present? %>
|
||||
<%= link_to "Payment", @ipn.payment %>
|
||||
<% else %>
|
||||
Couldn't link '<%= @ipn.payer_email %>' or payment amount '<%= @ipn.payment_gross.to_i %>' not a valid membership level. Please create payment manually.
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<%= link_to "Back", ipns_path %>
|
||||
Reference in New Issue
Block a user