wirecard_sepa 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/wirecard_sepa/utils/template.rb +3 -1
- data/lib/wirecard_sepa/version.rb +1 -1
- data/spec/lib/wirecard_sepa/direct_debit/request_spec.rb +10 -3
- 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: 6f4973b11b84922100635e24a2b0602ee0ccecbf
|
4
|
+
data.tar.gz: 0cf6f83b49abfcce56cc7d6f5fc31a1567ad11a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 857ffa44477f0804c427497103fd83944e7a3f85458d87c2e77b8309b11b6ee602be8e8e4c73f0acc131432f782e0267be599028986846e5a832997e9014a95c
|
7
|
+
data.tar.gz: 8abd6bf8c09e3fc355217edade3a2a87ec583c3b5e14ad9aae2b562d4137e61d60345d821423b0cd9687b077eff4aa19a59afbe6d71dc35b0b181a17f85c025f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## [0.1.2] - 2015-09-09
|
2
|
+
### Fixed
|
3
|
+
- Params for a debit return may now contain special chars without leading to a malformed XML doc.
|
4
|
+
E.g. having "&" or "<" in a param lead to a malformed XML doc.
|
5
|
+
|
1
6
|
## [0.1.1] - 2015-09-08
|
2
7
|
### Changed
|
3
8
|
- All response objects implement `to_s` which returns the actual response xml string
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rexml/text'
|
2
|
+
|
1
3
|
module WirecardSepa
|
2
4
|
module Utils
|
3
5
|
class Template
|
@@ -16,7 +18,7 @@ module WirecardSepa
|
|
16
18
|
|
17
19
|
def request_params
|
18
20
|
params_without_custom_fields.each_with_object({}) do |(k,v), h|
|
19
|
-
h["{{#{k.upcase}}}"] = v
|
21
|
+
h["{{#{k.upcase}}}"] = REXML::Text.new(v.to_s)
|
20
22
|
end.merge('{{CUSTOM_FIELDS}}' => custom_fields_xml)
|
21
23
|
end
|
22
24
|
|
@@ -30,15 +30,22 @@ describe WirecardSepa::DirectDebit::Request do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe '#to_xml' do
|
33
|
+
let(:xsd) { Nokogiri::XML::Schema(read_support_file('payment.xsd')) }
|
34
|
+
let(:doc) { Nokogiri::XML(subject.to_xml) { |config| config.strict } }
|
35
|
+
let(:errors) { xsd.validate(doc) }
|
36
|
+
|
33
37
|
it 'builds the correct xml' do
|
34
38
|
expected_xml = read_support_file('direct_debit/success/request_with_custom_fields.xml')
|
35
39
|
expect(subject.to_xml).to eq expected_xml
|
36
40
|
end
|
37
41
|
|
38
42
|
it 'builds a valid request' do
|
39
|
-
|
40
|
-
|
41
|
-
|
43
|
+
expect(errors).to be_empty
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'can handle special chars' do
|
47
|
+
params[:account_holder_first_name] = 'Firma'
|
48
|
+
params[:account_holder_last_name] = 'Muscle Line Poerschke © & Rez Gbr.'
|
42
49
|
expect(errors).to be_empty
|
43
50
|
end
|
44
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wirecard_sepa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- betterplace developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|