docdata 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/docdata/payment.rb +6 -0
- data/lib/docdata/version.rb +1 -1
- data/lib/docdata/xml/create.xml.erb +2 -2
- data/spec/payment_spec.rb +6 -0
- 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: e4522413a11b26b3dfdfd86eba1c75266e2e75fd
|
4
|
+
data.tar.gz: 59ec267e42dc78db14c0ae8e24ff262198f14dc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e7708006984099623dd4eb12229b6913285525705e3ac6e0b398e3a7626902896e5431f1f95afb745e97201da551c10bac842b0545b6027e1331671bd46a1a8
|
7
|
+
data.tar.gz: 3440473688ded10b3412bc588d3dc949beba30b2a0704123a0017af786b5582951124f4d64534494e608719927ba5674e1d5d4bba2669f978605559e14200e9a
|
data/CHANGELOG.md
CHANGED
data/lib/docdata/payment.rb
CHANGED
@@ -69,6 +69,12 @@ module Docdata
|
|
69
69
|
end
|
70
70
|
|
71
71
|
|
72
|
+
# @return [String] a cleaned up version of the description string
|
73
|
+
# where forbidden characters are filtered out and limit is 50 chars.
|
74
|
+
def cleaned_up_description
|
75
|
+
description.gsub("&", "and")[0..49]
|
76
|
+
end
|
77
|
+
|
72
78
|
# @return [Boolean] true/false, depending if this instanciated object is valid
|
73
79
|
def valid?
|
74
80
|
validator = PaymentValidator.new
|
data/lib/docdata/version.rb
CHANGED
@@ -35,7 +35,7 @@
|
|
35
35
|
</_1:billTo>
|
36
36
|
|
37
37
|
<% if payment.description.present? %>
|
38
|
-
<_1:description><%= payment.
|
38
|
+
<_1:description><%= payment.cleaned_up_description %></_1:description>
|
39
39
|
<% end %>
|
40
40
|
<% if payment.receipt_text.present? %>
|
41
41
|
<_1:receiptText><%= payment.receipt_text %></_1:receiptText>
|
@@ -89,7 +89,7 @@
|
|
89
89
|
</_1:address>
|
90
90
|
</_1:shipTo>
|
91
91
|
<!--Optional:-->
|
92
|
-
<_1:additionalDescription
|
92
|
+
<_1:additionalDescription></_1:additionalDescription>
|
93
93
|
</_1:invoice>
|
94
94
|
<% end %>
|
95
95
|
|
data/spec/payment_spec.rb
CHANGED
@@ -97,6 +97,12 @@ describe Docdata::Payment do
|
|
97
97
|
expect(@response.payment).to be_kind_of(Docdata::Payment)
|
98
98
|
end
|
99
99
|
|
100
|
+
it "replaces & for 'and'" do
|
101
|
+
@payment.description = "Pete & Friends"
|
102
|
+
expect(@payment.cleaned_up_description) == "Pete and Friends"
|
103
|
+
expect(@payment.create_xml).to include("Pete and Friends")
|
104
|
+
end
|
105
|
+
|
100
106
|
it "has a `url` property" do
|
101
107
|
Docdata.set_credentials_from_environment
|
102
108
|
VCR.use_cassette("payments-successful-create") do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docdata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henk Meijer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|