effective_orders 6.1.2 → 6.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_orders/providers/stripe.js.coffee +13 -1
- data/app/models/effective/order.rb +6 -0
- data/app/views/effective/orders/stripe/_element.html.haml +1 -1
- data/app/views/effective/orders/stripe/_form.html.haml +2 -2
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c1bf14140fc511842bc5dfbfd7f5ef1ad41ef96f027a44ecd6386822cee4978
|
4
|
+
data.tar.gz: 390d84968bf785bf8690b027812f9c8233cbf6393880b88114310f32a48718f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f95f8037a92ece1208a9637676d2eec45e5a4ba15d593a1b22d6a9befc1323a30e96c96d70eed847a207583abfc6488cee444f74085ef3911aea4cbf8260b37a
|
7
|
+
data.tar.gz: 78f2caf56e27d306b7a242e6e3a84172a5fcaa01105a6d6516c4da1c8589cd74e7a0513ad4f45f3204461dba8dea39af92691332b2d021eb26821995722dd0d7
|
@@ -17,8 +17,19 @@ this.StripeForm ||= class StripeForm
|
|
17
17
|
@card = @stripe.elements().create('card', @style())
|
18
18
|
|
19
19
|
@mount()
|
20
|
+
@form.find('.stripe-submit-button').show()
|
20
21
|
@form.addClass('initialized')
|
21
22
|
|
23
|
+
destroy: ->
|
24
|
+
@form = $('form[data-stripe-form]').first()
|
25
|
+
return false unless @form.length > 0
|
26
|
+
|
27
|
+
@form.find("input[name$='[payment_intent_id]']").val('')
|
28
|
+
@form.find('#stripe-card-element').html('')
|
29
|
+
|
30
|
+
@form.find('.stripe-submit-button').hide()
|
31
|
+
@form.removeClass('initialized')
|
32
|
+
|
22
33
|
style: ->
|
23
34
|
style: {
|
24
35
|
base: { color: '#32325d', fontSize: '16px', },
|
@@ -73,7 +84,8 @@ this.StripeForm ||= class StripeForm
|
|
73
84
|
|
74
85
|
errorPayment: (error) ->
|
75
86
|
$('#stripe-card-errors').text(error.message)
|
76
|
-
EffectiveForm.invalidate(@form)
|
87
|
+
EffectiveForm.invalidate(@form)
|
77
88
|
|
78
89
|
$ -> (new StripeForm()).initialize()
|
79
90
|
$(document).on 'turbolinks:load', -> (new StripeForm()).initialize()
|
91
|
+
$(document).on 'turbolinks:before-cache', -> (new StripeForm()).destroy()
|
@@ -17,6 +17,7 @@ module Effective
|
|
17
17
|
end
|
18
18
|
|
19
19
|
acts_as_addressable(billing: { singular: true }, shipping: { singular: true })
|
20
|
+
acts_as_reportable if respond_to?(:acts_as_reportable)
|
20
21
|
|
21
22
|
attr_accessor :terms_and_conditions # Yes, I agree to the terms and conditions
|
22
23
|
attr_accessor :confirmed_checkout # Set on the Checkout Step 1
|
@@ -85,6 +86,11 @@ module Effective
|
|
85
86
|
scope :refunds, -> { purchased.where('total < ?', 0) }
|
86
87
|
scope :pending_refunds, -> { not_purchased.where('total < ?', 0) }
|
87
88
|
|
89
|
+
# effective_reports
|
90
|
+
def reportable_scopes
|
91
|
+
{ purchased: nil, not_purchased: nil, deferred: nil, refunds: nil, pending_refunds: nil }
|
92
|
+
end
|
93
|
+
|
88
94
|
before_validation do
|
89
95
|
self.state ||= EffectiveOrders::PENDING
|
90
96
|
self.state = EffectiveOrders::CONFIRMED if pending? && confirmed_checkout
|
@@ -16,7 +16,7 @@
|
|
16
16
|
= f.hidden_field :declined_url, value: declined_url
|
17
17
|
|
18
18
|
-# This is set by the stripe.js javascript
|
19
|
-
= f.hidden_field :payment_intent_id
|
19
|
+
= f.hidden_field :payment_intent_id, required: true
|
20
20
|
|
21
21
|
- if stripe[:token_required]
|
22
22
|
%p Please enter your credit card information.
|
@@ -27,5 +27,5 @@
|
|
27
27
|
= collapse('Use this card instead...', class: 'update-stripe-payment-method') do
|
28
28
|
= render('effective/orders/stripe/element')
|
29
29
|
|
30
|
-
.mt-4
|
30
|
+
.mt-4.stripe-submit-button{style: 'display: none;'}
|
31
31
|
= f.submit order_checkout_label(:stripe), center: true, border: false
|
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: 6.1.
|
4
|
+
version: 6.1.4
|
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:
|
11
|
+
date: 2023-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|