multicash 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/multicash/credit_transfer.rb +1 -1
- data/lib/multicash/labels/credit_transfer.rb +12 -11
- data/lib/multicash/labels/payment_order.rb +2 -2
- data/lib/multicash/payment_order.rb +2 -2
- data/multicash.gemspec +3 -3
- data/spec/labels/credit_transfer_spec.rb +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d245ece852ed962113e40b05202f0526fe03708
|
4
|
+
data.tar.gz: af5aafce8aa5e763f7552384ae62dfea3fdcdcaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc8a89ad85f98e10db1ff60c63c7b9ff3835c061ffa6d206656cba3387d5553894e5a5bd63f9a520fee6f31ad063745023e0d5a43ec0ef7e7c442490a8f784a0
|
7
|
+
data.tar.gz: e6dce9bd9b7362d5fbbfc0309cd53cb19adc59144143475c3cc99430b1270f4a7c29cdc33b64435cb177adee0597555a3040df7e45430c35f1616a21ba11a2c4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -29,7 +29,7 @@ module Multicash
|
|
29
29
|
value = ""
|
30
30
|
value << transfer.today
|
31
31
|
value << transfer.currency
|
32
|
-
value << print_currency_with_comma(transfer.ammount, -
|
32
|
+
value << print_currency_with_comma(transfer.ammount, -10)
|
33
33
|
|
34
34
|
"#{label}#{print_string((value), -22)}"
|
35
35
|
end
|
@@ -38,7 +38,7 @@ module Multicash
|
|
38
38
|
label = ":50K:"
|
39
39
|
value = "/"
|
40
40
|
value << transfer.ordering_iban
|
41
|
-
value << "\n"
|
41
|
+
value << "\r\n"
|
42
42
|
value << transfer.ordering_name
|
43
43
|
|
44
44
|
"#{label}#{value}"
|
@@ -46,8 +46,8 @@ module Multicash
|
|
46
46
|
|
47
47
|
def label_52D
|
48
48
|
label = ":52D:"
|
49
|
-
value =
|
50
|
-
value << "\n"
|
49
|
+
value = transfer.ordering_bae
|
50
|
+
value << "\r\n"
|
51
51
|
value << print_string(transfer.ordering_bank_name, -35)
|
52
52
|
|
53
53
|
"#{label}#{value}"
|
@@ -55,8 +55,8 @@ module Multicash
|
|
55
55
|
|
56
56
|
def label_57D
|
57
57
|
label = ":57D:"
|
58
|
-
value =
|
59
|
-
value << "\n"
|
58
|
+
value = transfer.destination_bae
|
59
|
+
value << "\r\n"
|
60
60
|
value << print_string(transfer.destination_bank_name, -35)
|
61
61
|
|
62
62
|
"#{label}#{value}"
|
@@ -66,7 +66,7 @@ module Multicash
|
|
66
66
|
label = ":59:"
|
67
67
|
value = '/'
|
68
68
|
value << transfer.destination_iban
|
69
|
-
value << "\n"
|
69
|
+
value << "\r\n"
|
70
70
|
value << print_string(transfer.destination_name, -35)
|
71
71
|
|
72
72
|
"#{label}#{value}"
|
@@ -80,9 +80,10 @@ module Multicash
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def label_70_footer
|
83
|
-
value = "
|
83
|
+
value = "/"
|
84
|
+
value << "\r\n"
|
84
85
|
value << "/NTYPE/000000000000"
|
85
|
-
value << "\n
|
86
|
+
value << "\r\n"
|
86
87
|
value << "/OPNAT/J"
|
87
88
|
|
88
89
|
value
|
@@ -98,14 +99,14 @@ module Multicash
|
|
98
99
|
|
99
100
|
def label_72
|
100
101
|
label = ":72:"
|
101
|
-
value =
|
102
|
+
value = transfer.payment_system
|
102
103
|
|
103
104
|
"#{label}#{value}"
|
104
105
|
end
|
105
106
|
|
106
107
|
def label_72_footer
|
107
108
|
value = "/BAEREF/000000000000000000"
|
108
|
-
value << "\n
|
109
|
+
value << "\r\n"
|
109
110
|
value << "/PROL/NORM"
|
110
111
|
end
|
111
112
|
end
|
@@ -34,8 +34,8 @@ module Multicash
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def label_B1T
|
37
|
-
label = ":B1T:
|
38
|
-
value = ""
|
37
|
+
label = ":B1T:"
|
38
|
+
value = sprintf("%03d", payment_order.transfers.size)
|
39
39
|
value << payment_order.currency
|
40
40
|
value << print_currency_with_comma(payment_order.total_ammount.to_s, -9)
|
41
41
|
|
@@ -48,7 +48,7 @@ module Multicash
|
|
48
48
|
lines << payment_labels.label_77E
|
49
49
|
lines << payment_labels.label_B1T
|
50
50
|
|
51
|
-
lines.join("\
|
51
|
+
lines.join("\x0D\x0A") + "\x0D\x0A-}"
|
52
52
|
end
|
53
53
|
|
54
54
|
def body
|
@@ -70,7 +70,7 @@ module Multicash
|
|
70
70
|
return false unless self.errors.blank?
|
71
71
|
|
72
72
|
bank_file = File.join(Dir.tmpdir, "#{Time.now.strftime('%Y-%m-%d')}.txt")
|
73
|
-
File.open(bank_file, "w+", cr_newline:
|
73
|
+
File.open(bank_file, "w+", cr_newline: false, external_encoding: Encoding::CP1251) do |file|
|
74
74
|
file.write generate.encode("CP1251")
|
75
75
|
end
|
76
76
|
|
data/multicash.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: multicash 0.0.
|
5
|
+
# stub: multicash 0.0.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "multicash"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Anton Yordanov"]
|
13
|
-
s.date = "2014-02-
|
13
|
+
s.date = "2014-02-05"
|
14
14
|
s.description = "Generate payment order under the multicash spec"
|
15
15
|
s.email = "anton.yordnaov@gmail.com"
|
16
16
|
s.extra_rdoc_files = [
|
@@ -28,31 +28,31 @@ describe "Multicash::Labels::CreditTransfer" do
|
|
28
28
|
let(:transfer_labels) { Multicash::Labels::CreditTransfer.new(credit_transfer) }
|
29
29
|
|
30
30
|
specify "label_20" do
|
31
|
-
expect(transfer_labels.label_20.size).to eq(20)
|
31
|
+
expect(transfer_labels.label_20.size).to eq(20)
|
32
32
|
end
|
33
33
|
|
34
34
|
specify "label_23B" do
|
35
|
-
expect(transfer_labels.label_23B.size).to eq(9)
|
35
|
+
expect(transfer_labels.label_23B.size).to eq(9)
|
36
36
|
end
|
37
37
|
|
38
38
|
specify "label_32A" do
|
39
|
-
expect(transfer_labels.label_32A.size).to eq(
|
39
|
+
expect(transfer_labels.label_32A.size).to eq(27)
|
40
40
|
end
|
41
41
|
|
42
42
|
specify "label_50K" do
|
43
|
-
expect(transfer_labels.label_50K.size).to eq(
|
43
|
+
expect(transfer_labels.label_50K.size).to eq(38)
|
44
44
|
end
|
45
45
|
|
46
46
|
specify "label_52D" do
|
47
|
-
expect(transfer_labels.label_52D.size).to eq(
|
47
|
+
expect(transfer_labels.label_52D.size).to eq(50)
|
48
48
|
end
|
49
49
|
|
50
50
|
specify "label_57D" do
|
51
|
-
expect(transfer_labels.label_57D.size).to eq(
|
51
|
+
expect(transfer_labels.label_57D.size).to eq(50)
|
52
52
|
end
|
53
53
|
|
54
54
|
specify "label_59" do
|
55
|
-
expect(transfer_labels.label_59.size).to eq(
|
55
|
+
expect(transfer_labels.label_59.size).to eq(65)
|
56
56
|
end
|
57
57
|
|
58
58
|
specify "label_71A" do
|
@@ -60,7 +60,7 @@ describe "Multicash::Labels::CreditTransfer" do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
specify "label_72" do
|
63
|
-
expect(transfer_labels.label_72.size).to eq(
|
63
|
+
expect(transfer_labels.label_72.size).to eq(5)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multicash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Yordanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|