alfa_insurance 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alfa_insurance/bus_client.rb +4 -3
- data/lib/alfa_insurance/insurance.rb +2 -1
- data/lib/alfa_insurance/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60c4efbf377cb7687d3959030f12cef5a81255a3
|
4
|
+
data.tar.gz: e5600fe11bf2ef5ebddc10070e4f02cd68cd0385
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44ad68169567748a1935dd33fee74855e092bc6c6b6fd23b45bf334f6080dc005970081e122cffae883dd92164d95ec03b615d7a34859a46a3d6ae3b2ca7ddd9
|
7
|
+
data.tar.gz: 8f1a08bf4b1a0eeb12302ec5f127bb1c268354f5a207d3e0cf29adc1933c31e098befd9c43b9039dbbb476db0ba4f3b6d1361d91fd8f640073eafc4b7ec8f56e
|
@@ -1,24 +1,25 @@
|
|
1
1
|
module AlfaInsurance
|
2
2
|
class BusClient < BaseClient
|
3
|
-
def calculate(total_cost)
|
3
|
+
def calculate(total_cost, ticket_issue_date)
|
4
4
|
response = send_soap_request(:calculate_policy) do |xml|
|
5
5
|
xml.operator { xml.code(operator) }
|
6
6
|
xml.product { xml.code(product_code) }
|
7
7
|
xml.policyParameters {
|
8
8
|
xml.ticketInformation {
|
9
9
|
xml.ticketTotalValue(total_cost.to_f)
|
10
|
+
xml.ticketIssueDate(ticket_issue_date.iso8601)
|
10
11
|
}
|
11
12
|
}
|
12
13
|
end
|
13
14
|
CalculateResponse.new(response)
|
14
15
|
end
|
15
16
|
|
16
|
-
def create(insurance_object)
|
17
|
+
def create(insurance_object, ticket_issue_date)
|
17
18
|
raise ArgumentError, "BusInsuranceRequest is expected" unless insurance_object.is_a?(BusInsuranceRequest)
|
18
19
|
response = send_soap_request(:create_policy) do |xml|
|
19
20
|
xml.operator { xml.code(operator) }
|
20
21
|
xml.product { xml.code(product_code) }
|
21
|
-
xml.policyParameters { insurance_object.generate_xml(xml) }
|
22
|
+
xml.policyParameters { insurance_object.generate_xml(xml, ticket_issue_date) }
|
22
23
|
end
|
23
24
|
CreateResponse.new(response)
|
24
25
|
end
|
@@ -33,7 +33,7 @@ module AlfaInsurance
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
def generate_xml(xml)
|
36
|
+
def generate_xml(xml, ticket_issue_date)
|
37
37
|
xml.insuredFirstName(insured_first_name)
|
38
38
|
xml.insuredLastName(insured_last_name)
|
39
39
|
xml.insuredPatronymic(insured_patronymic)
|
@@ -73,6 +73,7 @@ module AlfaInsurance
|
|
73
73
|
xml.busSegmentsCount(bus_segments.size)
|
74
74
|
xml.ticketInformation {
|
75
75
|
xml.ticketTotalValue(total_value.to_f)
|
76
|
+
xml.ticketIssueDate(ticket_issue_date.iso8601)
|
76
77
|
}
|
77
78
|
xml.customerPhoneType 'MOBILE'
|
78
79
|
xml.customerPhone customer_phone
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alfa_insurance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Sviridov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|