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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0d995170516be4b7894d94e95b7c56ab99136c3
4
- data.tar.gz: c711e81b5d51c9f428a7b61f2622e9c14c10efd2
3
+ metadata.gz: 5e03bb405a9045c32cd155cfa0e383e89cc4e2e6
4
+ data.tar.gz: 575fec7dd28869e02528b644be3226fdf6f5a9e6
5
5
  SHA512:
6
- metadata.gz: b17a489ffb8fe83cbfa95f74e220048bd38b2bd3d2f5f5d91b17e1c604d02f09f8ba535dc82bbd2684bdd5778912c6270442aec5c9f91fbf605632fb639aed8e
7
- data.tar.gz: 9b4956b850c86934852967ed17059fdbdab32644be7a01f31a4108d3fe9ba33b0597ebd3bb7adab533b25291e0e8c00af01ac4197a83e395657795e421a9d9b0
6
+ metadata.gz: 5adc22e403259131bd080f9c33d9de0cd389af0f06823746720f9113cbaafa67ec2beecedee5be2a5c26f6416a769de29b4be67258168caeb7abc6c6833a7378
7
+ data.tar.gz: 7b667ec5b4754fc05b1a8bf53f23c56937bf8b4f5b8acdb458968918cc8171c507ca187f06d7c8d6aeed2a8ede2312214a601a8aae2ba1c77538f000540c21ce
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # SwFac
1
+ # sw_fac 0.3.0
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sw_fac`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Write usage instructions here
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`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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/[USERNAME]/sw_fac.
52
+ Bug reports and pull requests are welcome on GitHub at https://github.com/angelpadilla/sw_facturacion.
36
53
 
37
54
  ## License
38
55
 
@@ -1,6 +1,5 @@
1
1
  module SwFac
2
2
  class Config
3
- # attr_accessor :production_token, :dev_token
4
3
  attr_accessor :production_token, :dev_token, :doc_cer_path, :doc_key_path
5
4
  attr_reader :pem, :serial, :cadena, :key_pass, :pem_cadena
6
5
 
@@ -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")
@@ -1,3 +1,3 @@
1
1
  module SwFac
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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.0
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-09-05 00:00:00.000000000 Z
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://bitbucket.org/padilla_mz/sw_factura/src/master/
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, used in mfactura.ml
136
+ summary: Gem used to fetch the Smarter Web API
136
137
  test_files: []