effective_orders 4.5.6 → 4.5.11

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
  SHA256:
3
- metadata.gz: 108bf2867a6343e481d8e492c4e86fe7e3b1548594441c0b87a95b4a8181047a
4
- data.tar.gz: 9d7b4cb4ca78ed441b178e613eb610ec2270a52e56d970683a74fab2b0b21aa2
3
+ metadata.gz: f1e00998a7bf70939f686faf24ecf1ad4248f232bca18bfd1abb1074cadf4881
4
+ data.tar.gz: 2ee502e056f89522b4a88480fe2d4a8995a70d6bcbeb7abecfd41a09a85f6862
5
5
  SHA512:
6
- metadata.gz: 581d284694814a347ec8b5f9839e17778927dce8a9be9cbf310ef350fa8cd4f3551ea6190de14720c17be63a0e99a928717bbc64b31bdf58331938729e76a56f
7
- data.tar.gz: 1a8d09ecfc10fde8c7ff8524d2b34b30d01348c33d1d06999852638bbb806de98bacbb9aa510fc065b642e2597bfbc08e42fa8bfd3eedeb3328d29f86285b507
6
+ metadata.gz: 0f0b25a0e32aea32cd5b66a521509181b347ce58c4a6e858064de8fc7192796456d1ac49c5e96515a8b442d8958e7398490ffbc165fb4cc853c83ab1650eba8b
7
+ data.tar.gz: 6ef0bedaa012be759e8645296eb6c0aae894b815c92ec7964e5d6dc712eb9139bab52c0d9a9bcee0f661a174fcb7c8c9d1754e5a9f817742020f68b9d07f7043
data/README.md CHANGED
@@ -828,6 +828,12 @@ effective_orders works around this by appending a timestamp to the order ID.
828
828
 
829
829
  Make sure `gem 'stripe'` is included in your Gemfile.
830
830
 
831
+ Add to your application layout / header
832
+
833
+ ```
834
+ = javascript_include_tag 'https://js.stripe.com/v3/'
835
+ ```
836
+
831
837
  First register for an account with Stripe
832
838
 
833
839
  https://manage.stripe.com/register
@@ -1001,4 +1007,3 @@ MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
1001
1007
  4. Push to the branch (`git push origin my-new-feature`)
1002
1008
  5. Bonus points for test coverage
1003
1009
  6. Create new Pull Request
1004
-
@@ -76,3 +76,4 @@ this.StripeForm ||= class StripeForm
76
76
  EffectiveForm.invalidate(@form);
77
77
 
78
78
  $ -> (new StripeForm()).initialize()
79
+ $(document).on 'turbolinks:load', -> (new StripeForm()).initialize()
@@ -145,7 +145,7 @@ module Admin
145
145
  end
146
146
 
147
147
  def send_payment_request
148
- @order = Effective::Order.pending.find(params[:id])
148
+ @order = Effective::Order.not_purchased.find(params[:id])
149
149
  authorize_effective_order!
150
150
 
151
151
  if @order.send_payment_request_to_buyer!
@@ -164,7 +164,7 @@ module Admin
164
164
  end
165
165
 
166
166
  def bulk_send_payment_request
167
- @orders = Effective::Order.pending.where(id: params[:ids])
167
+ @orders = Effective::Order.not_purchased.where(id: params[:ids])
168
168
 
169
169
  begin
170
170
  authorize_effective_order!
@@ -6,7 +6,7 @@ module Effective
6
6
 
7
7
  def show
8
8
  @cart = current_cart
9
- @pending_orders = Effective::Order.pending.where(user: current_user) if current_user.present?
9
+ @pending_orders = Effective::Order.not_purchased.where(user: current_user) if current_user.present?
10
10
 
11
11
  @page_title ||= 'My Cart'
12
12
  EffectiveOrders.authorize!(self, :show, @cart)
@@ -24,7 +24,8 @@ module Effective
24
24
 
25
25
  def mark_as_paid_params
26
26
  params.require(:effective_order).permit(
27
- :payment, :payment_provider, :payment_card, :note_to_buyer, :send_mark_as_paid_email_to_buyer
27
+ :purchased_at, :payment, :payment_provider, :payment_card,
28
+ :note_to_buyer, :send_mark_as_paid_email_to_buyer
28
29
  )
29
30
  end
30
31
 
@@ -382,11 +382,11 @@ module Effective
382
382
 
383
383
  raise "Failed to purchase order: #{error || errors.full_messages.to_sentence}" unless error.nil?
384
384
 
385
+ run_purchasable_callbacks(:after_purchase)
386
+
385
387
  send_refund_notification! if email && refund?
386
388
  send_order_receipts! if email
387
389
 
388
- run_purchasable_callbacks(:after_purchase)
389
-
390
390
  true
391
391
  end
392
392
 
@@ -538,7 +538,11 @@ module Effective
538
538
  end
539
539
 
540
540
  def send_email(email, *mailer_args)
541
- Effective::OrdersMailer.public_send(email, *mailer_args).public_send(EffectiveOrders.mailer[:deliver_method])
541
+ begin
542
+ Effective::OrdersMailer.public_send(email, *mailer_args).public_send(EffectiveOrders.mailer[:deliver_method])
543
+ rescue => e
544
+ raise if Rails.env.development? || Rails.env.test?
545
+ end
542
546
  end
543
547
 
544
548
  def truthy?(value)
@@ -3,6 +3,8 @@
3
3
  %h2 Admin: Mark as Paid
4
4
 
5
5
  = effective_form_with(model: order, url: effective_orders.mark_as_paid_order_path(order), method: :post) do |f|
6
+ = f.date_field :purchased_at, required: true
7
+
6
8
  = f.select :payment_provider, EffectiveOrders.payment_providers, required: true
7
9
 
8
10
  = f.text_field :payment_card,
@@ -20,4 +22,3 @@
20
22
  = f.text_area :note_to_buyer, hint: 'This message will be displayed on the receipt.'
21
23
 
22
24
  = f.submit order_checkout_label(:mark_as_paid), center: true
23
-
@@ -1,4 +1,4 @@
1
- = javascript_include_tag 'https://js.stripe.com/v3/'
1
+ /= javascript_include_tag 'https://js.stripe.com/v3/'
2
2
 
3
3
  - stripe = stripe_payment_intent(order)
4
4
 
@@ -204,7 +204,7 @@ module EffectiveOrders
204
204
  currency: plan.currency,
205
205
  interval: plan.interval,
206
206
  interval_count: plan.interval_count,
207
- trial_period_days: plan.trial_period_days
207
+ trial_period_days: (plan.trial_period_days if plan.respond_to?(:trial_period_days))
208
208
  }
209
209
  end.sort do |x, y|
210
210
  val ||= (x[:interval] <=> y[:interval])
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '4.5.6'.freeze
2
+ VERSION = '4.5.11'.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: 4.5.6
4
+ version: 4.5.11
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: 2020-08-18 00:00:00.000000000 Z
11
+ date: 2020-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails