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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 224c1f6d4d6ebf123c34ae82034dfcd52ac85ea1
4
- data.tar.gz: da7d957817070d8a43613a6fd9b4c0507fc45db5
3
+ metadata.gz: 60c4efbf377cb7687d3959030f12cef5a81255a3
4
+ data.tar.gz: e5600fe11bf2ef5ebddc10070e4f02cd68cd0385
5
5
  SHA512:
6
- metadata.gz: 57cfa495a08656957179d6d9fb610e8a36ea0c372159a8263dc13d96851b7ba5764aaed85944f82d40c15f06e63ab7d0e70be8781ebc2bc486c7289f9b2c04a1
7
- data.tar.gz: 604ccaa1da13c7c9d54285272f4a8f5d907426192f86cbb472f7345742c0ad622b0538c09a5457c50ef3e26cb0023e0156f8dfd3d80d6211ddc905591a9e37a6
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
@@ -1,3 +1,3 @@
1
1
  module AlfaInsurance
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
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
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-03-29 00:00:00.000000000 Z
11
+ date: 2018-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon