root_insurance 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/root_insurance/api/application.rb +26 -3
- data/lib/root_insurance/client.rb +1 -1
- data/lib/root_insurance/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62a647203615d6e8ffd22c1654677fb4755b45af
|
4
|
+
data.tar.gz: 7d3f11e7b5d273f9cad9622dd7622820be04661e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef10763848eceb0d098fd20c2152854261f03007a5e733ed57048c503844f08412977bbfa0e964189e6bd272d5f7ecf8fe54ac09d253742c2ae8f8d77ea86b17
|
7
|
+
data.tar.gz: 3d4cc78024c42e96757002ec26c05cad8454f7c2101b068272d7c5d2422946eab2247293f607bf38076497f78c1f4291666461b11e29d92a76ee4e346fea34e2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# 1.7.0 - Release date: 2018-16-05
|
4
|
+
* Added missing support for funeral and term modules when creating application
|
5
|
+
|
6
|
+
|
3
7
|
# 1.6.1 - Release date: 2018-16-05
|
4
8
|
* Fixed variable in payment method spec
|
5
9
|
* Add initial documentation to test rdoc and yard
|
@@ -1,13 +1,36 @@
|
|
1
1
|
module RootInsurance::Api
|
2
2
|
module Application
|
3
|
-
|
3
|
+
|
4
|
+
# Create an application
|
5
|
+
#
|
6
|
+
# @param [String] policyholder_id The policy holder id
|
7
|
+
# @param [String] quote_package_id The quote package id
|
8
|
+
# @param [Integer] monthly_premium The monthly premium (in cents)
|
9
|
+
# @param [String] serial_number The device to insure's serial number. (for the gadgets module)
|
10
|
+
# @param [String] spouse_id SA ID number of the policyholder's spouse. Required if has_spouse is true on the quote.
|
11
|
+
# @param [Array<String>] children_ids SA ID numbers of the policyholder's children. Required if number_of_children is greater than 0 on the quote. All children must be younger than 21.
|
12
|
+
# @param [Array<String>] SA ID number of the policyholder's extended family members. Required if the length of +extended_family_ages+ is greater than 0 on the quote. The ages inferred from the ID numbers must match the ages given in the quote step.
|
13
|
+
# @return [Hash]
|
14
|
+
def create_application(policyholder_id:, quote_package_id:, monthly_premium:,
|
15
|
+
serial_number: nil, spouse_id: nil, children_ids: nil, extended_famliy_ids: nil)
|
4
16
|
data = {
|
5
17
|
policyholder_id: policyholder_id,
|
6
18
|
quote_package_id: quote_package_id,
|
7
|
-
monthly_premium: monthly_premium
|
8
|
-
serial_number: serial_number
|
19
|
+
monthly_premium: monthly_premium
|
9
20
|
}
|
10
21
|
|
22
|
+
module_data = if serial_number
|
23
|
+
{serial_number: serial_number}
|
24
|
+
elsif spouse_id || children_ids || extended_famliy_ids
|
25
|
+
{
|
26
|
+
spouse_id: spouse_id,
|
27
|
+
children_ids: children_ids,
|
28
|
+
extended_famliy_ids: extended_famliy_ids
|
29
|
+
}.reject { |key, value| value.nil? }
|
30
|
+
end
|
31
|
+
|
32
|
+
data = module_data ? data.merge(module_data) : data
|
33
|
+
|
11
34
|
post(:applications, data)
|
12
35
|
end
|
13
36
|
end
|
@@ -21,7 +21,7 @@ class RootInsurance::Client
|
|
21
21
|
#
|
22
22
|
# @param [String] app_id The app's id
|
23
23
|
# @param [String] app_secret The app's secret. Currently it's a blank string
|
24
|
-
# @param [Symbol] env The environment to use. Either
|
24
|
+
# @param [Symbol] env The environment to use. Either +:production+ or +:sandbox+. The default is +:sandbox+
|
25
25
|
def initialize(app_id, app_secret, env=nil)
|
26
26
|
@app_id = app_id
|
27
27
|
@app_secret = app_secret
|