Navigation Menu

Skip to content

Commit

Permalink
add support for "soft-descritor" field as described in version 2.0.2 …
Browse files Browse the repository at this point in the history
…of the integration manual
  • Loading branch information
rafaelss committed Oct 18, 2012
1 parent c37ebc3 commit 15f1e36
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/cielo/order.rb
Expand Up @@ -8,5 +8,6 @@ class Order
element :currency, String, :tag => "moeda"
element :time, Time, :tag => "data-hora", :on_save => proc { |value| value.strftime("%Y-%m-%dT%H:%M:%S") }
element :language, String, :tag => "idioma"
element :soft_descriptor, String, :tag => "soft-descriptor"
end
end
13 changes: 13 additions & 0 deletions spec/cielo/order_spec.rb
Expand Up @@ -21,4 +21,17 @@

xml.should == File.read(File.expand_path("../../fixtures/order.xml", __FILE__))
end

describe "with soft descriptor" do
it "#to_xml" do
subject.number = 285813768
subject.total = 1
subject.currency = 986
subject.time = Time.now
subject.language = "PT"
subject.soft_descriptor = "CieloX Store"

expect(subject.to_xml).to eq(File.read(File.expand_path("../../fixtures/order_2.xml", __FILE__)))
end
end
end
9 changes: 9 additions & 0 deletions spec/fixtures/order_2.xml
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<dados-pedido>
<numero>285813768</numero>
<valor>100</valor>
<moeda>986</moeda>
<data-hora>2010-07-14T13:56:12</data-hora>
<idioma>PT</idioma>
<soft-descriptor>CieloX Store</soft-descriptor>
</dados-pedido>

0 comments on commit 15f1e36

Please sign in to comment.