sw_fac 0.3.0 → 0.3.1
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 +4 -4
- data/README.md +23 -6
- data/lib/sw_fac/config.rb +0 -1
- data/lib/sw_fac/facturacion.rb +2 -1
- data/lib/sw_fac/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e03bb405a9045c32cd155cfa0e383e89cc4e2e6
|
4
|
+
data.tar.gz: 575fec7dd28869e02528b644be3226fdf6f5a9e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5adc22e403259131bd080f9c33d9de0cd389af0f06823746720f9113cbaafa67ec2beecedee5be2a5c26f6416a769de29b4be67258168caeb7abc6c6833a7378
|
7
|
+
data.tar.gz: 7b667ec5b4754fc05b1a8bf53f23c56937bf8b4f5b8acdb458968918cc8171c507ca187f06d7c8d6aeed2a8ede2312214a601a8aae2ba1c77538f000540c21ce
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
#
|
1
|
+
# sw_fac 0.3.0
|
2
2
|
|
3
|
-
|
3
|
+
This is a ruby library that helps to interact with the Smarted Web API and the mexican billing system (SAT).
|
4
4
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
@@ -22,17 +21,35 @@ Or install it yourself as:
|
|
22
21
|
|
23
22
|
## Usage
|
24
23
|
|
25
|
-
|
24
|
+
Initialize a new object with your config arguments
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
# Required arguments
|
28
|
+
production_token = (String) # your production token
|
29
|
+
development_token = (String) # your dev token
|
30
|
+
rfc = (String) # your company rfc
|
31
|
+
razon_social = (String) # your company name
|
32
|
+
regimen = (String) # example 612
|
33
|
+
path_to_key = (String) # the path where the 'example.key' is
|
34
|
+
key_passphrase = (String) # password for the .key file
|
35
|
+
path_to_cer = (String) # the path where the 'example.cer' is
|
36
|
+
|
37
|
+
# Optional arguments
|
38
|
+
production = (Boolean) # environment, optional, default is -false-
|
39
|
+
|
40
|
+
# The object
|
41
|
+
obj = SwFac::Facturacion.new(production_token, development_token, rfc, razon_social, regimen, path_to_key, key_passphrase, path_to_cer, production)
|
42
|
+
```
|
26
43
|
|
27
44
|
## Development
|
28
45
|
|
29
46
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
47
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
48
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
32
49
|
|
33
50
|
## Contributing
|
34
51
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/angelpadilla/sw_facturacion.
|
36
53
|
|
37
54
|
## License
|
38
55
|
|
data/lib/sw_fac/config.rb
CHANGED
data/lib/sw_fac/facturacion.rb
CHANGED
@@ -400,6 +400,7 @@ module SwFac
|
|
400
400
|
# receptor_razon: 'Car zone',
|
401
401
|
# receptor_rfc: '',
|
402
402
|
# uso_cfdi: 'G03',
|
403
|
+
# time: "%Y-%m-%dT%H:%M:%S",
|
403
404
|
# line_items: [
|
404
405
|
# {
|
405
406
|
# clave_prod_serv: '78181500',
|
@@ -421,7 +422,7 @@ module SwFac
|
|
421
422
|
|
422
423
|
uri = @production ? URI("#{SwFac::UrlProduction}cfdi33/stamp/customv1/b64") : URI("#{SwFac::UrlDev}cfdi33/stamp/customv1/b64")
|
423
424
|
token = @production ? @production_token : @dev_token
|
424
|
-
time = Time.now
|
425
|
+
time = params.fetch(:time, (Time.now).strftime("%Y-%m-%dT%H:%M:%S"))
|
425
426
|
|
426
427
|
xml = Nokogiri::XML(SwFac::DocBase)
|
427
428
|
comprobante = xml.at_xpath("//cfdi:Comprobante")
|
data/lib/sw_fac/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sw_fac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angel Padilla
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,8 @@ dependencies:
|
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.8.2
|
69
|
-
description: Gem used to fetch the Smarter Web API
|
69
|
+
description: Gem used to fetch the Smarter Web API for the mexican billing system
|
70
|
+
(SAT), this gem was builted and is currently used by the team at www.mfactura.ml
|
70
71
|
email:
|
71
72
|
- angelpadillam@gmail.com
|
72
73
|
executables: []
|
@@ -108,7 +109,7 @@ files:
|
|
108
109
|
- lib/sw_fac/facturacion.rb
|
109
110
|
- lib/sw_fac/tools.rb
|
110
111
|
- lib/sw_fac/version.rb
|
111
|
-
homepage: https://
|
112
|
+
homepage: https://github.com/angelpadilla/sw_facturacion
|
112
113
|
licenses:
|
113
114
|
- MIT
|
114
115
|
metadata:
|
@@ -132,5 +133,5 @@ rubyforge_project:
|
|
132
133
|
rubygems_version: 2.4.5
|
133
134
|
signing_key:
|
134
135
|
specification_version: 4
|
135
|
-
summary: Gem used to fetch the Smarter Web API
|
136
|
+
summary: Gem used to fetch the Smarter Web API
|
136
137
|
test_files: []
|