effective_orders 1.6.1 → 1.6.3

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: f56436464dbe43fb2f2b12173b21c5b6905f8092
4
- data.tar.gz: fffc2cb0fca162b283bd9c8363ef44ba3d8a85fe
3
+ metadata.gz: 93008369c9c4018e92a6605bde7b37c1d1952992
4
+ data.tar.gz: b9ec1fdfc02964bd077a3c1b8a1eccaab7d6b112
5
5
  SHA512:
6
- metadata.gz: 1a9dac2ae8b2080f739b5c9a64503ded5bdc2725963c3179347fdd441cd389b2dcc4c28928665b3771225caae59d5d6f411a28db03ee30de354757933d9c2002
7
- data.tar.gz: 875e6f55e84c991aa291ed034428bbf623c4c07e38c057dba462fff1bb0dcdfbcab5f7cf0c0e664f614ca0500d0dd01f759369eddba866dc36e6e3964eea128e
6
+ metadata.gz: e2bab85ac8f6749f4b081b44198c6476323a082e9768001a4b3ee4ff81718a48f0fd9dafb7240e69f4f6b4a8fe5ee29452b2f6c3878868f771417c85293037db
7
+ data.tar.gz: f1edea1ec59980aee87fac9cf2652a41f50de0cb78f29d69cac937bda0c98f57605fca429d5c5fae3a0ddfd03faf38b3a4441282c924b3e9f079864918e1bc09
@@ -141,17 +141,18 @@ module Effective
141
141
  protected
142
142
 
143
143
  def order_purchased(details = nil, redirect_url = nil, declined_redirect_url = nil)
144
- begin
144
+ #begin
145
145
  @order.purchase!(details)
146
146
  current_cart.try(:destroy)
147
147
 
148
148
  flash[:success] = "Successfully purchased order"
149
149
 
150
150
  redirect_to (redirect_url.presence || effective_orders.order_purchased_path(':id')).gsub(':id', @order.to_param.to_s)
151
- rescue => e
152
- flash[:danger] = "Unable to process your order. Your card has not been charged. Your Cart items have been restored. Please try again. Error Message: #{e.message}"
153
- redirect_to (declined_redirect_url.presence || effective_orders.cart_path).gsub(':id', @order.to_param.to_s)
154
- end
151
+ #rescue => e
152
+ # binding.pry
153
+ # flash[:danger] = "Unable to process your order. Your card has not been charged. Your Cart items have been restored. Please try again. Error Message: #{e.message}"
154
+ # redirect_to (declined_redirect_url.presence || effective_orders.cart_path).gsub(':id', @order.to_param.to_s)
155
+ #end
155
156
  end
156
157
 
157
158
  def order_declined(details = nil, redirect_url = nil)
@@ -105,7 +105,7 @@ module EffectiveOrdersHelper
105
105
  alias_method :render_my_purchases, :render_order_history
106
106
 
107
107
  # Used by the _payment_details partial
108
- def tableize_hash(hash, options = {class: 'table table-bordered'})
108
+ def tableize_order_payment(hash, options = {class: 'table table-bordered'})
109
109
  if hash.present? && hash.kind_of?(Hash)
110
110
  content_tag(:table, class: options[:class]) do
111
111
  title = options.delete(:title)
@@ -278,10 +278,10 @@ module Effective
278
278
 
279
279
  case provider.to_sym
280
280
  when :stripe_connect
281
- charge = (payment[:charge] || payment['charge'])
281
+ charge = (payment[:charge] || payment['charge'] || {})
282
282
  charge['id'] && charge['customer'] && charge['application_fee'].present?
283
283
  when :stripe
284
- charge = (payment[:charge] || payment['charge'])
284
+ charge = (payment[:charge] || payment['charge'] || {})
285
285
  charge['id'] && charge['customer']
286
286
  when :moneris
287
287
  (payment[:response_code] || payment['response_code']) &&
@@ -1,3 +1,3 @@
1
1
  - if order.payment.present?
2
2
  .effective-order-payment-details
3
- = tableize_hash(order.payment, {class: 'table', title: 'Payment Details'})
3
+ = tableize_order_payment(order.payment, {class: 'table', title: 'Payment Details'})
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '1.6.1'.freeze
2
+ VERSION = '1.6.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-24 00:00:00.000000000 Z
11
+ date: 2015-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails