sepafm 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +14 -30
- data/.ruby-version +1 -1
- data/.travis.yml +15 -0
- data/Gemfile +1 -1
- data/LICENSE +16 -4
- data/README.md +180 -319
- data/Rakefile +7 -2
- data/lib/sepa/application_request.rb +100 -131
- data/lib/sepa/application_response.rb +28 -84
- data/lib/sepa/attribute_checks.rb +169 -0
- data/lib/sepa/banks/danske/danske_response.rb +19 -0
- data/lib/sepa/banks/danske/soap_danske.rb +132 -0
- data/lib/sepa/banks/nordea/nordea_response.rb +20 -0
- data/lib/sepa/banks/nordea/soap_nordea.rb +51 -0
- data/lib/sepa/client.rb +72 -60
- data/lib/sepa/error_messages.rb +15 -0
- data/lib/sepa/response.rb +88 -85
- data/lib/sepa/soap_builder.rb +51 -341
- data/lib/sepa/utilities.rb +132 -0
- data/lib/sepa/version.rb +1 -1
- data/lib/sepa/xml_schemas/PKIFactory.xsd +334 -0
- data/lib/sepa/xml_schemas/xml_id.xsd +9 -0
- data/lib/sepa/xml_templates/application_request/create_certificate.xml +15 -10
- data/lib/sepa/xml_templates/application_request/danske_get_bank_certificate.xml +13 -9
- data/lib/sepa/xml_templates/application_request/download_file.xml +32 -30
- data/lib/sepa/xml_templates/application_request/download_file_list.xml +29 -27
- data/lib/sepa/xml_templates/application_request/encrypted_request.xml +22 -0
- data/lib/sepa/xml_templates/application_request/get_certificate.xml +9 -8
- data/lib/sepa/xml_templates/application_request/get_user_info.xml +26 -24
- data/lib/sepa/xml_templates/application_request/upload_file.xml +29 -27
- data/lib/sepa/xml_templates/soap/create_certificate.xml +17 -15
- data/lib/sepa/xml_templates/soap/danske_get_bank_certificate.xml +15 -13
- data/lib/sepa/xml_templates/soap/download_file.xml +19 -15
- data/lib/sepa/xml_templates/soap/download_file_list.xml +19 -15
- data/lib/sepa/xml_templates/soap/get_certificate.xml +2 -1
- data/lib/sepa/xml_templates/soap/get_user_info.xml +19 -15
- data/lib/sepa/xml_templates/soap/header.xml +48 -37
- data/lib/sepa/xml_templates/soap/upload_file.xml +19 -15
- data/lib/sepafm.rb +20 -18
- data/{sepa.gemspec → sepafm.gemspec} +10 -9
- data/test/sepa/banks/danske/danske_cert_response_test.rb +52 -0
- data/test/sepa/banks/danske/danske_cert_soap_builder_test.rb +100 -0
- data/test/sepa/banks/danske/danske_generic_soap_builder_test.rb +278 -0
- data/test/sepa/banks/danske/danske_get_bank_cert_test.rb +111 -0
- data/{lib/sepa/danske_testing/keys/danske_encryption.crt → test/sepa/banks/danske/keys/bank_encryption_cert.pem} +0 -0
- data/test/sepa/{danske_test_keys/danskeroot.pem → banks/danske/keys/bank_root_cert.pem} +1 -1
- data/test/sepa/banks/danske/keys/bank_signing_cert.pem +24 -0
- data/test/sepa/banks/danske/keys/danske_encryption.crt +24 -0
- data/test/sepa/banks/danske/keys/enc_private_key.pem +27 -0
- data/test/sepa/{danske_test_keys → banks/danske/keys}/encryption_pkcs.csr +0 -0
- data/test/sepa/banks/danske/keys/own_enc_cert.pem +21 -0
- data/test/sepa/banks/danske/keys/own_signing_cert.pem +22 -0
- data/test/sepa/{danske_test_keys → banks/danske/keys}/signing_key.pem +0 -0
- data/test/sepa/{danske_test_keys → banks/danske/keys}/signing_pkcs.csr +0 -0
- data/test/sepa/banks/danske/keys/signing_private_key.pem +27 -0
- data/test/sepa/banks/danske/responses/create_cert.xml +38 -0
- data/test/sepa/banks/danske/responses/get_bank_cert.xml +37 -0
- data/{lib/sepa/nordea_testing → test/sepa/banks/nordea}/keys/nordea.crt +0 -4
- data/test/sepa/{nordea_test_keys → banks/nordea/keys}/nordea.key +0 -3
- data/test/sepa/{nordea_test_keys → banks/nordea/keys}/root_cert.cer +0 -0
- data/test/sepa/{nordea_test_keys → banks/nordea/keys}/testcert.csr +0 -0
- data/test/sepa/banks/nordea/nordea_application_request_test.rb +252 -0
- data/test/sepa/{application_response_test.rb → banks/nordea/nordea_application_response_test.rb} +40 -46
- data/test/sepa/banks/nordea/nordea_cert_application_request_test.rb +72 -0
- data/test/sepa/banks/nordea/nordea_cert_request_soap_builder_test.rb +65 -0
- data/test/sepa/banks/nordea/nordea_generic_soap_builder_test.rb +280 -0
- data/test/sepa/banks/nordea/nordea_response_test.rb +116 -0
- data/test/sepa/banks/nordea/responses/df_ktl.xml +45 -0
- data/test/sepa/{test_files/test_responses/df.xml → banks/nordea/responses/df_tito.xml} +1 -1
- data/test/sepa/{test_files/test_responses → banks/nordea/responses}/dfl.xml +0 -0
- data/test/sepa/banks/nordea/responses/gbc.xml +15 -0
- data/test/sepa/banks/nordea/responses/gc.xml +49 -0
- data/test/sepa/{test_files/test_responses → banks/nordea/responses}/gui.xml +0 -0
- data/test/sepa/{test_files/test_responses → banks/nordea/responses}/uf.xml +0 -0
- data/test/sepa/client_test.rb +156 -302
- data/test/sepa/fixtures.rb +214 -0
- data/test/sepa/sepa_test.rb +3 -13
- data/test/sepa/test_files/{invalid.wsdl → invalid_wsdl.wsdl} +0 -0
- data/test/test_helper.rb +29 -3
- metadata +140 -116
- data/lib/danske_get_bank_certificate_test.rb +0 -15
- data/lib/sepa/custom_exceptions.rb +0 -2
- data/lib/sepa/filedescriptor.rb +0 -7
- data/lib/sepa/filetypeservice.rb +0 -6
- data/lib/sepa/nordea_testing/keys/CSR.csr +0 -0
- data/lib/sepa/nordea_testing/keys/nordea.key +0 -19
- data/lib/sepa/nordea_testing/response/content_053.xml +0 -998
- data/lib/sepa/nordea_testing/response/content_054.xml +0 -1
- data/lib/sepa/nordea_testing/response/download_file_response.xml +0 -14
- data/lib/sepa/nordea_testing/response/download_filelist_response.xml +0 -14
- data/lib/sepa/nordea_testing/response/get_user_info_response.xml +0 -14
- data/lib/sepa/nordea_testing/response/upload_file_response.xml +0 -14
- data/lib/sepa/payload.rb +0 -109
- data/lib/sepa/payment.rb +0 -97
- data/lib/sepa/sender_verifier.rb +0 -15
- data/lib/sepa/signature.rb +0 -7
- data/lib/sepa/soap_danske.rb +0 -47
- data/lib/sepa/soap_nordea.rb +0 -68
- data/lib/sepa/transaction.rb +0 -178
- data/lib/sepa/userfiletype.rb +0 -16
- data/lib/sepa/xml_parser.rb +0 -291
- data/lib/sepa_client_testing_mika.rb +0 -32
- data/lib/sepa_client_testing_tiere.rb +0 -257
- data/test/sepa/application_request_test.rb +0 -423
- data/test/sepa/cert_application_request_test.rb +0 -99
- data/test/sepa/nordea_cert_request_soap_builder_test.rb +0 -112
- data/test/sepa/nordea_generic_soap_builder_test.rb +0 -427
- data/test/sepa/nordea_test_keys/nordea.crt +0 -27
- data/test/sepa/payload_test.rb +0 -297
- data/test/sepa/payment_test.rb +0 -198
- data/test/sepa/response_test.rb +0 -269
- data/test/sepa/transaction_test.rb +0 -362
- data/test/sepa/user_file_type_test.rb +0 -21
- data/test/sepa/xml_parser_test.rb +0 -73
@@ -1,73 +0,0 @@
|
|
1
|
-
require File.expand_path('../../test_helper.rb', __FILE__)
|
2
|
-
|
3
|
-
class XmlParserTest < MiniTest::Test
|
4
|
-
def setup
|
5
|
-
@exampleresponsepath = File.expand_path('../../../lib/sepa/nordea_testing/response',__FILE__)
|
6
|
-
|
7
|
-
@parser = Sepa::XmlParser.new
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_that_053_example_is_unmodified
|
11
|
-
sha1 = OpenSSL::Digest::SHA1.new
|
12
|
-
template = File.read("#{@exampleresponsepath}/content_053.xml")
|
13
|
-
digest = Base64.encode64(sha1.digest(template)).strip
|
14
|
-
assert_equal digest, "kfgZav//JsPs+tLG8XrE2Sn+aT0="
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_that_054_example_is_unmodified
|
18
|
-
sha1 = OpenSSL::Digest::SHA1.new
|
19
|
-
template = File.read("#{@exampleresponsepath}/content_054.xml")
|
20
|
-
digest = Base64.encode64(sha1.digest(template)).strip
|
21
|
-
assert_equal digest, "flXaS2mlkdckXDUX0lWPuafEris="
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_parsing_053_should_fail_when_empty_content_entered
|
25
|
-
assert_raises(ArgumentError) {@parser.get_account_statement_content("")}
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_parsing_054_should_fail_when_empty_content_entered
|
29
|
-
assert_raises(ArgumentError) {@parser.get_debit_credit_notification_content("")}
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_should_parse_content_from_response_when_parsing_download_file_response
|
33
|
-
@parser.animate_response("#{@exampleresponsepath}/download_file_response.xml")
|
34
|
-
assert_equal @parser.content.empty?, false
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_should_parse_userfiletypes_from_response_when_parsing_get_user_info_response
|
38
|
-
@parser.animate_response("#{@exampleresponsepath}/get_user_info_response.xml")
|
39
|
-
assert @parser.list_userfiletypes.kind_of?(Array), "Type not an array"
|
40
|
-
assert @parser.list_userfiletypes.length > 0, "Array should not be empty" #Very unlikely to ever be empty
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_should_return_hash_from_053_request
|
44
|
-
assert @parser.get_account_statement_content("#{@exampleresponsepath}/content_053.xml").kind_of?(Hash), "Does not return a hash"
|
45
|
-
assert @parser.get_account_statement_content("#{@exampleresponsepath}/content_053.xml").length > 0, "Hash should not be empty"
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_should_return_hash_from_054_request
|
49
|
-
assert @parser.get_debit_credit_notification_content("#{@exampleresponsepath}/content_054.xml").kind_of?(Hash), "Does not return a hash"
|
50
|
-
assert @parser.get_debit_credit_notification_content("#{@exampleresponsepath}/content_054.xml").length > 0, "Hash should not be empty"
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_method_listnewdescriptors_should_return_array_of_descriptors_when_parsing_download_file_list
|
54
|
-
@parser.animate_response("#{@exampleresponsepath}/download_filelist_response.xml")
|
55
|
-
assert @parser.list_new_descriptors.kind_of?(Array), "Type not an array" # Array can be empty
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_method_listdescriptors_should_return_array_of_descriptors_when_parsing_download_file_list
|
59
|
-
@parser.animate_response("#{@exampleresponsepath}/download_filelist_response.xml")
|
60
|
-
assert @parser.list_all_descriptors.kind_of?(Array), "Type not an array"
|
61
|
-
assert @parser.list_all_descriptors.length > 0, "Array should not be empty"
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_method_selectdescriptor_should_return_file_information_with_file_reference
|
65
|
-
@parser.animate_response("#{@exampleresponsepath}/download_filelist_response.xml")
|
66
|
-
collection = @parser.list_new_descriptors
|
67
|
-
sampler = collection[0]
|
68
|
-
sample = sampler.sample
|
69
|
-
|
70
|
-
assert @parser.select_descriptor(sample.fileReference).kind_of?(Array), "Does not return an array"
|
71
|
-
assert @parser.select_descriptor(sample.fileReference).length > 0, "Should return an array with length more than 0"
|
72
|
-
end
|
73
|
-
end
|