effective_orders 1.8.0 → 1.8.1

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: 620fed45e324ddd47e54d737c2bc737e9eeec797
4
- data.tar.gz: e7bf75ddee55b77e04ce2ae897b92d9f5b8b52dc
3
+ metadata.gz: e1c32ade8d8bebb1a9228624548b1ab9702e193d
4
+ data.tar.gz: a3b35b62b2b44f30ca4475af4e130ae7dc5d9775
5
5
  SHA512:
6
- metadata.gz: 7293cfe64c1d8b4690038c61356b2861109cbfcaa055324f452f3c699247e14b8415ff6aee20ba131cd5f9fc97943213273d5cffce09b60a1b7da77b79931fd7
7
- data.tar.gz: 071870737b47f189d6759ffecad0230c31dbc9b1577bce69e21d8d203d27d915fc8078ab06518e9af11279836151ef9f48b7746344f6142f8ffcdf1e585aa913
6
+ metadata.gz: 8a573c500321453ec640db547d37096c27f74da1de0d79ed1f4dc805c2a97b4d982f0f570e9e03ea75e510390d706f1bfe6e79f2e280e2bc081d56ecba08c2d2
7
+ data.tar.gz: 87cdd2c31a3a701caf49ad1e6d69c06747c63689ac92ae5a036265229df4d7b98e86c8c7460d5ce632c644fe48f742eb0261fd2573a000d6adc860f8afbaf413
@@ -162,10 +162,10 @@ module Effective
162
162
  # options:
163
163
  # flash: What flash message should be displayed
164
164
  def order_declined(details = nil, redirect_url = nil, options = {})
165
- flash = options.fetch(:flash, "Payment was unsuccessful. Your credit card was declined by the payment processor. Please try again.")
165
+ flash_msg = options.fetch(:flash, "Payment was unsuccessful. Your credit card was declined by the payment processor. Please try again.")
166
166
 
167
167
  @order.decline!(details) rescue nil
168
- flash[:danger] = flash
168
+ flash[:danger] = flash_msg
169
169
 
170
170
  redirect_to (redirect_url.presence || effective_orders.order_declined_path(@order)).gsub(':id', @order.id.to_s)
171
171
  end
@@ -328,8 +328,10 @@ module Effective
328
328
  begin
329
329
  if EffectiveOrders.mailer[:delayed_job_deliver] && EffectiveOrders.mailer[:deliver_method] == :deliver_later
330
330
  (OrdersMailer.delay.public_send(email, *mailer_args) rescue false)
331
- else
331
+ elsif EffectiveOrders.mailer[:deliver_method].present?
332
332
  (OrdersMailer.public_send(email, *mailer_args).public_send(EffectiveOrders.mailer[:deliver_method]) rescue false)
333
+ else
334
+ (OrdersMailer.public_send(email, *mailer_args).deliver_now) rescue false
333
335
  end
334
336
  rescue => e
335
337
  raise e unless Rails.env.production?
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '1.8.0'.freeze
2
+ VERSION = '1.8.1'.freeze
3
3
  end
@@ -352,7 +352,8 @@ describe Effective::OrdersController, type: :controller do
352
352
  post :create, valid_order_attributes
353
353
 
354
354
  expect { Effective::Cart.find(cart.id) }.to raise_error(ActiveRecord::RecordNotFound)
355
- assigns(:cart).cart_items.size.should eq 0
355
+ ci_ids = assigns(:cart).cart_items.collect(&:id)
356
+ expect(Effective::CartItem.where(:id => ci_ids).count).to be 0
356
357
  end
357
358
 
358
359
  it 'redirects to the purchased page' do
@@ -138,6 +138,7 @@ EffectiveOrders.setup do |config|
138
138
  :subject_for_admin_receipt => '',
139
139
  :subject_for_buyer_receipt => '',
140
140
  :subject_for_seller_receipt => '',
141
+ :deliver_method => :deliver_now,
141
142
  :delayed_job_deliver => false
142
143
  }
143
144
 
@@ -153,8 +154,8 @@ EffectiveOrders.setup do |config|
153
154
  }
154
155
  else
155
156
  config.moneris = {
156
- :ps_store_id => '',
157
- :hpp_key => '',
157
+ :ps_store_id => 'foo',
158
+ :hpp_key => 'bar',
158
159
  :hpp_url => 'https://esqa.moneris.com/HPPDP/index.php',
159
160
  :verify_url => 'https://esqa.moneris.com/HPPDP/verifyTxn.php'
160
161
  }
@@ -176,9 +177,9 @@ EffectiveOrders.setup do |config|
176
177
  }
177
178
  else
178
179
  config.paypal = {
179
- :seller_email => '',
180
- :secret => '',
181
- :cert_id => '',
180
+ :seller_email => 'seller@mail.com',
181
+ :secret => 'foo',
182
+ :cert_id => 'bar',
182
183
  :paypal_url => 'https://www.sandbox.paypal.com/cgi-bin/webscr',
183
184
  :currency => 'CAD',
184
185
  :paypal_cert => "#{Rails.root}/config/paypalcerts/#{Rails.env}/paypal_cert.pem",
@@ -204,12 +205,12 @@ EffectiveOrders.setup do |config|
204
205
  }
205
206
  else
206
207
  config.stripe = {
207
- :secret_key => '',
208
- :publishable_key => '',
208
+ :secret_key => 'foo',
209
+ :publishable_key => 'bar',
209
210
  :currency => 'usd',
210
211
  :site_title => 'My Development Site', # Displayed on the Embedded Stripe Form
211
- :site_image => '', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
212
- :connect_client_id => ''
212
+ :site_image => 'foo', # A relative URL pointing to a square image of your brand or product. The recommended minimum size is 128x128px.
213
+ :connect_client_id => 'bar'
213
214
  }
214
215
  end
215
216
 
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.8.0
4
+ version: 1.8.1
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: 2016-01-19 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails