sepafm 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -6
  3. data/Rakefile +1 -1
  4. data/lib/sepa/application_request.rb +12 -18
  5. data/lib/sepa/application_response.rb +0 -2
  6. data/lib/sepa/attribute_checks.rb +33 -28
  7. data/lib/sepa/banks/danske/danske_response.rb +9 -25
  8. data/lib/sepa/banks/danske/soap_danske.rb +1 -1
  9. data/lib/sepa/banks/nordea/nordea_response.rb +2 -16
  10. data/lib/sepa/banks/op/op_response.rb +5 -23
  11. data/lib/sepa/banks/samlink/samlink_response.rb +35 -0
  12. data/lib/sepa/banks/samlink/soap_samlink.rb +14 -0
  13. data/lib/sepa/certificates/samlink_certificate.pem +29 -0
  14. data/lib/sepa/certificates/samlink_root_certificate.pem +32 -0
  15. data/lib/sepa/client.rb +35 -8
  16. data/lib/sepa/error_messages.rb +16 -18
  17. data/lib/sepa/response.rb +7 -11
  18. data/lib/sepa/soap_builder.rb +7 -17
  19. data/lib/sepa/utilities.rb +4 -5
  20. data/lib/sepa/version.rb +1 -1
  21. data/lib/sepa/wsdl/wsdl_samlink_cert_production.xml +82 -0
  22. data/lib/sepa/wsdl/wsdl_samlink_cert_test.xml +82 -0
  23. data/lib/sepa/wsdl/wsdl_samlink_production.xml +160 -0
  24. data/lib/sepa/wsdl/wsdl_samlink_test.xml +160 -0
  25. data/lib/sepa/xml_schemas/samlink/CertApplicationRequest.xsd +105 -0
  26. data/lib/sepa/xml_schemas/samlink/CertApplicationResponse.xsd +88 -0
  27. data/lib/sepa/xml_templates/application_request/download_file.xml +0 -1
  28. data/lib/sepa/xml_templates/application_request/download_file_list.xml +0 -1
  29. data/lib/sepa/xml_templates/application_request/samlink/get_certificate.xml +12 -0
  30. data/lib/sepa/xml_templates/application_request/samlink/renew_certificate.xml +29 -0
  31. data/lib/sepa/xml_templates/soap/samlink/get_certificate.xml +14 -0
  32. data/lib/sepa/xml_templates/soap/samlink/renew_certificate.xml +14 -0
  33. data/lib/sepafm.rb +43 -31
  34. data/readme.md +1 -0
  35. data/sepafm.gemspec +2 -2
  36. data/test/custom_assertions.rb +30 -28
  37. data/test/sepa/banks/danske/danske_cert_response_test.rb +13 -10
  38. data/test/sepa/banks/danske/danske_generic_soap_builder_test.rb +9 -31
  39. data/test/sepa/banks/danske/danske_get_bank_cert_test.rb +4 -5
  40. data/test/sepa/banks/danske/danske_response_test.rb +2 -3
  41. data/test/sepa/banks/danske/responses/create_cert_corrupted.xml +15 -0
  42. data/test/sepa/banks/nordea/nordea_application_request_test.rb +4 -6
  43. data/test/sepa/banks/nordea/nordea_application_response_test.rb +14 -15
  44. data/test/sepa/banks/nordea/nordea_cert_request_soap_builder_test.rb +1 -3
  45. data/test/sepa/banks/nordea/nordea_generic_soap_builder_test.rb +6 -16
  46. data/test/sepa/banks/nordea/nordea_response_test.rb +11 -11
  47. data/test/sepa/banks/op/op_cert_application_request_test.rb +1 -1
  48. data/test/sepa/banks/op/op_cert_request_soap_builder_test.rb +0 -1
  49. data/test/sepa/banks/op/op_response_test.rb +2 -2
  50. data/test/sepa/banks/samlink/responses/dfl.xml +21 -0
  51. data/test/sepa/banks/samlink/responses/gc_error_30.xml +21 -0
  52. data/test/sepa/banks/samlink/responses/rc.xml +21 -0
  53. data/test/sepa/banks/samlink/samlink_application_request_test.rb +36 -0
  54. data/test/sepa/banks/samlink/samlink_cert_application_request_test.rb +13 -0
  55. data/test/sepa/banks/samlink/samlink_cert_request_soap_builder_test.rb +13 -0
  56. data/test/sepa/banks/samlink/samlink_generic_soap_builder_test.rb +34 -0
  57. data/test/sepa/banks/samlink/samlink_renew_cert_application_request_test.rb +36 -0
  58. data/test/sepa/banks/samlink/samlink_renew_cert_request_soap_builder_test.rb +26 -0
  59. data/test/sepa/banks/samlink/samlink_response_test.rb +71 -0
  60. data/test/sepa/client_test.rb +32 -6
  61. data/test/sepa/fixtures.rb +169 -7
  62. data/test/sepa/sepa_test.rb +1 -1
  63. data/test/test_helper.rb +8 -7
  64. data/test_client/data/certs_example.rb +9 -9
  65. data/test_client/data/params_example.rb +18 -19
  66. data/test_client/test_client.rb +6 -0
  67. metadata +41 -5
@@ -0,0 +1,160 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions targetNamespace="http://bxd.fi/CorporateFileService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://model.bxd.fi" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://bxd.fi/CorporateFileService" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3
+ <wsdl:types>
4
+ <xsd:schema targetNamespace="http://model.bxd.fi" elementFormDefault="qualified" attributeFormDefault="qualified">
5
+ <xsd:complexType name="RequestHeader">
6
+ <xsd:sequence>
7
+ <xsd:element name="SenderId" type="xsd:string" nillable="false"/>
8
+ <xsd:element name="RequestId" type="xsd:string" nillable="false"/>
9
+ <xsd:element name="Timestamp" type="xsd:dateTime" nillable="false"/>
10
+ <xsd:element name="Language" type="xsd:string" nillable="true"/>
11
+ <xsd:element name="UserAgent" type="xsd:string" nillable="true"/>
12
+ <xsd:element name="ReceiverId" type="xsd:string" nillable="false"/>
13
+ </xsd:sequence>
14
+ </xsd:complexType>
15
+ <xsd:complexType name="ResponseHeader">
16
+ <xsd:sequence>
17
+ <xsd:element name="SenderId" type="xsd:string" nillable="false"/>
18
+ <xsd:element name="RequestId" type="xsd:string" nillable="false"/>
19
+ <xsd:element name="Timestamp" type="xsd:dateTime" nillable="false"/>
20
+ <xsd:element name="ResponseCode" type="xsd:string" nillable="true"/>
21
+ <xsd:element name="ResponseText" type="xsd:string" nillable="true"/>
22
+ <xsd:element name="ReceiverId" type="xsd:string" nillable="false"/>
23
+ </xsd:sequence>
24
+ </xsd:complexType>
25
+ <xsd:complexType name="UploadFileRequest">
26
+ <xsd:sequence>
27
+ <xsd:element name="RequestHeader" type="ns1:RequestHeader" nillable="false"/>
28
+ <xsd:element name="ApplicationRequest" type="xsd:base64Binary" nillable="false"/>
29
+ </xsd:sequence>
30
+ </xsd:complexType>
31
+ <xsd:complexType name="UploadFileResponse">
32
+ <xsd:sequence>
33
+ <xsd:element name="ResponseHeader" type="ns1:ResponseHeader" nillable="false"/>
34
+ <xsd:element name="ApplicationResponse" type="xsd:base64Binary" nillable="false"/>
35
+ </xsd:sequence>
36
+ </xsd:complexType>
37
+ <xsd:complexType name="DownloadFileListRequest">
38
+ <xsd:sequence>
39
+ <xsd:element name="RequestHeader" type="ns1:RequestHeader" nillable="false"/>
40
+ <xsd:element name="ApplicationRequest" type="xsd:base64Binary" nillable="false"/>
41
+ </xsd:sequence>
42
+ </xsd:complexType>
43
+ <xsd:complexType name="DownloadFileListResponse">
44
+ <xsd:sequence>
45
+ <xsd:element name="ResponseHeader" type="ns1:ResponseHeader" nillable="false"/>
46
+ <xsd:element name="ApplicationResponse" type="xsd:base64Binary" nillable="false"/>
47
+ </xsd:sequence>
48
+ </xsd:complexType>
49
+ <xsd:complexType name="DownloadFileRequest">
50
+ <xsd:sequence>
51
+ <xsd:element name="RequestHeader" type="ns1:RequestHeader" nillable="false"/>
52
+ <xsd:element name="ApplicationRequest" type="xsd:base64Binary" nillable="false"/>
53
+ </xsd:sequence>
54
+ </xsd:complexType>
55
+ <xsd:complexType name="DownloadFileResponse">
56
+ <xsd:sequence>
57
+ <xsd:element name="ResponseHeader" type="ns1:ResponseHeader" nillable="false"/>
58
+ <xsd:element name="ApplicationResponse" type="xsd:base64Binary" nillable="false"/>
59
+ </xsd:sequence>
60
+ </xsd:complexType>
61
+ <xsd:complexType name="FileServiceFaultDetail">
62
+ <xsd:sequence>
63
+ <xsd:element minOccurs="0" maxOccurs="1" name="category" type="xsd:string"/>
64
+ <xsd:element minOccurs="0" maxOccurs="1" name="code" type="xsd:string"/>
65
+ </xsd:sequence>
66
+ </xsd:complexType>
67
+ </xsd:schema>
68
+ <xsd:schema targetNamespace="http://bxd.fi/CorporateFileService" elementFormDefault="qualified" attributeFormDefault="qualified">
69
+ <xsd:element name="uploadFilein" type="ns1:UploadFileRequest"/>
70
+ <xsd:element name="uploadFileout" type="ns1:UploadFileResponse"/>
71
+ <xsd:element name="downloadFileListin" type="ns1:DownloadFileListRequest"/>
72
+ <xsd:element name="downloadFileListout" type="ns1:DownloadFileListResponse"/>
73
+ <xsd:element name="downloadFilein" type="ns1:DownloadFileRequest"/>
74
+ <xsd:element name="downloadFileout" type="ns1:DownloadFileResponse"/>
75
+ <xsd:element name="FileServiceFaultElement" type="ns1:FileServiceFaultDetail"/>
76
+ </xsd:schema>
77
+ </wsdl:types>
78
+ <wsdl:message name="FileServiceFault">
79
+ <wsdl:part name="FileServiceFault" element="tns:FileServiceFaultElement"/>
80
+ </wsdl:message>
81
+ <wsdl:message name="uploadFileResponse">
82
+ <wsdl:part element="tns:uploadFileout" name="uploadFileout"/>
83
+ </wsdl:message>
84
+ <wsdl:message name="uploadFileRequest">
85
+ <wsdl:part element="tns:uploadFilein" name="uploadFilein"/>
86
+ </wsdl:message>
87
+ <wsdl:message name="downloadFileListResponse">
88
+ <wsdl:part element="tns:downloadFileListout" name="downloadFileListout"/>
89
+ </wsdl:message>
90
+ <wsdl:message name="downloadFileListRequest">
91
+ <wsdl:part element="tns:downloadFileListin" name="downloadFileListin"/>
92
+ </wsdl:message>
93
+ <wsdl:message name="downloadFileResponse">
94
+ <wsdl:part element="tns:downloadFileout" name="downloadFileout"/>
95
+ </wsdl:message>
96
+ <wsdl:message name="downloadFileRequest">
97
+ <wsdl:part element="tns:downloadFilein" name="downloadFilein"/>
98
+ </wsdl:message>
99
+ <wsdl:portType name="CorporateFileServicePortType">
100
+ <wsdl:operation name="uploadFile">
101
+ <wsdl:input message="tns:uploadFileRequest" name="uploadFileRequest"/>
102
+ <wsdl:output message="tns:uploadFileResponse" name="uploadFileResponse"/>
103
+ <wsdl:fault name="FileServiceFault" message="tns:FileServiceFault"/>
104
+ </wsdl:operation>
105
+ <wsdl:operation name="downloadFileList">
106
+ <wsdl:input message="tns:downloadFileListRequest" name="downloadFileListRequest"/>
107
+ <wsdl:output message="tns:downloadFileListResponse" name="downloadFileListResponse"/>
108
+ <wsdl:fault name="FileServiceFault" message="tns:FileServiceFault"/>
109
+ </wsdl:operation>
110
+ <wsdl:operation name="downloadFile">
111
+ <wsdl:input message="tns:downloadFileRequest" name="downloadFileRequest"/>
112
+ <wsdl:output message="tns:downloadFileResponse" name="downloadFileResponse"/>
113
+ <wsdl:fault name="FileServiceFault" message="tns:FileServiceFault"/>
114
+ </wsdl:operation>
115
+ </wsdl:portType>
116
+ <wsdl:binding name="CorporateFileServiceHttpBinding" type="tns:CorporateFileServicePortType">
117
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
118
+ <wsdl:operation name="uploadFile">
119
+ <wsdlsoap:operation soapAction=""/>
120
+ <wsdl:input name="uploadFileRequest">
121
+ <wsdlsoap:body use="literal"/>
122
+ </wsdl:input>
123
+ <wsdl:output name="uploadFileResponse">
124
+ <wsdlsoap:body use="literal"/>
125
+ </wsdl:output>
126
+ <wsdl:fault name="FileServiceFault">
127
+ <wsdlsoap:fault use="literal" name="FileServiceFault"/>
128
+ </wsdl:fault>
129
+ </wsdl:operation>
130
+ <wsdl:operation name="downloadFileList">
131
+ <wsdlsoap:operation soapAction=""/>
132
+ <wsdl:input name="downloadFileListRequest">
133
+ <wsdlsoap:body use="literal"/>
134
+ </wsdl:input>
135
+ <wsdl:output name="downloadFileListResponse">
136
+ <wsdlsoap:body use="literal"/>
137
+ </wsdl:output>
138
+ <wsdl:fault name="FileServiceFault">
139
+ <wsdlsoap:fault use="literal" name="FileServiceFault"/>
140
+ </wsdl:fault>
141
+ </wsdl:operation>
142
+ <wsdl:operation name="downloadFile">
143
+ <wsdlsoap:operation soapAction=""/>
144
+ <wsdl:input name="downloadFileRequest">
145
+ <wsdlsoap:body use="literal"/>
146
+ </wsdl:input>
147
+ <wsdl:output name="downloadFileResponse">
148
+ <wsdlsoap:body use="literal"/>
149
+ </wsdl:output>
150
+ <wsdl:fault name="FileServiceFault">
151
+ <wsdlsoap:fault use="literal" name="FileServiceFault"/>
152
+ </wsdl:fault>
153
+ </wsdl:operation>
154
+ </wsdl:binding>
155
+ <wsdl:service name="CorporateFileService">
156
+ <wsdl:port binding="tns:CorporateFileServiceHttpBinding" name="CorporateFileServiceHttpPort">
157
+ <wsdlsoap:address location="https://194.240.69.243/services/CorporateFileService"/>
158
+ </wsdl:port>
159
+ </wsdl:service>
160
+ </wsdl:definitions>
@@ -0,0 +1,105 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Trung Nguyen (FD Finanssidata OY) -->
3
+ <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Sasu Mattila (FD Finanssidata Oy) -->
4
+ <xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:bxd="http://op.fi/mlp/xmldata/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://op.fi/mlp/xmldata/" elementFormDefault="qualified" attributeFormDefault="unqualified">
5
+ <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
6
+ <xs:element name="CertApplicationRequest">
7
+ <xs:annotation>
8
+ <xs:documentation>Wrapper for data. Used for transmitting data. Can be XML Digital Signed.</xs:documentation>
9
+ </xs:annotation>
10
+ <xs:complexType>
11
+ <xs:sequence>
12
+ <xs:element name="CustomerId" nillable="false">
13
+ <xs:simpleType>
14
+ <xs:restriction base="xs:string">
15
+ <xs:minLength value="1"/>
16
+ <xs:maxLength value="16"/>
17
+ </xs:restriction>
18
+ </xs:simpleType>
19
+ </xs:element>
20
+ <xs:element name="Timestamp" type="xs:dateTime"/>
21
+ <xs:element name="Environment" type="bxd:EnvironmentCode"/>
22
+ <xs:element name="SoftwareId">
23
+ <xs:simpleType>
24
+ <xs:restriction base="xs:string">
25
+ <xs:minLength value="1"/>
26
+ <xs:maxLength value="80"/>
27
+ </xs:restriction>
28
+ </xs:simpleType>
29
+ </xs:element>
30
+ <xs:element name="Command" nillable="false" minOccurs="0">
31
+ <xs:simpleType>
32
+ <xs:restriction base="xs:string">
33
+ <xs:maxLength value="32"/>
34
+ <xs:minLength value="1"/>
35
+ </xs:restriction>
36
+ </xs:simpleType>
37
+ </xs:element>
38
+ <xs:element name="ExecutionSerial" minOccurs="0">
39
+ <xs:simpleType>
40
+ <xs:restriction base="xs:string">
41
+ <xs:minLength value="1"/>
42
+ <xs:maxLength value="32"/>
43
+ </xs:restriction>
44
+ </xs:simpleType>
45
+ </xs:element>
46
+ <xs:element name="Encryption" type="xs:boolean" minOccurs="0"/>
47
+ <xs:element name="EncryptionMethod" minOccurs="0">
48
+ <xs:simpleType>
49
+ <xs:restriction base="xs:string">
50
+ <xs:minLength value="1"/>
51
+ <xs:maxLength value="35"/>
52
+ </xs:restriction>
53
+ </xs:simpleType>
54
+ </xs:element>
55
+ <xs:element name="Compression" type="xs:boolean" minOccurs="0"/>
56
+ <xs:element name="CompressionMethod" minOccurs="0">
57
+ <xs:simpleType>
58
+ <xs:restriction base="xs:string">
59
+ <xs:minLength value="1"/>
60
+ <xs:maxLength value="35"/>
61
+ </xs:restriction>
62
+ </xs:simpleType>
63
+ </xs:element>
64
+ <xs:element name="Service" type="xs:string" default="MATU">
65
+ <xs:annotation>
66
+ <xs:documentation>Maksuliikkeen tunniste; mikä palvelun varmenne pyydetään. käytännössä ISSUER</xs:documentation>
67
+ </xs:annotation>
68
+ </xs:element>
69
+ <xs:element name="Content" type="xs:base64Binary" nillable="true" minOccurs="0">
70
+ <xs:annotation>
71
+ <xs:documentation>pkcs#10 request</xs:documentation>
72
+ </xs:annotation>
73
+ </xs:element>
74
+ <xs:element name="TransferKey" nillable="false" minOccurs="0">
75
+ <xs:annotation>
76
+ <xs:documentation>(Siirtoavain) / jaettu salaisuus / salasana</xs:documentation>
77
+ </xs:annotation>
78
+ <xs:simpleType>
79
+ <xs:restriction base="xs:string">
80
+ <xs:maxLength value="32"/>
81
+ <xs:minLength value="1"/>
82
+ </xs:restriction>
83
+ </xs:simpleType>
84
+ </xs:element>
85
+ <xs:element name="SerialNumber" nillable="false" minOccurs="0">
86
+ <xs:simpleType>
87
+ <xs:restriction base="xs:string">
88
+ <xs:minLength value="1"/>
89
+ <xs:maxLength value="25"/>
90
+ </xs:restriction>
91
+ </xs:simpleType>
92
+ </xs:element>
93
+ <xs:element ref="ds:Signature" minOccurs="0"/>
94
+ </xs:sequence>
95
+ </xs:complexType>
96
+ </xs:element>
97
+ <xs:simpleType name="EnvironmentCode">
98
+ <xs:annotation>
99
+ <xs:documentation>Production or Test</xs:documentation>
100
+ </xs:annotation>
101
+ <xs:restriction base="xs:NMTOKEN">
102
+ <xs:pattern value="(PRODUCTION|TEST)"/>
103
+ </xs:restriction>
104
+ </xs:simpleType>
105
+ </xs:schema>
@@ -0,0 +1,88 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Trung Nguyen (FD Finanssidata OY) -->
3
+ <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Sasu Mattila (FD Finanssidata Oy) -->
4
+ <xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:bxd="http://op.fi/mlp/xmldata/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://op.fi/mlp/xmldata/" elementFormDefault="qualified" attributeFormDefault="unqualified">
5
+ <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
6
+ <xs:element name="CertApplicationResponse">
7
+ <xs:annotation>
8
+ <xs:documentation>Wrapper for data. Used for transmitting data. Can be XML Digital Signed.</xs:documentation>
9
+ </xs:annotation>
10
+ <xs:complexType>
11
+ <xs:sequence>
12
+ <xs:element name="CustomerId" nillable="false">
13
+ <xs:simpleType>
14
+ <xs:restriction base="xs:string">
15
+ <xs:minLength value="1"/>
16
+ <xs:maxLength value="16"/>
17
+ </xs:restriction>
18
+ </xs:simpleType>
19
+ </xs:element>
20
+ <xs:element name="Timestamp" type="xs:dateTime"/>
21
+ <xs:element name="ResponseCode" nillable="false">
22
+ <xs:simpleType>
23
+ <xs:restriction base="xs:string">
24
+ <xs:minLength value="1"/>
25
+ <xs:maxLength value="16"/>
26
+ </xs:restriction>
27
+ </xs:simpleType>
28
+ </xs:element>
29
+ <xs:element name="ResponseText" nillable="false">
30
+ <xs:simpleType>
31
+ <xs:restriction base="xs:string">
32
+ <xs:minLength value="1"/>
33
+ <xs:maxLength value="80"/>
34
+ </xs:restriction>
35
+ </xs:simpleType>
36
+ </xs:element>
37
+ <xs:element name="ExecutionSerial" minOccurs="0">
38
+ <xs:simpleType>
39
+ <xs:restriction base="xs:string">
40
+ <xs:minLength value="1"/>
41
+ <xs:maxLength value="32"/>
42
+ </xs:restriction>
43
+ </xs:simpleType>
44
+ </xs:element>
45
+ <xs:element name="Encrypted" type="xs:boolean" minOccurs="0"/>
46
+ <xs:element name="EncryptionMethod" minOccurs="0">
47
+ <xs:simpleType>
48
+ <xs:restriction base="xs:string">
49
+ <xs:minLength value="1"/>
50
+ <xs:maxLength value="35"/>
51
+ </xs:restriction>
52
+ </xs:simpleType>
53
+ </xs:element>
54
+ <xs:element name="Compressed" type="xs:boolean" minOccurs="0"/>
55
+ <xs:element name="CompressionMethod" minOccurs="0">
56
+ <xs:simpleType>
57
+ <xs:restriction base="xs:string">
58
+ <xs:minLength value="1"/>
59
+ <xs:maxLength value="35"/>
60
+ </xs:restriction>
61
+ </xs:simpleType>
62
+ </xs:element>
63
+ <xs:element name="CustomerExtension" type="xs:anyType" minOccurs="0"/>
64
+ <xs:element name="Certificates" minOccurs="0">
65
+ <xs:complexType>
66
+ <xs:sequence>
67
+ <xs:element ref="bxd:Certificate" minOccurs="0" maxOccurs="unbounded"/>
68
+ </xs:sequence>
69
+ </xs:complexType>
70
+ </xs:element>
71
+ <xs:element ref="ds:Signature" minOccurs="0"/>
72
+ </xs:sequence>
73
+ </xs:complexType>
74
+ </xs:element>
75
+ <xs:element name="Certificate">
76
+ <xs:complexType>
77
+ <xs:sequence>
78
+ <xs:element name="Name" type="xs:string" nillable="false">
79
+ <xs:annotation>
80
+ <xs:documentation>Kertoo varmenteen käyttötarkoituksen. Voi olla CommonName tai muu nimi</xs:documentation>
81
+ </xs:annotation>
82
+ </xs:element>
83
+ <xs:element name="Certificate" type="xs:base64Binary" nillable="false"/>
84
+ <xs:element name="CertificateFormat" type="xs:string" default="X509v3"/>
85
+ </xs:sequence>
86
+ </xs:complexType>
87
+ </xs:element>
88
+ </xs:schema>
@@ -3,7 +3,6 @@
3
3
  <CustomerId/>
4
4
  <Command/>
5
5
  <Timestamp/>
6
- <Status/>
7
6
  <Environment/>
8
7
  <FileReferences>
9
8
  <FileReference/>
@@ -3,7 +3,6 @@
3
3
  <CustomerId/>
4
4
  <Command/>
5
5
  <Timestamp/>
6
- <Status/>
7
6
  <Environment/>
8
7
  <SoftwareId/>
9
8
  <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <CertApplicationRequest xmlns="http://op.fi/mlp/xmldata/">
3
+ <CustomerId/>
4
+ <Timestamp/>
5
+ <Environment/>
6
+ <SoftwareId/>
7
+ <Command/>
8
+ <Compression>false</Compression>
9
+ <Service/>
10
+ <Content/>
11
+ <TransferKey/>
12
+ </CertApplicationRequest>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <CertApplicationRequest xmlns="http://op.fi/mlp/xmldata/">
3
+ <CustomerId/>
4
+ <Timestamp/>
5
+ <Environment/>
6
+ <SoftwareId/>
7
+ <Compression>false</Compression>
8
+ <Service/>
9
+ <Content/>
10
+ <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
11
+ <dsig:SignedInfo>
12
+ <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" />
13
+ <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
14
+ <dsig:Reference URI="">
15
+ <dsig:Transforms>
16
+ <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
17
+ </dsig:Transforms>
18
+ <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
19
+ <dsig:DigestValue/>
20
+ </dsig:Reference>
21
+ </dsig:SignedInfo>
22
+ <dsig:SignatureValue/>
23
+ <dsig:KeyInfo>
24
+ <dsig:X509Data>
25
+ <dsig:X509Certificate/>
26
+ </dsig:X509Data>
27
+ </dsig:KeyInfo>
28
+ </dsig:Signature>
29
+ </CertApplicationRequest>
@@ -0,0 +1,14 @@
1
+ <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
2
+ xmlns:opc="http://mlp.op.fi/OPCertificateService">
3
+ <env:Header/>
4
+ <env:Body>
5
+ <opc:getCertificatein>
6
+ <opc:RequestHeader>
7
+ <opc:SenderId/>
8
+ <opc:RequestId/>
9
+ <opc:Timestamp/>
10
+ </opc:RequestHeader>
11
+ <opc:ApplicationRequest/>
12
+ </opc:getCertificatein>
13
+ </env:Body>
14
+ </env:Envelope>
@@ -0,0 +1,14 @@
1
+ <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
2
+ xmlns:opc="http://mlp.op.fi/OPCertificateService">
3
+ <env:Header/>
4
+ <env:Body>
5
+ <opc:getCertificatein>
6
+ <opc:RequestHeader>
7
+ <opc:SenderId/>
8
+ <opc:RequestId/>
9
+ <opc:Timestamp/>
10
+ </opc:RequestHeader>
11
+ <opc:ApplicationRequest/>
12
+ </opc:getCertificatein>
13
+ </env:Body>
14
+ </env:Envelope>
data/lib/sepafm.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # 3rd party dependencies
1
2
  require 'active_model'
2
3
  require 'base64'
3
4
  require 'nokogiri'
@@ -5,56 +6,60 @@ require 'openssl'
5
6
  require 'savon'
6
7
  require 'securerandom'
7
8
  require 'time'
9
+
10
+ # Used throughout project so it's important that these be required first
8
11
  require 'sepa/utilities'
12
+
13
+ # Common, again important to require in this order
9
14
  require 'sepa/error_messages'
10
- require 'sepa/attribute_checks'
15
+ require 'sepa/response'
16
+
11
17
  require 'sepa/application_request'
12
18
  require 'sepa/application_response'
13
- require 'sepa/client'
14
- require 'sepa/response'
15
- require 'sepa/banks/nordea/nordea_response'
19
+ require 'sepa/attribute_checks'
16
20
  require 'sepa/banks/danske/danske_response'
17
- require 'sepa/banks/op/op_response'
18
- require 'sepa/soap_builder'
19
21
  require 'sepa/banks/danske/soap_danske'
22
+ require 'sepa/banks/nordea/nordea_response'
20
23
  require 'sepa/banks/nordea/soap_nordea'
24
+ require 'sepa/banks/op/op_response'
21
25
  require 'sepa/banks/op/soap_op'
26
+ require 'sepa/banks/samlink/samlink_response'
27
+ require 'sepa/banks/samlink/soap_samlink'
28
+ require 'sepa/client'
29
+ require 'sepa/soap_builder'
22
30
  require 'sepa/version'
23
31
 
24
32
  # The root path of where the gem is installed
25
33
  # @todo Put all constants under Sepa namespace
26
34
  ROOT_PATH = File.expand_path('../../', __FILE__)
27
35
 
28
-
29
36
  # @!group Schemas
30
37
 
31
38
  # The path where the WSDL-files for different banks are located
32
- WSDL_PATH = "#{ROOT_PATH}/lib/sepa/wsdl"
39
+ WSDL_PATH = "#{ROOT_PATH}/lib/sepa/wsdl".freeze
33
40
 
34
41
  # The path where the xml schemas are located
35
- SCHEMA_PATH = "#{ROOT_PATH}/lib/sepa/xml_schemas"
42
+ SCHEMA_PATH = "#{ROOT_PATH}/lib/sepa/xml_schemas".freeze
36
43
 
37
44
  # Path to the WSDL schema
38
- SCHEMA_FILE = "#{ROOT_PATH}/lib/sepa/xml_schemas/wsdl.xml"
45
+ SCHEMA_FILE = "#{ROOT_PATH}/lib/sepa/xml_schemas/wsdl.xml".freeze
39
46
 
40
47
  # @!endgroup
41
48
 
42
-
43
49
  # @!group Templates
44
50
 
45
51
  # Path to the application request templates
46
- AR_TEMPLATE_PATH = "#{ROOT_PATH}/lib/sepa/xml_templates/application_request"
52
+ AR_TEMPLATE_PATH = "#{ROOT_PATH}/lib/sepa/xml_templates/application_request".freeze
47
53
 
48
54
  # Path to the soap templates
49
- SOAP_TEMPLATE_PATH = "#{ROOT_PATH}/lib/sepa/xml_templates/soap"
55
+ SOAP_TEMPLATE_PATH = "#{ROOT_PATH}/lib/sepa/xml_templates/soap".freeze
50
56
 
51
57
  # @!endgroup
52
58
 
53
-
54
59
  # @!group Certificates
55
60
 
56
61
  # Path to where the certificates are located
57
- CERTIFICATE_PATH = "#{ROOT_PATH}/lib/sepa/certificates/"
62
+ CERTIFICATE_PATH = "#{ROOT_PATH}/lib/sepa/certificates/".freeze
58
63
 
59
64
  nordea_root_certificate_string = File.read("#{CERTIFICATE_PATH}nordea_root_certificate.pem")
60
65
 
@@ -71,8 +76,14 @@ op_root_certificate_string = File.read("#{CERTIFICATE_PATH}op_root_certificate.p
71
76
  # OP's root certificate as an OpenSSL::X509::Certificate
72
77
  OP_ROOT_CERTIFICATE = OpenSSL::X509::Certificate.new op_root_certificate_string
73
78
 
74
- # @!endgroup
79
+ samlink_root_certificate_string = File.read("#{CERTIFICATE_PATH}samlink_root_certificate.pem")
80
+ samlink_certificate_string = File.read("#{CERTIFICATE_PATH}samlink_certificate.pem")
81
+
82
+ # Samlink's certificates as OpenSSL::X509::Certificate
83
+ SAMLINK_ROOT_CERTIFICATE = OpenSSL::X509::Certificate.new samlink_root_certificate_string
84
+ SAMLINK_CERTIFICATE = OpenSSL::X509::Certificate.new samlink_certificate_string
75
85
 
86
+ # @!endgroup
76
87
 
77
88
  # @!group Commands
78
89
 
@@ -82,7 +93,7 @@ STANDARD_COMMANDS = %i(
82
93
  download_file_list
83
94
  get_user_info
84
95
  upload_file
85
- )
96
+ ).freeze
86
97
 
87
98
  SUPPORTED_COMMANDS =
88
99
  STANDARD_COMMANDS +
@@ -96,46 +107,47 @@ SUPPORTED_COMMANDS =
96
107
 
97
108
  # @!endgroup
98
109
 
99
-
100
110
  # @!group XML Namespaces
101
111
 
102
112
  # Namespace used by XML digital signature
103
- DSIG = 'http://www.w3.org/2000/09/xmldsig#'
113
+ DSIG = 'http://www.w3.org/2000/09/xmldsig#'.freeze
104
114
 
105
115
  # Oasis utility namespace used in soap header for security purposes
106
- OASIS_UTILITY = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'
116
+ OASIS_UTILITY = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'.freeze
107
117
 
108
118
  # Oasis secext namespace used in soap header for security purposes
109
- OASIS_SECEXT = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
119
+ OASIS_SECEXT = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'.freeze
110
120
 
111
121
  # Namespace used in application requests and application responses
112
- XML_DATA = 'http://bxd.fi/xmldata/'
122
+ XML_DATA = 'http://bxd.fi/xmldata/'.freeze
113
123
 
114
124
  # Namespace of the node that contains application request or application response
115
- BXD = 'http://model.bxd.fi'
125
+ BXD = 'http://model.bxd.fi'.freeze
116
126
 
117
127
  # Namespace for XML encryption syntax and processing
118
- XMLENC = 'http://www.w3.org/2001/04/xmlenc#'
128
+ XMLENC = 'http://www.w3.org/2001/04/xmlenc#'.freeze
119
129
 
120
130
  # Soap envelope namespace
121
- ENVELOPE = 'http://schemas.xmlsoap.org/soap/envelope/'
131
+ ENVELOPE = 'http://schemas.xmlsoap.org/soap/envelope/'.freeze
122
132
 
123
133
  # Namespace used in Nordea's certificate requests and responses soap
124
- NORDEA_PKI = 'http://bxd.fi/CertificateService'
134
+ NORDEA_PKI = 'http://bxd.fi/CertificateService'.freeze
125
135
 
126
136
  # Namespace used in Nordea's certificate application requests and responses
127
- NORDEA_XML_DATA = 'http://filetransfer.nordea.com/xmldata/'
137
+ NORDEA_XML_DATA = 'http://filetransfer.nordea.com/xmldata/'.freeze
128
138
 
129
139
  # Namespace used in Danske Bank's certificate services application requests and responses
130
- DANSKE_PKI = 'http://danskebank.dk/PKI/PKIFactoryService/elements'
140
+ DANSKE_PKI = 'http://danskebank.dk/PKI/PKIFactoryService/elements'.freeze
131
141
 
132
142
  # Namespace used in Danske Bank's certificate services soap
133
- DANSKE_PKIF = 'http://danskebank.dk/PKI/PKIFactoryService'
143
+ DANSKE_PKIF = 'http://danskebank.dk/PKI/PKIFactoryService'.freeze
134
144
 
135
145
  # Namespace used in OP's certificate requests and responses soap
136
- OP_PKI = 'http://mlp.op.fi/OPCertificateService'
146
+ OP_PKI = 'http://mlp.op.fi/OPCertificateService'.freeze
137
147
 
138
148
  # Namespace used in OP's certificate application requests and responses
139
- OP_XML_DATA = 'http://op.fi/mlp/xmldata/'
149
+ OP_XML_DATA = 'http://op.fi/mlp/xmldata/'.freeze
150
+
151
+ SAMLINK_PKI = 'http://mlp.op.fi/OPCertificateService'.freeze
140
152
 
141
153
  # @!endgroup
data/readme.md CHANGED
@@ -12,6 +12,7 @@ Currently we have support for SEPA Web Services for
12
12
  * Nordea
13
13
  * Danske Bank
14
14
  * OP
15
+ * Banks supported by [Samlink](http://www.samlink.fi/ohjelmistopalvelut/)
15
16
 
16
17
  ## Installation
17
18
 
data/sepafm.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.license = 'MIT'
12
12
  spec.authors = ['Joni Kanerva', 'Mika Myllynen', 'Tommi Järvinen']
13
13
  spec.email = ['joni@devlab.fi']
14
- spec.files = `git ls-files`.split($/)
14
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
15
15
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
17
  spec.require_paths = ['lib']
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'nokogiri', '~> 1.6'
23
23
  spec.add_dependency 'savon', '~> 2.11'
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 1.12'
25
+ spec.add_development_dependency 'bundler', '~> 1.13'
26
26
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.6'
27
27
  spec.add_development_dependency 'dotenv', '~> 2.1'
28
28
  spec.add_development_dependency 'minitest', '~> 5.9'