effective_orders 4.0.0beta18 → 4.0.0beta19

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
  SHA1:
3
- metadata.gz: 99fab2e738f96640ce81580905a019e327a17d1f
4
- data.tar.gz: 10df9e0cdbd1a91759f052e9d9ef29b961243c0b
3
+ metadata.gz: a3a90107c72d72ef85dfab8a2b966f46ec314b7b
4
+ data.tar.gz: 6f7bec9931f8ae15798f744009ad1adfc6806dde
5
5
  SHA512:
6
- metadata.gz: 1d9640838c97542189694d7205bdca4f52fecc882b39f2897ef5c5b82a72a8c96ea46985ad45b54006d0949d61c5f0b74e0e53474addaff999b4c808a97d9678
7
- data.tar.gz: 567a60b2ab48fd28c3ced00e1005888c4020ff8dc6231df804bdf3b44e9dff12c64f5d1ab3213e3b7cafd492a39e6aa38164ee6ac779e24d131991cdba53e624
6
+ metadata.gz: 38287717bee0633b5700b70dde6c55683c33e724c76d13a07ed1d02e4382715ec95a59eb9e6f82ae77d0ecd4ca52517dc8cb45955ab8de1c0f2e45868476fae3
7
+ data.tar.gz: b89ff8c3382b05081945c08497deb8c2c0b2bdb2ae3a577b0b22971e0b943ae2f94b016179025bf1e559c4afde316883778ee3188f03976de9e92c4d49966072
@@ -14,15 +14,21 @@ stripeSubscriptionHandler = (key, form) ->
14
14
  form.addClass('stripe-success').submit() # Submits the form. As this is a remote form, submits via JS
15
15
 
16
16
  # Hijack submit and get a stripe token
17
- $(document).on 'click', ".effective-orders-stripe-token-required[type='submit']", (event) ->
18
- $form = $(event.currentTarget).closest('form')
17
+ $(document).on 'click', ".effective-orders-stripe-token-required[type='submit'],[data-choose-stripe-plan-id]", (event) ->
18
+ $obj = $(event.currentTarget)
19
+ $form = $obj.closest('form')
19
20
 
20
21
  # Get stripe data payload
21
22
  stripe = $form.data('stripe')
22
23
  return unless stripe?
23
24
 
25
+ # If we're doing choose button mode
26
+ if $obj.data('choose-stripe-plan-id')
27
+ $form.find("input[name$='[stripe_plan_id]']").val($obj.data('choose-stripe-plan-id'))
28
+ return true unless $obj.hasClass('effective-orders-stripe-token-required')
29
+
24
30
  # Make sure there is a plan selected
25
- selected_plan_id = $form.find("input[name$='[stripe_plan_id]']:checked").val() || ''
31
+ selected_plan_id = $form.find("input[name$='[stripe_plan_id]']:checked").val() || $form.find("input[name$='[stripe_plan_id]']").val() || ''
26
32
  return unless selected_plan_id.length > 0
27
33
 
28
34
  # Match plan
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '4.0.0beta18'.freeze
2
+ VERSION = '4.0.0beta19'.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.0.0beta18
4
+ version: 4.0.0beta19
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: 2018-07-22 00:00:00.000000000 Z
11
+ date: 2018-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails