lime_light_platform 1.0.0.16 → 1.0.0.17
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 +4 -4
- data/Gemfile.lock +88 -88
- data/lib/lime_light_platform.rb +45 -26
- data/lime_light_platform-1.0.0.16.gem +0 -0
- data/lime_light_platform.gemspec +1 -1
- data/spec/skip_next_billing_spec.rb +17 -0
- data/spec/subscription_order_update_spec.rb +27 -0
- data/spec/subscription_update_spec.rb +22 -0
- data/spec/upsell_stop_recurring_spec.rb +20 -0
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b680b1a30f58c4717cd3275dc8b475c056412f86e3b3294c0546901a3d96207a
|
4
|
+
data.tar.gz: 2b61b89361918543dfb17f6d0b7df409e610d9b32fa803bbbeb45e175120ded2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a8953d8e94d6dec3a7897553f9b33103fab9a2bdaf247f6c7d2115a35954e8ed07b466d4e9c2f7120954381aba6a1596d4b9a9682612ba042000e0b5857d306
|
7
|
+
data.tar.gz: c274fe64179362fcf30b102281053dd12b27a0b24d3e7a7fe8c765f330abe5ef8b7bf3b4e6e7e5f46f9232107216822bc548bf20c6e5ea6e0e2ff3df48aaa06a
|
data/Gemfile.lock
CHANGED
@@ -1,88 +1,88 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
actionpack (5.2.0)
|
5
|
-
actionview (= 5.2.0)
|
6
|
-
activesupport (= 5.2.0)
|
7
|
-
rack (~> 2.0)
|
8
|
-
rack-test (>= 0.6.3)
|
9
|
-
rails-dom-testing (~> 2.0)
|
10
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
11
|
-
actionview (5.2.0)
|
12
|
-
activesupport (= 5.2.0)
|
13
|
-
builder (~> 3.1)
|
14
|
-
erubi (~> 1.4)
|
15
|
-
rails-dom-testing (~> 2.0)
|
16
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
17
|
-
activesupport (5.2.0)
|
18
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
-
i18n (>= 0.7, < 2)
|
20
|
-
minitest (~> 5.1)
|
21
|
-
tzinfo (~> 1.1)
|
22
|
-
awesome_print (1.8.0)
|
23
|
-
builder (3.2.3)
|
24
|
-
concurrent-ruby (1.0.5)
|
25
|
-
crass (1.0.4)
|
26
|
-
diff-lcs (1.3)
|
27
|
-
dotenv (2.4.0)
|
28
|
-
dotenv-rails (2.4.0)
|
29
|
-
dotenv (= 2.4.0)
|
30
|
-
railties (>= 3.2, < 6.0)
|
31
|
-
erubi (1.7.1)
|
32
|
-
faker (1.8.7)
|
33
|
-
i18n (>= 0.7)
|
34
|
-
i18n (1.0.1)
|
35
|
-
concurrent-ruby (~> 1.0)
|
36
|
-
loofah (2.2.2)
|
37
|
-
crass (~> 1.0.2)
|
38
|
-
nokogiri (>= 1.5.9)
|
39
|
-
method_source (0.9.0)
|
40
|
-
mini_portile2 (2.3.0)
|
41
|
-
minitest (5.11.3)
|
42
|
-
nokogiri (1.8.2-x64-mingw32)
|
43
|
-
mini_portile2 (~> 2.3.0)
|
44
|
-
rack (2.0.5)
|
45
|
-
rack-test (1.0.0)
|
46
|
-
rack (>= 1.0, < 3)
|
47
|
-
rails-dom-testing (2.0.3)
|
48
|
-
activesupport (>= 4.2.0)
|
49
|
-
nokogiri (>= 1.6)
|
50
|
-
rails-html-sanitizer (1.0.4)
|
51
|
-
loofah (~> 2.2, >= 2.2.2)
|
52
|
-
railties (5.2.0)
|
53
|
-
actionpack (= 5.2.0)
|
54
|
-
activesupport (= 5.2.0)
|
55
|
-
method_source
|
56
|
-
rake (>= 0.8.7)
|
57
|
-
thor (>= 0.18.1, < 2.0)
|
58
|
-
rake (12.3.1)
|
59
|
-
rspec (3.7.0)
|
60
|
-
rspec-core (~> 3.7.0)
|
61
|
-
rspec-expectations (~> 3.7.0)
|
62
|
-
rspec-mocks (~> 3.7.0)
|
63
|
-
rspec-core (3.7.1)
|
64
|
-
rspec-support (~> 3.7.0)
|
65
|
-
rspec-expectations (3.7.0)
|
66
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
-
rspec-support (~> 3.7.0)
|
68
|
-
rspec-mocks (3.7.0)
|
69
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.7.0)
|
71
|
-
rspec-support (3.7.1)
|
72
|
-
thor (0.20.0)
|
73
|
-
thread_safe (0.3.6)
|
74
|
-
tzinfo (1.2.5)
|
75
|
-
thread_safe (~> 0.1)
|
76
|
-
|
77
|
-
PLATFORMS
|
78
|
-
x64-mingw32
|
79
|
-
|
80
|
-
DEPENDENCIES
|
81
|
-
activesupport
|
82
|
-
awesome_print
|
83
|
-
dotenv-rails
|
84
|
-
faker
|
85
|
-
rspec
|
86
|
-
|
87
|
-
BUNDLED WITH
|
88
|
-
1.16.1
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actionpack (5.2.0)
|
5
|
+
actionview (= 5.2.0)
|
6
|
+
activesupport (= 5.2.0)
|
7
|
+
rack (~> 2.0)
|
8
|
+
rack-test (>= 0.6.3)
|
9
|
+
rails-dom-testing (~> 2.0)
|
10
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
11
|
+
actionview (5.2.0)
|
12
|
+
activesupport (= 5.2.0)
|
13
|
+
builder (~> 3.1)
|
14
|
+
erubi (~> 1.4)
|
15
|
+
rails-dom-testing (~> 2.0)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
17
|
+
activesupport (5.2.0)
|
18
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
+
i18n (>= 0.7, < 2)
|
20
|
+
minitest (~> 5.1)
|
21
|
+
tzinfo (~> 1.1)
|
22
|
+
awesome_print (1.8.0)
|
23
|
+
builder (3.2.3)
|
24
|
+
concurrent-ruby (1.0.5)
|
25
|
+
crass (1.0.4)
|
26
|
+
diff-lcs (1.3)
|
27
|
+
dotenv (2.4.0)
|
28
|
+
dotenv-rails (2.4.0)
|
29
|
+
dotenv (= 2.4.0)
|
30
|
+
railties (>= 3.2, < 6.0)
|
31
|
+
erubi (1.7.1)
|
32
|
+
faker (1.8.7)
|
33
|
+
i18n (>= 0.7)
|
34
|
+
i18n (1.0.1)
|
35
|
+
concurrent-ruby (~> 1.0)
|
36
|
+
loofah (2.2.2)
|
37
|
+
crass (~> 1.0.2)
|
38
|
+
nokogiri (>= 1.5.9)
|
39
|
+
method_source (0.9.0)
|
40
|
+
mini_portile2 (2.3.0)
|
41
|
+
minitest (5.11.3)
|
42
|
+
nokogiri (1.8.2-x64-mingw32)
|
43
|
+
mini_portile2 (~> 2.3.0)
|
44
|
+
rack (2.0.5)
|
45
|
+
rack-test (1.0.0)
|
46
|
+
rack (>= 1.0, < 3)
|
47
|
+
rails-dom-testing (2.0.3)
|
48
|
+
activesupport (>= 4.2.0)
|
49
|
+
nokogiri (>= 1.6)
|
50
|
+
rails-html-sanitizer (1.0.4)
|
51
|
+
loofah (~> 2.2, >= 2.2.2)
|
52
|
+
railties (5.2.0)
|
53
|
+
actionpack (= 5.2.0)
|
54
|
+
activesupport (= 5.2.0)
|
55
|
+
method_source
|
56
|
+
rake (>= 0.8.7)
|
57
|
+
thor (>= 0.18.1, < 2.0)
|
58
|
+
rake (12.3.1)
|
59
|
+
rspec (3.7.0)
|
60
|
+
rspec-core (~> 3.7.0)
|
61
|
+
rspec-expectations (~> 3.7.0)
|
62
|
+
rspec-mocks (~> 3.7.0)
|
63
|
+
rspec-core (3.7.1)
|
64
|
+
rspec-support (~> 3.7.0)
|
65
|
+
rspec-expectations (3.7.0)
|
66
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
+
rspec-support (~> 3.7.0)
|
68
|
+
rspec-mocks (3.7.0)
|
69
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
+
rspec-support (~> 3.7.0)
|
71
|
+
rspec-support (3.7.1)
|
72
|
+
thor (0.20.0)
|
73
|
+
thread_safe (0.3.6)
|
74
|
+
tzinfo (1.2.5)
|
75
|
+
thread_safe (~> 0.1)
|
76
|
+
|
77
|
+
PLATFORMS
|
78
|
+
x64-mingw32
|
79
|
+
|
80
|
+
DEPENDENCIES
|
81
|
+
activesupport
|
82
|
+
awesome_print
|
83
|
+
dotenv-rails
|
84
|
+
faker
|
85
|
+
rspec
|
86
|
+
|
87
|
+
BUNDLED WITH
|
88
|
+
1.16.1
|
data/lib/lime_light_platform.rb
CHANGED
@@ -40,17 +40,7 @@ class LimeLightPlatform < AppBase
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def billing_model_view request={}
|
43
|
-
|
44
|
-
|
45
|
-
if key_exists('offer_id', request)
|
46
|
-
call_params[:body]['offer_id'] = request['offer_id']
|
47
|
-
end
|
48
|
-
|
49
|
-
if key_exists('billing_model_id', request)
|
50
|
-
call_params[:body]['billing_model_id'] = request['billing_model_id']
|
51
|
-
end
|
52
|
-
|
53
|
-
common_perform_post call_params
|
43
|
+
common_optional_param_perform_post base_call_params(__method__), ['offer_id', 'billing_model_id'], request
|
54
44
|
end
|
55
45
|
|
56
46
|
def campaign_find_active
|
@@ -134,17 +124,7 @@ class LimeLightPlatform < AppBase
|
|
134
124
|
end
|
135
125
|
|
136
126
|
def offer_view request={}
|
137
|
-
|
138
|
-
|
139
|
-
if key_exists('offer_id', request)
|
140
|
-
call_params[:body]['offer_id'] = request['offer_id']
|
141
|
-
end
|
142
|
-
|
143
|
-
if key_exists('campaign_id', request)
|
144
|
-
call_params[:body]['campaign_id'] = request['campaign_id']
|
145
|
-
end
|
146
|
-
|
147
|
-
common_perform_post call_params
|
127
|
+
common_optional_param_perform_post base_call_params(__method__), ['offer_id', 'campaign_id'], request
|
148
128
|
end
|
149
129
|
|
150
130
|
def order_find request={}
|
@@ -408,9 +388,39 @@ class LimeLightPlatform < AppBase
|
|
408
388
|
common_perform_post call_params
|
409
389
|
end
|
410
390
|
|
411
|
-
def
|
412
|
-
|
413
|
-
|
391
|
+
def skip_next_billing subscription_id
|
392
|
+
common_entity_view_perform_post base_call_params(__method__), 'subscription_id', subscription_id
|
393
|
+
end
|
394
|
+
|
395
|
+
def subscription_order_update request={}
|
396
|
+
call_params = base_call_params __method__
|
397
|
+
call_params[:body]['order_id'] = get_if_exists 'order_id', request
|
398
|
+
optional_params = [
|
399
|
+
'additional_product_id',
|
400
|
+
'quantity',
|
401
|
+
'product_id',
|
402
|
+
'new_recurring_product_id',
|
403
|
+
'children',
|
404
|
+
'new_recurring_price',
|
405
|
+
'new_recurring_date',
|
406
|
+
'billing_model_id'
|
407
|
+
]
|
408
|
+
common_optional_param_perform_post call_params, optional_params, request
|
409
|
+
end
|
410
|
+
|
411
|
+
def subscription_update request={}
|
412
|
+
call_params = base_call_params __method__
|
413
|
+
call_params[:body] = { 'subscription_id' => get_if_exists('subscription_id', request, {}) }
|
414
|
+
common_perform_post call_params
|
415
|
+
end
|
416
|
+
|
417
|
+
def upsell_stop_recurring request={}
|
418
|
+
call_params = base_call_params __method__
|
419
|
+
call_params[:body] = {
|
420
|
+
'order_id' => get_if_exists('order_id', request),
|
421
|
+
'product_id' => get_if_exists('product_id', request)
|
422
|
+
}
|
423
|
+
common_perform_post call_params
|
414
424
|
end
|
415
425
|
|
416
426
|
def validate_credentials
|
@@ -468,7 +478,6 @@ class LimeLightPlatform < AppBase
|
|
468
478
|
response
|
469
479
|
end
|
470
480
|
|
471
|
-
# used for "only if there" updates
|
472
481
|
def common_update_perform_post call_params, request, record_key, update_options=[]
|
473
482
|
response = default_response
|
474
483
|
|
@@ -511,6 +520,16 @@ class LimeLightPlatform < AppBase
|
|
511
520
|
response
|
512
521
|
end
|
513
522
|
|
523
|
+
def common_optional_param_perform_post call_params, optional_params, request
|
524
|
+
optional_params.each do |option|
|
525
|
+
if key_exists(option, request)
|
526
|
+
call_params[:body][option] = request[option]
|
527
|
+
end
|
528
|
+
end
|
529
|
+
|
530
|
+
common_perform_post call_params
|
531
|
+
end
|
532
|
+
|
514
533
|
def default_date_times
|
515
534
|
{ today: Time.now.strftime('%m/%d/%Y'), start_time: '00:00:00', end_time: '23:59:59' }
|
516
535
|
end
|
Binary file
|
data/lime_light_platform.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'lime_light_platform'
|
3
|
-
s.version = '1.0.0.
|
3
|
+
s.version = '1.0.0.17'
|
4
4
|
s.date = '2018-05-07'
|
5
5
|
s.summary = "Official Lime Light eCommerce Platform API Ruby Gem (In Development)"
|
6
6
|
s.description = "Official Lime Light eCommerce Platform API Ruby Gem (In Development)"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe LimeLightPlatform, "#skip_next_billing" do
|
4
|
+
context "Lime Light Platform - Membership API - skip_next_billing" do
|
5
|
+
it "Skips the next billing of a recurring subscription" do
|
6
|
+
lime_light = LimeLightPlatform.new(
|
7
|
+
ENV['APP_KEY'],
|
8
|
+
ENV['API_USERNAME'],
|
9
|
+
ENV['API_PASSWORD'],
|
10
|
+
ENV['DEV_SUB'],
|
11
|
+
true
|
12
|
+
)
|
13
|
+
response = lime_light.skip_next_billing ENV['TEST_SKIP_NEXT_BILLING_SUBSCRIPTION_ID']
|
14
|
+
expect(response[:success]).to eq true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe LimeLightPlatform, "#subscription_order_update" do
|
4
|
+
context "Lime Light Platform - Membership API - subscription_order_update" do
|
5
|
+
it "Updates the dynamic properties of a subscription/order" do
|
6
|
+
lime_light = LimeLightPlatform.new(
|
7
|
+
ENV['APP_KEY'],
|
8
|
+
ENV['API_USERNAME'],
|
9
|
+
ENV['API_PASSWORD'],
|
10
|
+
ENV['DEV_SUB'],
|
11
|
+
true
|
12
|
+
)
|
13
|
+
response = lime_light.subscription_order_update({
|
14
|
+
'order_id' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_ORDER_ID'],
|
15
|
+
'additional_product_id' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_ADDITIONAL_PRODUCT_ID'],
|
16
|
+
'quantity' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_QUANTITY'],
|
17
|
+
'product_id' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_PRODUCT_ID'],
|
18
|
+
'new_recurring_product_id' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_NEW_RECURRING_PRODUCT_ID'],
|
19
|
+
# 'children' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_CHILDREN'],
|
20
|
+
'new_recurring_price' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_NEW_RECURRING_PRICE'],
|
21
|
+
# 'new_recurring_date' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_NEW_RECURRING_DATE'],
|
22
|
+
'billing_model_id' => ENV['TEST_SUBSCRIPTION_ORDER_UPDATE_BILLING_MODEL_ID']
|
23
|
+
})
|
24
|
+
expect(response[:success]).to eq true
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe LimeLightPlatform, "#subscription_update" do
|
4
|
+
context "Lime Light Platform - Membership API - subscription_update" do
|
5
|
+
it "Starts, Stops, or resets one or more subscriptions" do
|
6
|
+
lime_light = LimeLightPlatform.new(
|
7
|
+
ENV['APP_KEY'],
|
8
|
+
ENV['API_USERNAME'],
|
9
|
+
ENV['API_PASSWORD'],
|
10
|
+
ENV['DEV_SUB'],
|
11
|
+
true
|
12
|
+
)
|
13
|
+
response = lime_light.subscription_update({
|
14
|
+
'subscription_id' => {
|
15
|
+
ENV['TEST_SUBSCRIPTION_UPDATE_SUBSCRIPTION_ID_1'] => ENV['TEST_SUBSCRIPTION_UPDATE_ACTION_1'],
|
16
|
+
ENV['TEST_SUBSCRIPTION_UPDATE_SUBSCRIPTION_ID_2'] => ENV['TEST_SUBSCRIPTION_UPDATE_ACTION_2']
|
17
|
+
}
|
18
|
+
})
|
19
|
+
expect(response[:success]).to eq true
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe LimeLightPlatform, "#upsell_stop_recurring" do
|
4
|
+
context "Lime Light Platform - Membership API - upsell_stop_recurring" do
|
5
|
+
it "Stops the recurring status of a order upsell product" do
|
6
|
+
lime_light = LimeLightPlatform.new(
|
7
|
+
ENV['APP_KEY'],
|
8
|
+
ENV['API_USERNAME'],
|
9
|
+
ENV['API_PASSWORD'],
|
10
|
+
ENV['DEV_SUB'],
|
11
|
+
true
|
12
|
+
)
|
13
|
+
response = lime_light.upsell_stop_recurring({
|
14
|
+
'order_id' => ENV['TEST_UPSELL_STOP_RECURRING_ORDER_ID'],
|
15
|
+
'product_id' => ENV['TEST_UPSELL_STOP_RECURRING_PRODUCT_ID']
|
16
|
+
})
|
17
|
+
expect(response[:success]).to eq true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lime_light_platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marvin Titus-Casseus
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- lime_light_platform-1.0.0.13.gem
|
27
27
|
- lime_light_platform-1.0.0.14.gem
|
28
28
|
- lime_light_platform-1.0.0.15.gem
|
29
|
+
- lime_light_platform-1.0.0.16.gem
|
29
30
|
- lime_light_platform.gemspec
|
30
31
|
- spec/billing_model_view_spec.rb
|
31
32
|
- spec/campaign_find_active_spec.rb
|
@@ -51,7 +52,11 @@ files:
|
|
51
52
|
- spec/prospect_find_spec.rb
|
52
53
|
- spec/prospect_update_spec.rb
|
53
54
|
- spec/prospect_view_spec.rb
|
55
|
+
- spec/skip_next_billing_spec.rb
|
54
56
|
- spec/spec_helper.rb
|
57
|
+
- spec/subscription_order_update_spec.rb
|
58
|
+
- spec/subscription_update_spec.rb
|
59
|
+
- spec/upsell_stop_recurring_spec.rb
|
55
60
|
- spec/validate_credentials_spec.rb
|
56
61
|
homepage: https://rubygems.org/gems/lime_light_platform
|
57
62
|
licenses:
|