wirecard_sepa 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb017d5a1e8c8565f687f384e591a0ca1737a8d6
4
- data.tar.gz: 23e29f839adc122359effceb2a3b89ea2bada6f4
3
+ metadata.gz: 6f4973b11b84922100635e24a2b0602ee0ccecbf
4
+ data.tar.gz: 0cf6f83b49abfcce56cc7d6f5fc31a1567ad11a2
5
5
  SHA512:
6
- metadata.gz: b9c765cde9e57257c36dd2acb98cac536b77e5bbc6a49ead825af81b1d5388abcf9a9f600174945b81393eb7f0f974c69b3fc089c3701e72e1501051e717ffe5
7
- data.tar.gz: 8977336242a25b11482a41b17d7666b499f8e285546207c4573770b13f68710c9f92d9fa610a7b7305101f52db1083af036b200cbcedfef4458b8932a011b701
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
 
@@ -1,3 +1,3 @@
1
1
  module WirecardSepa
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -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
- xsd = Nokogiri::XML::Schema(read_support_file('payment.xsd'))
40
- doc = Nokogiri::XML(subject.to_xml)
41
- errors = xsd.validate(doc)
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.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-08 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus