sepafm 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +35 -0
  3. data/.ruby-version +1 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE +8 -0
  6. data/README.md +236 -0
  7. data/Rakefile +10 -0
  8. data/lib/danske_get_bank_certificate_test.rb +15 -0
  9. data/lib/sepa/application_request.rb +182 -0
  10. data/lib/sepa/application_response.rb +123 -0
  11. data/lib/sepa/client.rb +79 -0
  12. data/lib/sepa/danske_testing/keys/danske_encryption.crt +24 -0
  13. data/lib/sepa/filedescriptor.rb +7 -0
  14. data/lib/sepa/filetypeservice.rb +6 -0
  15. data/lib/sepa/nordea_testing/keys/CSR.csr +0 -0
  16. data/lib/sepa/nordea_testing/keys/nordea.crt +27 -0
  17. data/lib/sepa/nordea_testing/keys/nordea.key +19 -0
  18. data/lib/sepa/nordea_testing/response/content_053.xml +998 -0
  19. data/lib/sepa/nordea_testing/response/content_054.xml +1 -0
  20. data/lib/sepa/nordea_testing/response/download_file_response.xml +14 -0
  21. data/lib/sepa/nordea_testing/response/download_filelist_response.xml +14 -0
  22. data/lib/sepa/nordea_testing/response/get_user_info_response.xml +14 -0
  23. data/lib/sepa/nordea_testing/response/upload_file_response.xml +14 -0
  24. data/lib/sepa/response.rb +177 -0
  25. data/lib/sepa/sender_verifier.rb +15 -0
  26. data/lib/sepa/signature.rb +7 -0
  27. data/lib/sepa/soap_builder.rb +395 -0
  28. data/lib/sepa/soap_danske.rb +47 -0
  29. data/lib/sepa/soap_nordea.rb +68 -0
  30. data/lib/sepa/userfiletype.rb +16 -0
  31. data/lib/sepa/version.rb +3 -0
  32. data/lib/sepa/wsdl/wsdl_danske.xml +234 -0
  33. data/lib/sepa/wsdl/wsdl_danske_cert.xml +280 -0
  34. data/lib/sepa/wsdl/wsdl_nordea.xml +234 -0
  35. data/lib/sepa/wsdl/wsdl_nordea_cert.xml +187 -0
  36. data/lib/sepa/xml_parser.rb +291 -0
  37. data/lib/sepa/xml_schemas/application_request.xsd +135 -0
  38. data/lib/sepa/xml_schemas/application_response.xsd +311 -0
  39. data/lib/sepa/xml_schemas/cert_application_request.xsd +107 -0
  40. data/lib/sepa/xml_schemas/danske_pki.xsd +334 -0
  41. data/lib/sepa/xml_schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd +195 -0
  42. data/lib/sepa/xml_schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd +108 -0
  43. data/lib/sepa/xml_schemas/soap.xsd +126 -0
  44. data/lib/sepa/xml_schemas/wsdl.xml +310 -0
  45. data/lib/sepa/xml_schemas/xml.xsd +287 -0
  46. data/lib/sepa/xml_schemas/xmldsig-core-schema.xsd +318 -0
  47. data/lib/sepa/xml_templates/application_request/create_certificate.xml +10 -0
  48. data/lib/sepa/xml_templates/application_request/danske_get_bank_certificate.xml +10 -0
  49. data/lib/sepa/xml_templates/application_request/download_file.xml +32 -0
  50. data/lib/sepa/xml_templates/application_request/download_file_list.xml +29 -0
  51. data/lib/sepa/xml_templates/application_request/get_certificate.xml +10 -0
  52. data/lib/sepa/xml_templates/application_request/get_user_info.xml +26 -0
  53. data/lib/sepa/xml_templates/application_request/upload_file.xml +29 -0
  54. data/lib/sepa/xml_templates/soap/create_certificate.xml +15 -0
  55. data/lib/sepa/xml_templates/soap/danske_get_bank_certificate.xml +14 -0
  56. data/lib/sepa/xml_templates/soap/download_file.xml +16 -0
  57. data/lib/sepa/xml_templates/soap/download_file_list.xml +16 -0
  58. data/lib/sepa/xml_templates/soap/get_certificate.xml +13 -0
  59. data/lib/sepa/xml_templates/soap/get_user_info.xml +16 -0
  60. data/lib/sepa/xml_templates/soap/header.xml +37 -0
  61. data/lib/sepa/xml_templates/soap/upload_file.xml +16 -0
  62. data/lib/sepa.rb +21 -0
  63. data/lib/sepa_client_testing_mika.rb +32 -0
  64. data/lib/sepa_client_testing_tiere.rb +80 -0
  65. data/sepa.gemspec +29 -0
  66. data/test/sepa/application_request_test.rb +423 -0
  67. data/test/sepa/application_response_test.rb +238 -0
  68. data/test/sepa/cert_application_request_test.rb +99 -0
  69. data/test/sepa/client_test.rb +425 -0
  70. data/test/sepa/danske_test_keys/danskeroot.pem +25 -0
  71. data/test/sepa/danske_test_keys/encryption_pkcs.csr +0 -0
  72. data/test/sepa/danske_test_keys/signing_key.pem +27 -0
  73. data/test/sepa/danske_test_keys/signing_pkcs.csr +0 -0
  74. data/test/sepa/nordea_cert_request_soap_builder_test.rb +112 -0
  75. data/test/sepa/nordea_generic_soap_builder_test.rb +427 -0
  76. data/test/sepa/nordea_test_keys/nordea.crt +27 -0
  77. data/test/sepa/nordea_test_keys/nordea.key +19 -0
  78. data/test/sepa/nordea_test_keys/root_cert.cer +0 -0
  79. data/test/sepa/nordea_test_keys/testcert.csr +0 -0
  80. data/test/sepa/response_test.rb +269 -0
  81. data/test/sepa/sepa_test.rb +20 -0
  82. data/test/sepa/test_files/invalid.wsdl +1 -0
  83. data/test/sepa/test_files/test_responses/df.xml +20 -0
  84. data/test/sepa/test_files/test_responses/dfl.xml +20 -0
  85. data/test/sepa/test_files/test_responses/gui.xml +20 -0
  86. data/test/sepa/test_files/test_responses/uf.xml +20 -0
  87. data/test/sepa/user_file_type_test.rb +21 -0
  88. data/test/sepa/xml_parser_test.rb +73 -0
  89. data/test/test_helper.rb +9 -0
  90. metadata +256 -0
@@ -0,0 +1,29 @@
1
+ <ApplicationRequest xmlns="http://bxd.fi/xmldata/">
2
+ <CustomerId></CustomerId>
3
+ <Command></Command>
4
+ <Timestamp></Timestamp>
5
+ <Status></Status>
6
+ <Environment></Environment>
7
+ <TargetId></TargetId>
8
+ <SoftwareId></SoftwareId>
9
+ <FileType></FileType>
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></dsig:DigestValue>
20
+ </dsig:Reference>
21
+ </dsig:SignedInfo>
22
+ <dsig:SignatureValue></dsig:SignatureValue>
23
+ <dsig:KeyInfo>
24
+ <dsig:X509Data>
25
+ <dsig:X509Certificate></dsig:X509Certificate>
26
+ </dsig:X509Data>
27
+ </dsig:KeyInfo>
28
+ </dsig:Signature>
29
+ </ApplicationRequest>
@@ -0,0 +1,10 @@
1
+ <CertApplicationRequest xmlns="http://filetransfer.nordea.com/xmldata/">
2
+ <CustomerId></CustomerId>
3
+ <Timestamp></Timestamp>
4
+ <Environment></Environment>
5
+ <SoftwareId></SoftwareId>
6
+ <Command></Command>
7
+ <Service></Service>
8
+ <Content></Content>
9
+ <HMAC></HMAC>
10
+ </CertApplicationRequest>
@@ -0,0 +1,26 @@
1
+ <ApplicationRequest xmlns="http://bxd.fi/xmldata/">
2
+ <CustomerId></CustomerId>
3
+ <Command></Command>
4
+ <Timestamp></Timestamp>
5
+ <Environment></Environment>
6
+ <SoftwareId></SoftwareId>
7
+ <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
8
+ <dsig:SignedInfo>
9
+ <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"/>
10
+ <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
11
+ <dsig:Reference URI="">
12
+ <dsig:Transforms>
13
+ <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
14
+ </dsig:Transforms>
15
+ <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
16
+ <dsig:DigestValue></dsig:DigestValue>
17
+ </dsig:Reference>
18
+ </dsig:SignedInfo>
19
+ <dsig:SignatureValue></dsig:SignatureValue>
20
+ <dsig:KeyInfo>
21
+ <dsig:X509Data>
22
+ <dsig:X509Certificate></dsig:X509Certificate>
23
+ </dsig:X509Data>
24
+ </dsig:KeyInfo>
25
+ </dsig:Signature>
26
+ </ApplicationRequest>
@@ -0,0 +1,29 @@
1
+ <ApplicationRequest xmlns="http://bxd.fi/xmldata/">
2
+ <CustomerId></CustomerId>
3
+ <Command></Command>
4
+ <Timestamp></Timestamp>
5
+ <Environment></Environment>
6
+ <TargetId></TargetId>
7
+ <SoftwareId></SoftwareId>
8
+ <FileType></FileType>
9
+ <Content></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></dsig:DigestValue>
20
+ </dsig:Reference>
21
+ </dsig:SignedInfo>
22
+ <dsig:SignatureValue></dsig:SignatureValue>
23
+ <dsig:KeyInfo>
24
+ <dsig:X509Data>
25
+ <dsig:X509Certificate></dsig:X509Certificate>
26
+ </dsig:X509Data>
27
+ </dsig:KeyInfo>
28
+ </dsig:Signature>
29
+ </ApplicationRequest>
@@ -0,0 +1,15 @@
1
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pkif="http://danskebank.dk/PKI/PKIFactoryService">
2
+ <soapenv:Header/>
3
+ <soapenv:Body>
4
+ <pkif:CreateCertificateIn>
5
+ <pkif:RequestHeader>
6
+ <pkif:SenderId></pkif:SenderId>
7
+ <pkif:CustomerId></pkif:CustomerId>
8
+ <pkif:RequestId></pkif:RequestId>
9
+ <pkif:Timestamp></pkif:Timestamp>
10
+ <pkif:InterfaceVersion></pkif:InterfaceVersion>
11
+ <pkif:Environment></pkif:Environment>
12
+ </pkif:RequestHeader>
13
+ </pkif:CreateCertificateIn>
14
+ </soapenv:Body>
15
+ </soapenv:Envelope>
@@ -0,0 +1,14 @@
1
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pkif="http://danskebank.dk/PKI/PKIFactoryService" xmlns:elem="http://danskebank.dk/PKI/PKIFactoryService/elements">
2
+ <soapenv:Header/>
3
+ <soapenv:Body>
4
+ <pkif:GetBankCertificateIn>
5
+ <pkif:RequestHeader>
6
+ <pkif:SenderId></pkif:SenderId>
7
+ <pkif:CustomerId></pkif:CustomerId>
8
+ <pkif:RequestId></pkif:RequestId>
9
+ <pkif:Timestamp></pkif:Timestamp>
10
+ <pkif:InterfaceVersion></pkif:InterfaceVersion>
11
+ </pkif:RequestHeader>
12
+ </pkif:GetBankCertificateIn>
13
+ </soapenv:Body>
14
+ </soapenv:Envelope>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:cor="http://bxd.fi/CorporateFileService" xmlns:bxd="http://model.bxd.fi">
3
+ <env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="sdf6sa7d86f87s6df786sd87f6s8fsda">
4
+ <cor:downloadFilein xmlns:cor="http://bxd.fi/CorporateFileService">
5
+ <bxd:RequestHeader xmlns:bxd="http://model.bxd.fi">
6
+ <bxd:SenderId></bxd:SenderId>
7
+ <bxd:RequestId></bxd:RequestId>
8
+ <bxd:Timestamp></bxd:Timestamp>
9
+ <bxd:Language></bxd:Language>
10
+ <bxd:UserAgent></bxd:UserAgent>
11
+ <bxd:ReceiverId></bxd:ReceiverId>
12
+ </bxd:RequestHeader>
13
+ <bxd:ApplicationRequest xmlns:bxd="http://model.bxd.fi"></bxd:ApplicationRequest>
14
+ </cor:downloadFilein>
15
+ </env:Body>
16
+ </env:Envelope>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:cor="http://bxd.fi/CorporateFileService" xmlns:bxd="http://model.bxd.fi">
3
+ <env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="sdf6sa7d86f87s6df786sd87f6s8fsda">
4
+ <cor:downloadFileListin xmlns:cor="http://bxd.fi/CorporateFileService">
5
+ <bxd:RequestHeader xmlns:bxd="http://model.bxd.fi">
6
+ <bxd:SenderId></bxd:SenderId>
7
+ <bxd:RequestId></bxd:RequestId>
8
+ <bxd:Timestamp></bxd:Timestamp>
9
+ <bxd:Language></bxd:Language>
10
+ <bxd:UserAgent></bxd:UserAgent>
11
+ <bxd:ReceiverId></bxd:ReceiverId>
12
+ </bxd:RequestHeader>
13
+ <bxd:ApplicationRequest xmlns:bxd="http://model.bxd.fi"></bxd:ApplicationRequest>
14
+ </cor:downloadFileListin>
15
+ </env:Body>
16
+ </env:Envelope>
@@ -0,0 +1,13 @@
1
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cer="http://bxd.fi/CertificateService">
2
+ <soapenv:Header/>
3
+ <soapenv:Body>
4
+ <cer:getCertificatein>
5
+ <cer:RequestHeader>
6
+ <cer:SenderId></cer:SenderId>
7
+ <cer:RequestId></cer:RequestId>
8
+ <cer:Timestamp></cer:Timestamp>
9
+ </cer:RequestHeader>
10
+ <cer:ApplicationRequest></cer:ApplicationRequest>
11
+ </cer:getCertificatein>
12
+ </soapenv:Body>
13
+ </soapenv:Envelope>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:cor="http://bxd.fi/CorporateFileService" xmlns:bxd="http://model.bxd.fi">
3
+ <env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="sdf6sa7d86f87s6df786sd87f6s8fsda">
4
+ <cor:getUserInfoin>
5
+ <bxd:RequestHeader>
6
+ <bxd:SenderId></bxd:SenderId>
7
+ <bxd:RequestId></bxd:RequestId>
8
+ <bxd:Timestamp></bxd:Timestamp>
9
+ <bxd:Language></bxd:Language>
10
+ <bxd:UserAgent></bxd:UserAgent>
11
+ <bxd:ReceiverId></bxd:ReceiverId>
12
+ </bxd:RequestHeader>
13
+ <bxd:ApplicationRequest></bxd:ApplicationRequest>
14
+ </cor:getUserInfoin>
15
+ </env:Body>
16
+ </env:Envelope>
@@ -0,0 +1,37 @@
1
+ <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
2
+ <env:Header>
3
+ <wsse:Security xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" env:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
4
+ <wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="sdgdsg76sdg78sdg78d6gs"></wsse:BinarySecurityToken>
5
+ <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
6
+ <dsig:SignedInfo>
7
+ <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
8
+ <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
9
+ <dsig:Reference URI="#dsfg8sdg87dsf678g6dsg6ds7fg">
10
+ <dsig:Transforms>
11
+ <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
12
+ </dsig:Transforms>
13
+ <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
14
+ <dsig:DigestValue></dsig:DigestValue>
15
+ </dsig:Reference>
16
+ <dsig:Reference URI="#sdf6sa7d86f87s6df786sd87f6s8fsda">
17
+ <dsig:Transforms>
18
+ <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
19
+ </dsig:Transforms>
20
+ <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
21
+ <dsig:DigestValue></dsig:DigestValue>
22
+ </dsig:Reference>
23
+ </dsig:SignedInfo>
24
+ <dsig:SignatureValue></dsig:SignatureValue>
25
+ <dsig:KeyInfo>
26
+ <wsse:SecurityTokenReference>
27
+ <wsse:Reference URI="#sdgdsg76sdg78sdg78d6gs"/>
28
+ </wsse:SecurityTokenReference>
29
+ </dsig:KeyInfo>
30
+ </dsig:Signature>
31
+ <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="dsfg8sdg87dsf678g6dsg6ds7fg">
32
+ <wsu:Created></wsu:Created>
33
+ <wsu:Expires></wsu:Expires>
34
+ </wsu:Timestamp>
35
+ </wsse:Security>
36
+ </env:Header>
37
+ </env:Envelope>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:cor="http://bxd.fi/CorporateFileService" xmlns:bxd="http://model.bxd.fi">
3
+ <env:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="sdf6sa7d86f87s6df786sd87f6s8fsda">
4
+ <cor:uploadFilein xmlns:cor="http://bxd.fi/CorporateFileService">
5
+ <bxd:RequestHeader xmlns:bxd="http://model.bxd.fi">
6
+ <bxd:SenderId></bxd:SenderId>
7
+ <bxd:RequestId></bxd:RequestId>
8
+ <bxd:Timestamp></bxd:Timestamp>
9
+ <bxd:Language></bxd:Language>
10
+ <bxd:UserAgent></bxd:UserAgent>
11
+ <bxd:ReceiverId></bxd:ReceiverId>
12
+ </bxd:RequestHeader>
13
+ <bxd:ApplicationRequest xmlns:bxd="http://model.bxd.fi"></bxd:ApplicationRequest>
14
+ </cor:uploadFilein>
15
+ </env:Body>
16
+ </env:Envelope>
data/lib/sepa.rb ADDED
@@ -0,0 +1,21 @@
1
+ require "base64"
2
+ require "nokogiri"
3
+ require "savon"
4
+ require "sepa/xml_parser"
5
+ require "sepa/client"
6
+ require "sepa/version"
7
+ require 'base64'
8
+ require 'nokogiri'
9
+ require 'openssl'
10
+ require 'securerandom'
11
+ require 'sepa/application_request'
12
+ require 'sepa/filedescriptor'
13
+ require 'sepa/filetypeservice'
14
+ require 'sepa/signature'
15
+ require 'sepa/userfiletype'
16
+ require 'time'
17
+ require 'sepa/response'
18
+ require 'sepa/application_response'
19
+ require 'sepa/soap_builder'
20
+ require 'sepa/soap_danske'
21
+ require 'sepa/soap_nordea'
@@ -0,0 +1,32 @@
1
+ # First the sepa gem is loaded by requiring it
2
+ require 'sepa'
3
+
4
+ # The params hash is populated with the data that is needed for gem to function
5
+ params = {
6
+ # Test pin for nordea
7
+ pin: '1234567890',
8
+
9
+ # Selected bank
10
+ bank: :nordea,
11
+
12
+ # Command for CertificateService :get_certificate
13
+ command: :get_certificate,
14
+
15
+ # Unique customer ID
16
+ customer_id: '11111111',
17
+
18
+ # Set the environment to be either PRODUCTION or TEST
19
+ environment: 'TEST',
20
+
21
+ csr_path: 'sepa/nordea_testing/keys/CSR.csr',
22
+
23
+ # Selected service (For testing: service, For real: ISSUER)
24
+ service: 'service'
25
+
26
+ }
27
+
28
+ # You just create the client with the parameters described above.
29
+ sepa_client = Sepa::Client.new(params)
30
+
31
+ sepa_client.send
32
+
@@ -0,0 +1,80 @@
1
+ # First the sepa gem is loaded by requiring it
2
+ require 'sepa'
3
+
4
+ # A test payload with no actual data
5
+ payload = "test_payload"
6
+
7
+ # The params hash is populated with the data that is needed for gem to function.
8
+ params = {
9
+
10
+ bank: :nordea,
11
+
12
+ cert_path: "sepa/nordea_testing/keys/nordea.crt",
13
+
14
+ private_key_path: "sepa/nordea_testing/keys/nordea.key",
15
+
16
+ # Command :download_file_list, :upload_file, :download_file or :get_user_info.
17
+ command: :get_user_info,
18
+
19
+ # Unique customer ID.
20
+ customer_id: '11111111',
21
+
22
+ # Set the environment to be either PRODUCTION or TEST.
23
+ environment: 'PRODUCTION',
24
+
25
+ # For filtering stuff. Must be either NEW, DOWNLOADED or ALL.
26
+ status: 'NEW',
27
+
28
+ # Some specification of the folder which to access in the bank. I have no
29
+ # idea how this works however.
30
+ target_id: '11111111A1',
31
+
32
+ # Language must be either FI, EN or SV.
33
+ language: 'FI',
34
+
35
+ # File types to upload or download:
36
+ # - LMP300 = Laskujen maksupalvelu (lähtevä)
37
+ # - LUM2 = Valuuttamaksut (lähtevä)
38
+ # - KTL = Saapuvat viitemaksut (saapuva)
39
+ # - TITO = Konekielinen tiliote (saapuva)
40
+ # - NDCORPAYS = Yrityksen maksut XML (lähtevä)
41
+ # - NDCAMT53L = Konekielinen XML-tiliote (saapuva)
42
+ # - NDCAMT54L = Saapuvat XML viitemaksu (saapuva)
43
+ file_type: 'TITO',
44
+
45
+ # The WSDL file used by nordea. Is identical between banks except for the
46
+ # address.
47
+ wsdl: 'sepa/wsdl/wsdl_nordea.xml',
48
+
49
+ # The actual payload to send.
50
+ content: payload,
51
+
52
+ # File reference for :download_file command.
53
+ file_reference: "11111111A12006030329501800000014"
54
+ }
55
+
56
+ # You just create the client with the parameters described above.
57
+ sepa_client = Sepa::Client.new(params)
58
+
59
+ response = sepa_client.send
60
+ response = Nokogiri::XML(response.to_xml)
61
+ response = Sepa::Response.new(response)
62
+
63
+ ar = Sepa::ApplicationResponse.new(response.application_response)
64
+
65
+ puts "\n\nHashes match in the response: #{response.hashes_match?}"
66
+ puts "Signature is valid in the response: #{response.signature_is_valid?}"
67
+
68
+ puts "\nHashes match in the application response: #{ar.hashes_match?}"
69
+ puts "Signature is valid in the application response: #{ar.signature_is_valid?}"
70
+
71
+ puts "\nSome info about response's certificate:\n" \
72
+
73
+ "Issuer: #{response.certificate.issuer}\n" \
74
+ "First day to use this certificate: #{response.certificate.not_before}\n" \
75
+ "Expires: #{response.certificate.not_after}"
76
+
77
+ puts "\nSome info about application response's certificate:\n" \
78
+ "Issuer: #{ar.certificate.issuer}\n" \
79
+ "First day to use this certificate: #{ar.certificate.not_before}\n" \
80
+ "Expires: #{ar.certificate.not_after}"
data/sepa.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'sepa/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'sepafm'
7
+ spec.version = Sepa::VERSION
8
+ spec.summary = 'SEPA Financial Messages'
9
+ spec.description = 'SEPA Financial Messages using Web Services'
10
+ spec.homepage = 'https://github.com/devlab-oy/sepa'
11
+ spec.license = 'MIT'
12
+ spec.authors = ['Joni Kanerva', 'Mika Myllynen', 'Tommi Järvinen']
13
+ spec.email = ['joni@devlab.fi']
14
+ spec.files = `git ls-files`.split($/)
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ['lib']
18
+
19
+ spec.required_ruby_version = '~> 2.0.0'
20
+
21
+ spec.add_dependency 'savon', '~> 2.2.0'
22
+ spec.add_dependency 'nokogiri', '~> 1.6.0'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.3.5'
25
+ spec.add_development_dependency 'rake', '~> 10.1.0'
26
+ spec.add_development_dependency 'simplecov', '~> 0.7.1'
27
+ spec.add_development_dependency 'minitest', '~> 5.0.3'
28
+ spec.add_development_dependency 'json', '~> 1.8.0'
29
+ end