effective_orders 6.1.2 → 6.1.3

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: 819088f5b5cc1bd4d6965080f951be723aa5f0a10139ba7a724eae767e47b560
4
- data.tar.gz: a2b5b57a2612d0b810b90e04481ad221c28335b8f0148e71de223180fa36525e
3
+ metadata.gz: d89c7eaee9322884706dfaacae71335ca4b8284b06ab69459194cb09b523eb53
4
+ data.tar.gz: 2c667a68c9e3e68fe764cd3386495698d55c8c86c7d213ce5691e0a35f37821c
5
5
  SHA512:
6
- metadata.gz: 31f30605ef8af6b7802264d741c7db94b434bd83ec8d917dbbe3f8e175fc516149806600b3237df2fc533fe486b419075f46a335dc6fdd0a43a993b9625a2ce2
7
- data.tar.gz: 33652d1539fb9cc7ad2fbf53fa245272ddb6d17e75e3c2830c2292005169656704dbff0845b2cc1a5c14d93fd4492198dd82ec9fa88bf95274465a3ed995a77f
6
+ metadata.gz: cadaa028284a3ee34b1cdfefe2165722cec9edd5307771d8c2e7c5f5fa5afff5ccbd3926d0c6a535369b163dd3987eb4be4afef1572aafd5c6367268cb7e9591
7
+ data.tar.gz: c5cc2bee6db200d5ba490a61f987b5d00df5c7e7bc78c1bf7bfabb11e536ff2899c4fe1c8be3fef886fb62cfff266aa29b8164a0c3e864b8fa4800437e9ce923
@@ -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()
@@ -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.3'.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.3
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: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails