metrifox-sdk 1.2.0 → 1.2.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e104bcb98f1c3415c56b378a83ad48c544be02eaafc669a81933516f1e7c1ced
|
|
4
|
+
data.tar.gz: c29086216b0435f191cf3e73de1efcc6c9b311325bc781fca67e87f1de484277
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf489b3e1cda09bd87161814c261dc04ac0db991f2d93585facc458a430f0594ba3aa4b27508dbaa6ba5914b3ca003c0c87099164971a500c85e7d63cec1a669
|
|
7
|
+
data.tar.gz: 6c24661b2e17a856c33f0a9b8b40a8c76043b2dd75e9570dfd938954fbe3c4b1a1f6412e096f251ce18c0256b6d50142638ddb22df1ae2bafd0ad975138942fd
|
|
@@ -75,6 +75,13 @@ module MetrifoxSDK::Customers
|
|
|
75
75
|
parse_response(response, "Failed to upload CSV")
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
+
def bulk_create_request(base_url, api_key, request_payload)
|
|
79
|
+
uri = URI.join(base_url, "customers/bulk-create")
|
|
80
|
+
body = serialize_customer_request(request_payload)
|
|
81
|
+
response = make_request(uri, "POST", api_key, body)
|
|
82
|
+
parse_response(response, "Failed to Bulk Create Customers")
|
|
83
|
+
end
|
|
84
|
+
|
|
78
85
|
private
|
|
79
86
|
|
|
80
87
|
def serialize_customer_request(request)
|
|
@@ -22,5 +22,18 @@ module MetrifoxSDK::Subscriptions
|
|
|
22
22
|
response = make_request(uri, "GET", api_key)
|
|
23
23
|
parse_response(response, "Failed to Fetch Entitlements Usage")
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def bulk_assign_plan_request(base_url, api_key, request_payload)
|
|
27
|
+
uri = URI.join(base_url, "subscriptions/bulk-assign-plan")
|
|
28
|
+
body = if request_payload.respond_to?(:to_h)
|
|
29
|
+
request_payload.to_h.compact
|
|
30
|
+
elsif request_payload.is_a?(Hash)
|
|
31
|
+
request_payload.compact
|
|
32
|
+
else
|
|
33
|
+
raise ArgumentError, "Invalid request format"
|
|
34
|
+
end
|
|
35
|
+
response = make_request(uri, "POST", api_key, body)
|
|
36
|
+
parse_response(response, "Failed to Bulk Assign Plan")
|
|
37
|
+
end
|
|
25
38
|
end
|
|
26
39
|
end
|
|
@@ -19,6 +19,19 @@ module MetrifoxSDK
|
|
|
19
19
|
api.entitlements_usage_request(base_url, api_key, subscription_id)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def bulk_assign_plan(customer_keys:, plan_key:, billing_interval: nil, currency_code: nil, items: nil, skip_invoice: nil)
|
|
23
|
+
validate_api_key!
|
|
24
|
+
request_payload = {
|
|
25
|
+
customer_keys: customer_keys,
|
|
26
|
+
plan_key: plan_key,
|
|
27
|
+
billing_interval: billing_interval,
|
|
28
|
+
currency_code: currency_code,
|
|
29
|
+
items: items,
|
|
30
|
+
skip_invoice: skip_invoice
|
|
31
|
+
}.compact
|
|
32
|
+
api.bulk_assign_plan_request(base_url, api_key, request_payload)
|
|
33
|
+
end
|
|
34
|
+
|
|
22
35
|
private
|
|
23
36
|
|
|
24
37
|
def api
|
data/lib/metrifox_sdk/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metrifox-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Metrifox
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-03-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|