tribune_recurly_api 1.0.4 → 1.0.5
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/lib/recurly_api/client/accounts.rb +3 -2
- data/lib/recurly_api/client/other_requests.rb +3 -2
- data/lib/recurly_api/client/plans.rb +5 -4
- data/lib/recurly_api/client/subscriptions.rb +3 -2
- data/lib/recurly_api/logging.rb +33 -33
- data/lib/recurly_api/version.rb +2 -1
- data/lib/tribune_recurly_api.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 330e1d6e2d4a12cf9d767a5e3223e80bde8b4f7c31ddee9c6395eb062f36e7b4
|
4
|
+
data.tar.gz: 8e3c9f7293df1eb36de9dcf29f4a24f15c7d6833f5f24a74359f0f42d36c9375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c082798d31feedaeb831c04f51f7c7dcec8035b5549cdee6d0de909ba1171516e65445a27c34ab89d9421f8642adc2669aea284e8adeddd0c08abdb4e3d1cb9
|
7
|
+
data.tar.gz: 032d4515cac6bb3b2c8e98573b9d4e4164472185f3691a67051fb2cc11e9a047a23eafb6a61c52aafeaef5f400ad40bd2dd7ac218e06843ee26446e98bf63e79
|
@@ -10,8 +10,9 @@ module RecurlyApi
|
|
10
10
|
def account_info(ssor_id:, **optional_params)
|
11
11
|
# cache_key should be uniq for each account(here ssor_id is uniq)
|
12
12
|
# final cache key with prefix: tribune_recurly_api.account_info.<abcdef>
|
13
|
-
|
14
|
-
request_api(path_name: "accounts/code-#{ssor_id}",
|
13
|
+
cache_key_name = "account_info.#{ssor_id}"
|
14
|
+
request_api(path_name: "accounts/code-#{ssor_id}",
|
15
|
+
cache_key_name: cache_key_name, **optional_params)
|
15
16
|
end
|
16
17
|
|
17
18
|
# Deactivate account ---
|
@@ -10,8 +10,9 @@ module RecurlyApi
|
|
10
10
|
def coupon_redemptions(ssor_id:, **optional_params)
|
11
11
|
# cache_key should be uniq for each account(here ssor_id is uniq)
|
12
12
|
# final cache key with prefix: tribune_recurly_api.coupon_redemptions.<abcdef>
|
13
|
-
|
14
|
-
request_api(path_name: "accounts/code-#{ssor_id}/coupon_redemptions",
|
13
|
+
cache_key_name = "coupon_redemptions.#{ssor_id}"
|
14
|
+
request_api(path_name: "accounts/code-#{ssor_id}/coupon_redemptions",
|
15
|
+
cache_key_name: cache_key_name, **optional_params)
|
15
16
|
end
|
16
17
|
|
17
18
|
# Other request any.....
|
@@ -28,8 +28,8 @@ module RecurlyApi
|
|
28
28
|
# payload_name = optional_params[:payload_name] # if not present default value is :payload
|
29
29
|
# cache_key_name = 'list_all_plans' # optional by default cache_key is caller method_name in receiver i.e. list_plans here
|
30
30
|
self.cache_expires_in = optional_params[:cache_expires_in] || cache_settings[:plan_expiry] unless bypass_caching?
|
31
|
-
|
32
|
-
|
31
|
+
# cache_key_name = 'all_plans' # for custom cache key pass as extra argument
|
32
|
+
request_api(path_name: 'plans', query_params: recurly_query_params, **optional_params)
|
33
33
|
end
|
34
34
|
|
35
35
|
# Fetch Plan Info--
|
@@ -41,8 +41,9 @@ module RecurlyApi
|
|
41
41
|
self.cache_expires_in = optional_params[:cache_expires_in] || cache_settings[:plan_expiry] unless bypass_caching?
|
42
42
|
# cache_key should be uniq for each plan(here plan_id is uniq)
|
43
43
|
# final cache key with prefix: tribune_recurly_api.plan_info.<abcdef>
|
44
|
-
|
45
|
-
request_api(path_name: "plans/#{plan_id}",
|
44
|
+
cache_key_name = "plan_info.#{plan_id}"
|
45
|
+
request_api(path_name: "plans/#{plan_id}",
|
46
|
+
cache_key_name: cache_key_name, **optional_params)
|
46
47
|
end
|
47
48
|
end
|
48
49
|
end
|
@@ -13,8 +13,9 @@ module RecurlyApi
|
|
13
13
|
self.cache_expires_in = optional_params[:cache_expires_in] || cache_settings[:subscription_expiry] unless bypass_caching?
|
14
14
|
# cache_key should be uniq for each account(here ssor_id is uniq)
|
15
15
|
# final cache key with prefix: tribune_recurly_api.account_subscriptions.<abcdef>
|
16
|
-
|
17
|
-
request_api(path_name: path, query_params: recurly_query_params,
|
16
|
+
cache_key_name = "account_subscriptions.#{ssor_id}"
|
17
|
+
request_api(path_name: path, query_params: recurly_query_params,
|
18
|
+
cache_key_name: cache_key_name, **optional_params)
|
18
19
|
end
|
19
20
|
|
20
21
|
# Checking if user already has subscription OR
|
data/lib/recurly_api/logging.rb
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Logger for Gem
|
4
|
-
module RecurlyApi
|
5
|
-
# fallback to STDOUT for non-rails project
|
6
|
-
module Logging
|
7
|
-
# accessor setter method
|
8
|
-
attr_writer :logger
|
9
|
-
|
10
|
-
# Fallback to STDOUT logger for non-rails applications
|
11
|
-
# Usage examples to logging details in RecurlyApi:Client
|
12
|
-
# a. logger.info("I'm an info log")
|
13
|
-
# b. logger.warn("I'm a warn log")
|
14
|
-
# c. logger.error("I'm an error log: error message")
|
15
|
-
# d. logger.fatal("I'm a fatal log")
|
16
|
-
def logger
|
17
|
-
@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
18
|
-
end
|
19
|
-
|
20
|
-
# Classical set method(instead used attr_writer)
|
21
|
-
# def logger=(logger)
|
22
|
-
# @logger = logger
|
23
|
-
# end
|
24
|
-
|
25
|
-
def logger_heading
|
26
|
-
'tribune_recurly_api'
|
27
|
-
end
|
28
|
-
|
29
|
-
def logger_cache_heading
|
30
|
-
"#{logger_heading} CACHING"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Logger for Gem
|
4
|
+
module RecurlyApi
|
5
|
+
# fallback to STDOUT for non-rails project
|
6
|
+
module Logging
|
7
|
+
# accessor setter method
|
8
|
+
attr_writer :logger
|
9
|
+
|
10
|
+
# Fallback to STDOUT logger for non-rails applications
|
11
|
+
# Usage examples to logging details in RecurlyApi:Client
|
12
|
+
# a. logger.info("I'm an info log")
|
13
|
+
# b. logger.warn("I'm a warn log")
|
14
|
+
# c. logger.error("I'm an error log: error message")
|
15
|
+
# d. logger.fatal("I'm a fatal log")
|
16
|
+
def logger
|
17
|
+
@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Classical set method(instead used attr_writer)
|
21
|
+
# def logger=(logger)
|
22
|
+
# @logger = logger
|
23
|
+
# end
|
24
|
+
|
25
|
+
def logger_heading
|
26
|
+
'tribune_recurly_api'
|
27
|
+
end
|
28
|
+
|
29
|
+
def logger_cache_heading
|
30
|
+
"#{logger_heading} CACHING"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/recurly_api/version.rb
CHANGED
@@ -17,5 +17,6 @@ module RecurlyApi
|
|
17
17
|
# VERSION = '1.0.1' # cache settings from configuration file
|
18
18
|
# VERSION = '1.0.2' # prefixing '<code->' to ssor_id is now part of GEM
|
19
19
|
# VERSION = '1.0.3' # return recurly error response
|
20
|
-
VERSION = '1.0.4' #
|
20
|
+
# VERSION = '1.0.4' # is yanked in rubygems.org
|
21
|
+
VERSION = '1.0.5' # cache key should be uniq
|
21
22
|
end
|
data/lib/tribune_recurly_api.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'recurly_api'
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'recurly_api'
|