payment_dta 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +45 -0
  3. data/VERSION +1 -0
  4. data/generators/payment/USAGE +5 -0
  5. data/generators/payment/payment_generator.rb +76 -0
  6. data/generators/payment/templates/model.rb.erb +39 -0
  7. data/generators/payment/templates/spec.rb.erb +48 -0
  8. data/lib/payment_dta.rb +4 -0
  9. data/lib/payment_dta/character_conversion.rb +251 -0
  10. data/lib/payment_dta/dta_file.rb +55 -0
  11. data/lib/payment_dta/payment_sorting.rb +19 -0
  12. data/lib/payment_dta/payments/bank_cheque_payment.rb +60 -0
  13. data/lib/payment_dta/payments/base.rb +288 -0
  14. data/lib/payment_dta/payments/domestic_chf_payment.rb +67 -0
  15. data/lib/payment_dta/payments/esr_payment.rb +48 -0
  16. data/lib/payment_dta/payments/financial_institution_payment.rb +56 -0
  17. data/lib/payment_dta/payments/iban_payment.rb +76 -0
  18. data/lib/payment_dta/payments/special_financial_institution_payment.rb +64 -0
  19. data/lib/payment_dta/payments/total_record.rb +31 -0
  20. data/script/destroy +14 -0
  21. data/script/generate +14 -0
  22. data/spec/factory.rb +82 -0
  23. data/spec/lib/bank_cheque_payment_spec.rb +178 -0
  24. data/spec/lib/character_conversion_spec.rb +280 -0
  25. data/spec/lib/domestic_chf_payment_spec.rb +189 -0
  26. data/spec/lib/dta_file_spec.rb +81 -0
  27. data/spec/lib/esr_payment_spec.rb +157 -0
  28. data/spec/lib/financial_institution_payment_spec.rb +229 -0
  29. data/spec/lib/iban_payment_spec.rb +201 -0
  30. data/spec/lib/payment_header_spec.rb +221 -0
  31. data/spec/lib/payment_spec.rb +15 -0
  32. data/spec/lib/special_financial_institution_payment_spec.rb +238 -0
  33. data/spec/lib/total_record_spec.rb +20 -0
  34. data/spec/spec_helper.rb +9 -0
  35. metadata +107 -0
@@ -0,0 +1,20 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+ require 'payments/total_record'
3
+
4
+ describe TotalRecord do
5
+ it 'should have the segment 1 field set' do
6
+ Factory.create_total_record.segment1[0,2].should == '01'
7
+ end
8
+
9
+ it 'should have a total amount' do
10
+ Factory.create_total_record(:total_amount => 789325.451).segment1[53,16].should == '789325,451 '
11
+ end
12
+
13
+ it "should have a reserve field with 59 blanks" do
14
+ Factory.create_total_record.segment1[69,59].should == ''.ljust(59)
15
+ end
16
+
17
+ it "should have a total length of 128 characters" do
18
+ Factory.create_total_record.record.size.should == 128
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib','payment_dta'))
3
+ require 'spec'
4
+ require 'spec/autorun'
5
+ require 'factory'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: payment_dta
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Patrick Huesler
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-25 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rubigen
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: Generate Swiss DTA payment files to extract payments from your existing application
36
+ email: patrick.huesler@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - LICENSE
43
+ - README.rdoc
44
+ files:
45
+ - LICENSE
46
+ - README.rdoc
47
+ - VERSION
48
+ - generators/payment/USAGE
49
+ - generators/payment/payment_generator.rb
50
+ - generators/payment/templates/model.rb.erb
51
+ - generators/payment/templates/spec.rb.erb
52
+ - lib/payment_dta.rb
53
+ - lib/payment_dta/character_conversion.rb
54
+ - lib/payment_dta/dta_file.rb
55
+ - lib/payment_dta/payment_sorting.rb
56
+ - lib/payment_dta/payments/bank_cheque_payment.rb
57
+ - lib/payment_dta/payments/base.rb
58
+ - lib/payment_dta/payments/domestic_chf_payment.rb
59
+ - lib/payment_dta/payments/esr_payment.rb
60
+ - lib/payment_dta/payments/financial_institution_payment.rb
61
+ - lib/payment_dta/payments/iban_payment.rb
62
+ - lib/payment_dta/payments/special_financial_institution_payment.rb
63
+ - lib/payment_dta/payments/total_record.rb
64
+ - script/destroy
65
+ - script/generate
66
+ has_rdoc: true
67
+ homepage: http://github.com/phuesler/payment_dta
68
+ licenses: []
69
+
70
+ post_install_message:
71
+ rdoc_options:
72
+ - --charset=UTF-8
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: "0"
86
+ version:
87
+ requirements: []
88
+
89
+ rubyforge_project:
90
+ rubygems_version: 1.3.5
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: Ruby library to generate Swiss DTA payment files
94
+ test_files:
95
+ - spec/factory.rb
96
+ - spec/lib/bank_cheque_payment_spec.rb
97
+ - spec/lib/character_conversion_spec.rb
98
+ - spec/lib/domestic_chf_payment_spec.rb
99
+ - spec/lib/dta_file_spec.rb
100
+ - spec/lib/esr_payment_spec.rb
101
+ - spec/lib/financial_institution_payment_spec.rb
102
+ - spec/lib/iban_payment_spec.rb
103
+ - spec/lib/payment_header_spec.rb
104
+ - spec/lib/payment_spec.rb
105
+ - spec/lib/special_financial_institution_payment_spec.rb
106
+ - spec/lib/total_record_spec.rb
107
+ - spec/spec_helper.rb