tb_checkout 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72b41d203ad250ac03a6ff8dfdb7742c2a2b5e95
4
- data.tar.gz: 7aed0b974b9c4f816c18c355835fb558e3dc7c0b
3
+ metadata.gz: 9e3560014c484a57a52918acaaf59787824300d7
4
+ data.tar.gz: 3cda17fad3ef8bc01f1d082046bac3a7d4e66754
5
5
  SHA512:
6
- metadata.gz: 55daefc75b862d7af121583ac3f3e77a503745fcd136cbe42288602fe7596ef13c1f79e4302e34850288ac9ff647df98d2eb2ac19829586f3f06a0612018539b
7
- data.tar.gz: fbf80bdfb59d06bfca9d6b02fe6d37c10f14e8f0516b111996be345e2d7ed7112257277db1786874a52f1e5995f7940e35fe0835e6f35d14dc42897bdcc7a1b2
6
+ metadata.gz: ebe45ae6b8648965a8b9a316af4d468e01099294969f921b1d6d7638e49534371f06c45bce6bf5ec336532d596ba70686631c4760edb106df31915f87ecca48d
7
+ data.tar.gz: c9aad41fc87e1ded077830875aeddb2176300cc152ff892b4f9ce44347dfe426c704d96e9bf29585b6775a1b8e27e6494288dc8f405ac0a9b6cfcacec856d243
@@ -136,6 +136,14 @@ module TbCheckout
136
136
  end
137
137
  end
138
138
 
139
+ def response_json
140
+ begin
141
+ return JSON.parse(response_text)
142
+ rescue JSON::ParseError
143
+ return {}
144
+ end
145
+ end
146
+
139
147
  private
140
148
 
141
149
  def void!
@@ -1,22 +1,22 @@
1
1
  <div class="table-responsive">
2
2
  <table class="table table-striped table-hover">
3
3
  <thead>
4
- <th>Invoice Number</th>
5
4
  <th>Transaction ID</th>
6
5
  <th>Billing Name</th>
7
6
  <th>Card</th>
8
7
  <th>Amount Charged</th>
8
+ <th>Date</th>
9
9
  <th>Status</th>
10
10
  <th></th>
11
11
  </thead>
12
12
  <tbody>
13
13
  <% transactions.each do |transaction| %>
14
14
  <tr>
15
- <td><%= transaction.invoice_num %></td>
16
15
  <td><%= transaction.gateway_transaction_id %></td>
17
16
  <td class="no-wrap"><%= transaction.billing_full_name %></td>
18
17
  <td class="no-wrap"><%= transaction.card_display %> (<%= transaction.card_type %>)</td>
19
18
  <td><%= number_to_currency transaction.amount_charged %></td>
19
+ <td><%= transaction.created_at.strftime('%D %-l:%M %p') %></td>
20
20
  <td><%= tb_checkout_status_label_for_transaction(transaction.status) %></td>
21
21
  <td><%= link_to 'Detail', tb_checkout_admin_transaction_path(transaction), :class => 'btn btn-sm btn-default' %></td>
22
22
  </tr>
@@ -4,4 +4,5 @@
4
4
 
5
5
  <% content_for :detail do %>
6
6
  <%= render :partial => 'table', :locals => {:transactions => @transactions} %>
7
+ <%= will_paginate @transactions, :renderer => BootstrapPagination::Rails %>
7
8
  <% end %>
@@ -8,6 +8,7 @@
8
8
  <th>Transaction ID</th>
9
9
  <th>Card</th>
10
10
  <th>Amount Charged</th>
11
+ <th>Date</th>
11
12
  <th>Status</th>
12
13
  </tr>
13
14
  </thead>
@@ -17,6 +18,7 @@
17
18
  <td><%= @transaction.gateway_transaction_id %></td>
18
19
  <td><%= @transaction.card_display %> (<%= @transaction.card_type %>)</td>
19
20
  <td><%= number_to_currency @transaction.amount_charged %></td>
21
+ <td><%= @transaction.created_at.strftime('%D %-l:%M %p') %></td>
20
22
  <td><%= tb_checkout_status_label_for_transaction(@transaction.status) %></td>
21
23
  </tbody>
22
24
  </table>
@@ -74,3 +76,7 @@
74
76
  </tfoot>
75
77
  </table>
76
78
  </div>
79
+
80
+ <h3>API Response Text</h3>
81
+
82
+ <%= debug @transaction.response_json %>
@@ -1,65 +1,60 @@
1
1
  <% editable = true if local_assigns[:editable].nil? %>
2
2
  <% cart = local_assigns[:cart].nil? ? @cart : cart %>
3
3
 
4
- <% cache [cart, cart.cart_items, editable] do %>
5
- <div class="table-responsive">
6
- <table class="table tb-checkout-cart-table">
7
- <thead>
8
- <tr>
9
- <th>Product</th>
10
- <th>Quantity</th>
11
- <th>Price</th>
12
- <% if editable %>
13
- <th></th>
14
- <% end %>
15
- </tr>
16
- </thead>
17
- <tbody>
18
- <% cart.cart_items.each do |cart_item| %>
19
- <% cache [cart, cart_item, editable] do %>
20
- <tr class="tb-checkout-cart-row">
21
- <td>
22
- <% if cart_item.has_item_url? %>
23
- <%= link_to cart_item.item_description, cart_item.item_url(self) %>
24
- <% else %>
25
- <%= cart_item.item_description %>
26
- <% end %>
27
- <% if cart.is_completed? && cart_item.has_detail_view? %>
28
- <div class="tb-checkout-cart-row-detail">
29
- <%= render :partial => cart_item.detail_view, :locals => {:item => cart_item.item} %>
30
- </div>
31
- <% end %>
32
- </td>
33
- <td>
34
- <% if editable && cart_item.item.class.quantity_is_editable %>
35
- <%= form_for cart_item, :html => {:class => 'tb-checkout-cart-item-update-form'} do |f| %>
36
- <%= f.number_field :quantity %>
37
- <%= f.submit 'Update', :class => 'btn btn-sm tb-checkout-cart-item-update-submit' %>
38
- <% end %>
39
- <% else %>
40
- <%= cart_item.quantity %>
41
- <% end %>
42
- </td>
43
- <td><%= number_to_currency cart_item.total_price %></td>
44
- <td>
45
- <% if editable %>
46
- <%= link_to 'Remove', tb_checkout_cart_item_path(cart_item), :method => :delete, :class => 'btn btn-sm btn-danger tb-checkout-cart-item-remove' %>
47
- <% end %>
48
- </td>
49
- </tr>
50
- <% end %>
4
+ <div class="table-responsive">
5
+ <table class="table tb-checkout-cart-table">
6
+ <thead>
7
+ <tr>
8
+ <th>Product</th>
9
+ <th>Quantity</th>
10
+ <th>Price</th>
11
+ <% if editable %>
12
+ <th></th>
51
13
  <% end %>
52
- </tbody>
53
- <tfoot>
54
- <tr>
55
- <td colspan="2">
56
- Total
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ <% cart.cart_items.each do |cart_item| %>
18
+ <tr class="tb-checkout-cart-row">
19
+ <td>
20
+ <% if cart_item.has_item_url? %>
21
+ <%= link_to cart_item.item_description, cart_item.item_url(self) %>
22
+ <% else %>
23
+ <%= cart_item.item_description %>
24
+ <% end %>
25
+ <% if cart.is_completed? && cart_item.has_detail_view? %>
26
+ <div class="tb-checkout-cart-row-detail">
27
+ <%= render :partial => cart_item.detail_view, :locals => {:item => cart_item.item} %>
28
+ </div>
29
+ <% end %>
30
+ </td>
31
+ <td>
32
+ <% if editable && cart_item.item.class.quantity_is_editable %>
33
+ <%= form_for cart_item, :html => {:class => 'tb-checkout-cart-item-update-form'} do |f| %>
34
+ <%= f.number_field :quantity %>
35
+ <%= f.submit 'Update', :class => 'btn btn-sm tb-checkout-cart-item-update-submit' %>
36
+ <% end %>
37
+ <% else %>
38
+ <%= cart_item.quantity %>
39
+ <% end %>
40
+ </td>
41
+ <td><%= number_to_currency cart_item.total_price %></td>
42
+ <td>
43
+ <% if editable %>
44
+ <%= link_to 'Remove', tb_checkout_cart_item_path(cart_item), :method => :delete, :class => 'btn btn-sm btn-danger tb-checkout-cart-item-remove' %>
45
+ <% end %>
57
46
  </td>
58
- <td><%= number_to_currency cart.total_price %></td>
59
- <td></td>
60
47
  </tr>
61
- </tfoot>
62
- </table>
63
- <% end %>
64
-
48
+ <% end %>
49
+ </tbody>
50
+ <tfoot>
51
+ <tr>
52
+ <td colspan="2">
53
+ Total
54
+ </td>
55
+ <td><%= number_to_currency cart.total_price %></td>
56
+ <td></td>
57
+ </tr>
58
+ </tfoot>
59
+ </table>
65
60
  </div>
@@ -1,10 +1,8 @@
1
1
  <h1>My Cart</h1>
2
2
 
3
- <% cache @cart do %>
4
- <% if @cart.blank? || @cart.is_empty? %>
5
- <p>Your shopping cart is currently empty.</p>
6
- <% else %>
7
- <%= render 'cart' %>
8
- <p><%= link_to 'Check Out', new_tb_checkout_transaction_path, :class => 'btn btn-primary' %></p>
9
- <% end %>
3
+ <% if @cart.blank? || @cart.is_empty? %>
4
+ <p>Your shopping cart is currently empty.</p>
5
+ <% else %>
6
+ <%= render 'cart' %>
7
+ <p><%= link_to 'Check Out', new_tb_checkout_transaction_path, :class => 'btn btn-primary' %></p>
10
8
  <% end %>
@@ -1,8 +1,6 @@
1
1
  <h1>Check Out</h1>
2
2
 
3
- <% cache @cart do %>
4
- <%= render :partial => '/tb_checkout/carts/cart', :locals => {:editable => false, :cart => @cart} %>
5
- <% end %>
3
+ <%= render :partial => '/tb_checkout/carts/cart', :locals => {:editable => false, :cart => @cart} %>
6
4
 
7
5
  <h2>Billing Info</h2>
8
6
 
@@ -3,12 +3,8 @@
3
3
  <p>Print this page for your records.</p>
4
4
 
5
5
  <h4>Your Order</h4>
6
- <% cache @transaction.cart do %>
7
- <%= render :partial => '/tb_checkout/carts/cart', :locals => {:editable => false, :cart => @transaction.cart} %>
8
- <% end %>
6
+ <%= render :partial => '/tb_checkout/carts/cart', :locals => {:editable => false, :cart => @transaction.cart} %>
9
7
 
10
- <% cache @transaction do %>
11
- <%= render 'details' %>
12
- <% end %>
8
+ <%= render 'details' %>
13
9
 
14
10
  <p><%= link_to 'View My Orders', tb_checkout_transactions_path %></p>
@@ -1,3 +1,3 @@
1
1
  module TbCheckout
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tb_checkout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Westlake Design
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-02 00:00:00.000000000 Z
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tb_core