effective_events 0.12.5 → 0.13.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: 0db42bb64a1639b358488381a0e7e4ca73814f98c41153cdb929063661b0e947
4
- data.tar.gz: ad79f29da0313754aafc31e90a432eefbda54d631062ab9e593448540c6c4a08
3
+ metadata.gz: 26de7ee7dbc2f5ec71bac062d12c9dffa48adaa6286f82eee122e3c3f5e13a56
4
+ data.tar.gz: 59249f1f8d89f11f4c7c1bbea1f923db8455635167338e0d98a64b33748f6dda
5
5
  SHA512:
6
- metadata.gz: 0ce3f1278268630aab2aec2547f6b9d3ad100b303a42e403b0b1dd93e7be6a21f1f09385f8835147cc768a77d2a8278cf1ca48dab8afbed97df986716a6478e1
7
- data.tar.gz: 15459694c87b8208ba7f6bd7feb53dc66030e5f7c0ccc858e2a90d3dbb7ebe5761ede77ba6900e86ebcc28f1e225b1b3b5f65113860e268eedcd50f2f96a2f76
6
+ metadata.gz: 6f9141865746360f1831a30429017eaabb44ba31e5ed7c05763c1ced28badcdd3b9c3776a5d7eb7965a641666bec7bffe87ddb590796b013c8ee0143bbfd8bbd
7
+ data.tar.gz: 145136b9ac1891673542dc28eadb43498377f03320f261e779e82b0bdbdcc2986c456fcf6f1dccff17dbb434c56e1bee5ab0daeca8abc75e2a98ddf9f2d7850a
@@ -150,6 +150,10 @@ module EffectiveEventsEventRegistration
150
150
  with_outstanding_coupon_fees(submit_fees)
151
151
  end
152
152
 
153
+ def delayed_payment_attributes
154
+ { delayed_payment: event&.delayed_payment, delayed_payment_date: event&.delayed_payment_date }
155
+ end
156
+
153
157
  # All Fees and Orders
154
158
  def submit_fees
155
159
  if defined?(EffectiveMemberships)
@@ -68,6 +68,10 @@ module Effective
68
68
 
69
69
  allow_blank_registrants :boolean
70
70
 
71
+ # Delayed Payments feature
72
+ delayed_payment :boolean
73
+ delayed_payment_date :date
74
+
71
75
  # Access
72
76
  roles_mask :integer
73
77
  authenticate_user :boolean
@@ -131,10 +135,15 @@ module Effective
131
135
  validates :published_at, presence: true, unless: -> { draft? }
132
136
  validates :start_at, presence: true
133
137
  validates :end_at, presence: true
138
+ validates :external_registration_url, url: true
134
139
 
135
140
  validates :registration_start_at, presence: true, unless: -> { external_registration? }
136
141
  validates :registration_end_at, presence: true, unless: -> { external_registration? }
137
142
 
143
+ validates :delayed_payment, inclusion: { in: [false], message: "cannot be used for external registration events" }, if: -> { external_registration? }
144
+ validates :delayed_payment_date, presence: true, if: -> { delayed_payment? }
145
+ validates :delayed_payment_date, absence: true, unless: -> { delayed_payment? }
146
+
138
147
  validate(if: -> { start_at && end_at }) do
139
148
  errors.add(:end_at, 'must be after start date') unless start_at < end_at
140
149
  end
@@ -151,6 +160,14 @@ module Effective
151
160
  errors.add(:early_bird_end_at, 'must be before start date') unless early_bird_end_at < start_at
152
161
  end
153
162
 
163
+ validate(if: -> { delayed_payment? }) do
164
+ errors.add(:delayed_payment, 'no delayed payment processor available') unless EffectiveOrders.try(:delayed?)
165
+ end
166
+
167
+ validate(if: -> { delayed_payment_date && registration_end_at }) do
168
+ errors.add(:delayed_payment_date, 'must be after registration end date') unless registration_end_at < delayed_payment_date
169
+ end
170
+
154
171
  validate(if: -> { file.attached? }) do
155
172
  errors.add(:file, 'must be an image') unless file.image?
156
173
  end
@@ -16,11 +16,6 @@
16
16
  - datatable = Admin::EffectiveEventProductsDatatable.new(event_id: event.id)
17
17
  = render_inline_datatable(datatable)
18
18
 
19
- -# = tab 'Registrations' do
20
- -# %h2 Registrations
21
- -# - datatable = Admin::EffectiveEventRegistrationsDatatable.new(event_id: event.id)
22
- -# .mb-4= render_inline_datatable(datatable)
23
-
24
19
  = tab 'Registrants & Addons' do
25
20
  %h2 Registrants
26
21
  .mb-4
@@ -22,19 +22,36 @@
22
22
  .col-md-6= f.datetime_field :start_at, label: "Event Start"
23
23
  .col-md-6= f.datetime_field :end_at, label: "Event End"
24
24
 
25
- %h2 Registration
26
- %p The online registration and purchase for this event will be available between:
27
- = f.datetime_field :registration_start_at, label: "Registration Start"
28
- = f.datetime_field :registration_end_at, label: "Registration End"
29
- = f.datetime_field :early_bird_end_at, label: "Early Bird End",
30
- hint: 'Event tickets can be purchased for early bird pricing before this date. Afterwards regular pricing applies.'
25
+ %hr
31
26
 
32
- = f.check_box :allow_blank_registrants, label: "Yes, allow blank ticket registrations", hint: "Allow event tickets to be purchased without adding a name. The purchaser may return to add names later."
27
+ .row
28
+ .col-md-6
29
+ %h2 Registration
30
+ %p The online registration and purchase for this event will be available between:
31
+ = f.datetime_field :registration_start_at, label: "Registration Start"
32
+ = f.datetime_field :registration_end_at, label: "Registration End"
33
+ = f.datetime_field :early_bird_end_at, label: "Early Bird End",
34
+ hint: 'Event tickets can be purchased for early bird pricing before this date. Afterwards regular pricing applies.'
35
+
36
+ = f.check_box :allow_blank_registrants, label: "Yes, allow blank ticket registrations", hint: "Allow event tickets to be purchased without adding a name. The purchaser may return to add names later."
37
+
38
+ = f.check_box :external_registration, label: "Yes, the registration for this event is handled by another website"
39
+
40
+ = f.show_if(:external_registration, true) do
41
+ = f.url_field :external_registration_url, hint: "The url for external event registration. Must start with http(s)://"
42
+
43
+ .col-md-6
44
+ - if EffectiveOrders.try(:delayed?)
45
+ %h2 Delayed Payments
46
+ %p The online payment for this event will be charged as follows:
47
+
48
+ = f.check_box :delayed_payment, label: "Yes, this is a delayed payment event", hint: "Allow registrations for this event without paying immediately.<br>A secure token representing their credit card will be saved and charged automatically on the following payment date."
33
49
 
34
- = f.check_box :external_registration, label: "Yes, the registration for this event is handled by another website"
50
+ = f.hide_if(:delayed_payment, true) do
51
+ = f.hidden_field :delayed_payment_date, value: ''
35
52
 
36
- = f.show_if(:external_registration, true) do
37
- = f.url_field :external_registration_url, hint: "The url for external event registration. Must start with http(s)://"
53
+ = f.show_if(:delayed_payment, true) do
54
+ = f.date_field :delayed_payment_date, label: "Delayed Payment Charge Date", hint: "The date that the credit card will be charged. Expects a date in the future, after the registration end date. Changing this date will not affect previously generated event registration delayed payment orders."
38
55
 
39
56
  = f.submit do
40
57
  = f.save 'Save'
@@ -2,9 +2,8 @@
2
2
  = render 'effective/event_registrations/content', resource: resource
3
3
 
4
4
  - if resource.submit_order.deferred?
5
- .card
6
- .card-body
7
- = render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:complete), deferred_url: wizard_path(:submitted), declined_url: wizard_path(:checkout))
5
+ = card do
6
+ = render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:complete), deferred_url: wizard_path(:submitted), declined_url: wizard_path(:checkout))
8
7
  - elsif resource.event.registerable? == false
9
8
  .alert.alert-danger Your selected event is no longer available for registration.
10
9
  - elsif resource.unavailable_event_tickets.present?
@@ -12,7 +11,6 @@
12
11
  - elsif resource.unavailable_event_products.present?
13
12
  .alert.alert-danger Your selected number of event add-ons are no longer available.
14
13
  - else
15
- .card
16
- .card-body
17
- = render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:complete), deferred_url: wizard_path(:submitted), declined_url: wizard_path(:checkout))
14
+ = card do
15
+ = render_checkout_step2(resource.submit_order, purchased_url: wizard_path(:complete), deferred_url: wizard_path(:submitted), declined_url: wizard_path(:checkout))
18
16
 
@@ -27,6 +27,9 @@ class CreateEffectiveEvents < ActiveRecord::Migration[6.0]
27
27
  t.integer :roles_mask
28
28
  t.boolean :authenticate_user, default: false
29
29
 
30
+ t.boolean :delayed_payment, default: false
31
+ t.date :delayed_payment_date
32
+
30
33
  t.timestamps
31
34
  end
32
35
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.12.5'.freeze
2
+ VERSION = '0.13.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.5
4
+ version: 0.13.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: 2024-05-27 00:00:00.000000000 Z
11
+ date: 2024-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails