effective_orders 6.1.2 → 6.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 819088f5b5cc1bd4d6965080f951be723aa5f0a10139ba7a724eae767e47b560
4
- data.tar.gz: a2b5b57a2612d0b810b90e04481ad221c28335b8f0148e71de223180fa36525e
3
+ metadata.gz: 4c1bf14140fc511842bc5dfbfd7f5ef1ad41ef96f027a44ecd6386822cee4978
4
+ data.tar.gz: 390d84968bf785bf8690b027812f9c8233cbf6393880b88114310f32a48718f4
5
5
  SHA512:
6
- metadata.gz: 31f30605ef8af6b7802264d741c7db94b434bd83ec8d917dbbe3f8e175fc516149806600b3237df2fc533fe486b419075f46a335dc6fdd0a43a993b9625a2ce2
7
- data.tar.gz: 33652d1539fb9cc7ad2fbf53fa245272ddb6d17e75e3c2830c2292005169656704dbff0845b2cc1a5c14d93fd4492198dd82ec9fa88bf95274465a3ed995a77f
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
@@ -4,5 +4,5 @@
4
4
  .col.text-right.mx-2
5
5
  %label Details
6
6
 
7
- #stripe-card-element
7
+ #stripe-card-element Loading...
8
8
  #stripe-card-errors
@@ -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
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.1.2'.freeze
2
+ VERSION = '6.1.4'.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: 6.1.2
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: 2022-12-28 00:00:00.000000000 Z
11
+ date: 2023-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails