effective_orders 2.1.4 → 2.1.5

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: 44ad2e1c15d7e9257ce8517cdb3637cf63c83d53
4
- data.tar.gz: 8b1d66707077365edfe37c1c1d69392807492684
3
+ metadata.gz: fc912e7bf2fc4e12905abff50fab57ca0b8479eb
4
+ data.tar.gz: 8da57b67b1b09169180d2782e690d0dbdc69389f
5
5
  SHA512:
6
- metadata.gz: 54dfe24a820d5759ff2708472a498a435b63bc76ea60b681ef297243297dc7b8bafeeb5854f64ab83c78dbddb18a9d25c11818cf32122a2f6962d79ef563aad3
7
- data.tar.gz: 8f8030d38899be69d6349551be5ba96075bfc69f2e57437a1aa812730578faee9fb9351667f6f9652f63fe56819323ce25eabcac0db60ef435f45c2f2e462194
6
+ metadata.gz: bbf1ba883263abc262431f857bed188b8f9de0653b93cb337ef0338b0773e537ff2d090a5c36b94d29f340b4e4e179263c2e12caff7dc420feada264256fc905
7
+ data.tar.gz: 29744efe4ccfdfe874b5ee905be298950d50dd59c9bdf3070df56751586e8bc9abd621c2a8bf2a2370452d3f7759fe41577e91c313b49accca2af0c3084b4be4
@@ -164,4 +164,21 @@ module EffectiveOrdersHelper
164
164
  end
165
165
  end
166
166
 
167
+ def payment_card_label(card)
168
+ case card.to_s.downcase[0]
169
+ when nil
170
+ 'None'
171
+ when 'v'
172
+ 'Visa'
173
+ when 'm'
174
+ 'MasterCard'
175
+ when 'a'
176
+ 'American Express'
177
+ when 'd'
178
+ 'Discover'
179
+ else
180
+ card.to_s
181
+ end
182
+ end
183
+
167
184
  end
@@ -1,19 +1,5 @@
1
- - if order.purchased?
1
+ - if order.purchased? && order.payment.present?
2
2
  .effective-order-payment-details
3
- %h3 Payment Details
4
- %table.table
5
- %tbody
6
- %tr
7
- %td Provider
8
- %td= order.payment_provider
9
- %tr
10
- %td Card
11
- %td= order.payment_card || 'none'
12
- %tr
13
- %td Purchased at
14
- %td= order.purchased_at.strftime('%Y-%m-%d %H:%M')
15
- - if order.payment.present?
16
- %tr
17
- %td Additional details
18
- %td= tableize_order_payment(order.payment[:details] || order.payment, class: 'table')
3
+ %h3 Payment Provider Details
4
+ = tableize_order_payment(order.payment[:details] || order.payment, class: 'table')
19
5
 
@@ -7,5 +7,6 @@
7
7
  = render partial: 'effective/orders/order_note', locals: {order: order}
8
8
  = render partial: 'effective/orders/order_note_to_buyer', locals: {order: order}
9
9
  = render partial: 'effective/orders/order_items', locals: {order: order}
10
+ = render partial: 'effective/orders/order_payment_details', locals: {order: order}
10
11
  = render partial: 'effective/orders/order_footer', locals: {order: order}
11
12
 
@@ -0,0 +1,18 @@
1
+ - if order.purchased?
2
+ .effective-order-payment-details
3
+ %h3 Payment Details
4
+ %table.table
5
+ %tbody
6
+ %tr
7
+ %td Provider
8
+ %td= order.payment_provider
9
+ %tr
10
+ %td Card
11
+ %td
12
+ = payment_card_label(order.payment_card)
13
+ = (order.payment['f4l4'] rescue nil)
14
+
15
+ %tr
16
+ %td Purchased at
17
+ %td= order.purchased_at.strftime('%Y-%m-%d %H:%M')
18
+
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '2.1.4'.freeze
2
+ VERSION = '2.1.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
@@ -337,6 +337,7 @@ files:
337
337
  - app/views/effective/orders/_order_note.html.haml
338
338
  - app/views/effective/orders/_order_note_fields.html.haml
339
339
  - app/views/effective/orders/_order_note_to_buyer.html.haml
340
+ - app/views/effective/orders/_order_payment_details.html.haml
340
341
  - app/views/effective/orders/_order_shipping.html.haml
341
342
  - app/views/effective/orders/_order_terms_and_conditions_fields.html.haml
342
343
  - app/views/effective/orders/_order_user_fields.html.haml