sports_south 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sports_south/ffl.rb +28 -0
- data/lib/sports_south/version.rb +1 -1
- data/lib/sports_south.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76f6a22bed5beb8e75be417884d5fd436a8720e1
|
4
|
+
data.tar.gz: adc7a26cbf83092e7ad89861e600d83d58882971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b11ab187ea6c799df0ec70f0f39c8ce755ad6fad41f4c289c496fbbf48846076900677803684802d36c5f3b5ccf584ea893ed38381324b69f23665fb03ca0c87
|
7
|
+
data.tar.gz: 7f70b7403f3f7656c24bee341452f93fcd1714536b61f23906504bb53ab4b3c7df12a1221f1235242a5e5d7694794043f8e5b89f395f6c544bc98baadd7360da
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module SportsSouth
|
2
|
+
class FFL < Base
|
3
|
+
|
4
|
+
API_URL = 'http://webservices.theshootingwarehouse.com/smart/orders.asmx'
|
5
|
+
|
6
|
+
DATE_REGEX = /\A\d+\/\d+\/\d+/
|
7
|
+
|
8
|
+
def self.accepts_transfer(ffl, options = {})
|
9
|
+
requires!(options, :username, :password, :source, :customer_number)
|
10
|
+
|
11
|
+
http, request = get_http_and_request(API_URL, '/FFLAcceptsTransfer')
|
12
|
+
|
13
|
+
request.set_form_data(form_params(options).merge({ FFL: ffl }))
|
14
|
+
|
15
|
+
response = http.request(request)
|
16
|
+
body = sanitize_response(response)
|
17
|
+
xml_doc = Nokogiri::XML(body)
|
18
|
+
|
19
|
+
raise SportsSouth::NotAuthenticated if not_authenticated?(xml_doc)
|
20
|
+
|
21
|
+
# Response returns FFL expiration date (does accept transfer),
|
22
|
+
# '0' if they do not accept transfer,
|
23
|
+
# or 'UNKNOWN' if SS cannot find the FFL.
|
24
|
+
xml_doc.content =~ DATE_REGEX ? true : false
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
data/lib/sports_south/version.rb
CHANGED
data/lib/sports_south.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sports_south
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/sports_south/base.rb
|
89
89
|
- lib/sports_south/brand.rb
|
90
90
|
- lib/sports_south/category.rb
|
91
|
+
- lib/sports_south/ffl.rb
|
91
92
|
- lib/sports_south/image.rb
|
92
93
|
- lib/sports_south/inventory.rb
|
93
94
|
- lib/sports_south/invoice.rb
|