effective_orders 4.5.8 → 4.6.0

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: fe17b4322391ee31880303afd90c92998a86da1cb2cd0fb82fa716783e481635
4
- data.tar.gz: d3370f18d4c440ffdde9aa59207f586ba38abcf73e91974ee1e7f8866ba1ab82
3
+ metadata.gz: 045c411a2aab9746571e5633f3f42403bec134ae2305a01557c7085227dc03eb
4
+ data.tar.gz: 591a2893a8d22a7618d77debbcc17c03218c351bbceb0ffa8398afad4965559f
5
5
  SHA512:
6
- metadata.gz: 00af503a2181c78ad3ac1d587aeda9bbc9b35bafab752cb37f28f5c64c5ba787070b6685bdb455745b16ee33fcd7940e272cdedea8b672188788bd496e21e6aa
7
- data.tar.gz: eb5199b72923d9236016e2a81ed0b102d9a28b0112cba3924dc72c1dbaad1d5b1b5cc9c2ea73141af58010ab12d517de3c34b544e46e3c64b5d08c5ea18fa241
6
+ metadata.gz: 1d38660fcf2e7c6368e00fcfaa7eb6b0b9b113316bd1f385d119ae6ba6b450b6da7db6256cb439fceac5d2be185bf63db707729572031b41cc9a2a9005da5560
7
+ data.tar.gz: 53fb7453526c6184b10a0309f04f77671bd8427fbb394ae843337d6cede8cde9b1d6de87be453d1d5a48f99fddfe0a1e01bc16cf0f980e136af02d3549127b73
@@ -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
 
@@ -17,7 +17,7 @@ module EffectiveSubscriptionsHelper
17
17
  raise 'form object must be an acts_as_subscribable object' unless subscribable.respond_to?(:subscripter)
18
18
 
19
19
  subscripter = subscribable.subscripter
20
- raise 'subscribable.subscribable_buyer must match current_user' unless subscripter.user == current_user
20
+ # raise 'subscribable.subscribable_buyer must match current_user' unless subscripter.user == current_user
21
21
 
22
22
  render('effective/subscripter/form', subscripter: subscripter)
23
23
  end
@@ -31,7 +31,7 @@ module Effective
31
31
  end
32
32
 
33
33
  def customer
34
- @customer ||= Effective::Customer.deep.where(user: user).first_or_initialize
34
+ @customer ||= Effective::Customer.deep.where(user: subscribable&.subscribable_buyer || user).first_or_initialize
35
35
  end
36
36
 
37
37
  def current_user=(user)
@@ -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
-
@@ -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.8'.freeze
2
+ VERSION = '4.6.0'.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.8
4
+ version: 4.6.0
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-21 00:00:00.000000000 Z
11
+ date: 2021-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails