clearsale 0.1.3 → 0.1.4
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.
- data/.gitignore +2 -0
- data/lib/clearsale/connector.rb +5 -3
- data/lib/clearsale/version.rb +1 -1
- data/spec/order_spec.rb +1 -1
- metadata +4 -9
data/lib/clearsale/connector.rb
CHANGED
|
@@ -14,14 +14,16 @@ module Clearsale
|
|
|
14
14
|
|
|
15
15
|
def self.build(env = ENV['CLEARSALE_ENV'])
|
|
16
16
|
url = ENV["CLEARSALE_URL"] || URLs[env] || URLs["homolog"]
|
|
17
|
-
|
|
17
|
+
proxy = ENV['CLEARSALE_PROXY']
|
|
18
|
+
new url, proxy
|
|
18
19
|
end
|
|
19
20
|
|
|
20
|
-
def initialize(endpoint_url)
|
|
21
|
+
def initialize(endpoint_url, proxy=nil)
|
|
21
22
|
@token = ENV['CLEARSALE_ENTITYCODE']
|
|
22
|
-
@client = Savon::Client.new do |wsdl|
|
|
23
|
+
@client = Savon::Client.new do |wsdl, http|
|
|
23
24
|
wsdl.endpoint = endpoint_url
|
|
24
25
|
wsdl.namespace = NAMESPACE
|
|
26
|
+
http.proxy = proxy if proxy
|
|
25
27
|
end
|
|
26
28
|
end
|
|
27
29
|
|
data/lib/clearsale/version.rb
CHANGED
data/spec/order_spec.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Clearsale
|
|
|
14
14
|
|
|
15
15
|
describe ".to_xml" do
|
|
16
16
|
it "converts the order to xml successfully" do
|
|
17
|
-
described_class.to_xml(_order, _payment, _user).should eq '<ClearSale><Orders><Order><ID>1234</ID><Date>2012-07-01T11:13:00</Date><Email>petergriffin@abc.com</Email><TotalItens>20.0</TotalItens><TotalOrder>25.0</TotalOrder><QtyInstallments>3</QtyInstallments><QtyItems>3</QtyItems><IP>127.0.0.1</IP><CollectionData><ID>8888</ID><Type>1</Type><LegalDocument1>24878346337</LegalDocument1><Name>Peter Löwenbräu Griffin</Name><BirthDate>1972-07-01T11:13:00</BirthDate><Email>petergriffin@abc.com</Email><Genre>m</Genre><Address><Street>Billing Street</Street><Number>123</Number><Comp
|
|
17
|
+
described_class.to_xml(_order, _payment, _user).should eq '<ClearSale><Orders><Order><ID>1234</ID><Date>2012-07-01T11:13:00</Date><Email>petergriffin@abc.com</Email><TotalItens>20.0</TotalItens><TotalOrder>25.0</TotalOrder><QtyInstallments>3</QtyInstallments><QtyItems>3</QtyItems><IP>127.0.0.1</IP><CollectionData><ID>8888</ID><Type>1</Type><LegalDocument1>24878346337</LegalDocument1><Name>Peter Löwenbräu Griffin</Name><BirthDate>1972-07-01T11:13:00</BirthDate><Email>petergriffin@abc.com</Email><Genre>m</Genre><Address><Street>Billing Street</Street><Number>123</Number><Comp/><County>Rhode Island</County><City>Mayland</City><State>Maryland</State><ZipCode>00100-011</ZipCode></Address><Phones><Phone><Type>0</Type><DDD>11</DDD><Number>80011002</Number></Phone></Phones></CollectionData><ShippingData><ID>8888</ID><Type>1</Type><LegalDocument1>24878346337</LegalDocument1><Name>Peter Löwenbräu Griffin</Name><BirthDate>1972-07-01T11:13:00</BirthDate><Email>petergriffin@abc.com</Email><Genre>m</Genre><Address><Street>Shipping Street</Street><Number>123</Number><Comp/><County>Rhode Island</County><City>Mayland</City><State>Maryland</State><ZipCode>00100-011</ZipCode></Address><Phones><Phone><Type>0</Type><DDD>11</DDD><Number>80011002</Number></Phone></Phones></ShippingData><Payments><Payment><Date>2012-07-01T11:12:58</Date><Amount>50.0</Amount><PaymentTypeID>1</PaymentTypeID><QtyInstallments>3</QtyInstallments><CardNumber>1234432111112222</CardNumber><CardBin>123443</CardBin><CardType>3</CardType><CardExpirationDate>05/2012</CardExpirationDate><Name/><LegalDocument>24878346337</LegalDocument><Address><Street>Billing Street</Street><Number>123</Number><Comp/><County>Rhode Island</County><City>Mayland</City><State>Maryland</State><ZipCode>00100-011</ZipCode></Address></Payment></Payments><Items><Item><ID>5555</ID><Name>Pogobol</Name><ItemValue>5.0</ItemValue><Qty>2</Qty><CategoryID>7777</CategoryID><CategoryName>Disney</CategoryName></Item><Item><ID>5555</ID><Name>Pogobol</Name><ItemValue>5.0</ItemValue><Qty>2</Qty><CategoryID>7777</CategoryID><CategoryName>Disney</CategoryName></Item></Items></Order></Orders></ClearSale>'
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
context "about credit card acquirer" do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: clearsale
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2013-08-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: builder
|
|
@@ -283,21 +283,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
283
283
|
- - ! '>='
|
|
284
284
|
- !ruby/object:Gem::Version
|
|
285
285
|
version: '0'
|
|
286
|
-
segments:
|
|
287
|
-
- 0
|
|
288
|
-
hash: -3140110756555446380
|
|
289
286
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
287
|
none: false
|
|
291
288
|
requirements:
|
|
292
289
|
- - ! '>='
|
|
293
290
|
- !ruby/object:Gem::Version
|
|
294
291
|
version: '0'
|
|
295
|
-
segments:
|
|
296
|
-
- 0
|
|
297
|
-
hash: -3140110756555446380
|
|
298
292
|
requirements: []
|
|
299
293
|
rubyforge_project: clearsale
|
|
300
|
-
rubygems_version: 1.8.
|
|
294
|
+
rubygems_version: 1.8.25
|
|
301
295
|
signing_key:
|
|
302
296
|
specification_version: 3
|
|
303
297
|
summary: clearsale gem to use Clearsale service
|
|
@@ -315,3 +309,4 @@ test_files:
|
|
|
315
309
|
- spec/requests/clearsale_spec.rb
|
|
316
310
|
- spec/spec_helper.rb
|
|
317
311
|
- spec/support/helpers.rb
|
|
312
|
+
has_rdoc:
|