akatus 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -16
  3. data/.rspec +2 -0
  4. data/LICENSE +1 -1
  5. data/Rakefile +6 -1
  6. data/akatus.gemspec +18 -11
  7. data/config/i18n.rb +3 -0
  8. data/lib/akatus.rb +34 -4
  9. data/lib/akatus/address.rb +11 -0
  10. data/lib/akatus/configuration.rb +43 -0
  11. data/lib/akatus/errors.rb +4 -0
  12. data/lib/akatus/formatters.rb +22 -0
  13. data/lib/akatus/installment.rb +6 -0
  14. data/lib/akatus/installment_options.rb +24 -0
  15. data/lib/akatus/item.rb +24 -0
  16. data/lib/akatus/payer.rb +35 -0
  17. data/lib/akatus/payment.rb +61 -0
  18. data/lib/akatus/payment_option.rb +6 -0
  19. data/lib/akatus/payment_types.rb +37 -0
  20. data/lib/akatus/phone.rb +6 -0
  21. data/lib/akatus/receiver.rb +6 -0
  22. data/lib/akatus/service.rb +34 -0
  23. data/lib/akatus/services/installments.rb +54 -0
  24. data/lib/akatus/services/payment_options.rb +95 -0
  25. data/lib/akatus/services/transaction.rb +50 -0
  26. data/lib/akatus/split_fee.rb +6 -0
  27. data/lib/akatus/transferrable.rb +58 -0
  28. data/lib/akatus/version.rb +1 -1
  29. data/locales/pt-BR.yml +69 -0
  30. data/spec/address_spec.rb +38 -0
  31. data/spec/factories/address_factories.rb +18 -0
  32. data/spec/factories/item_factories.rb +35 -0
  33. data/spec/factories/payer_factories.rb +8 -0
  34. data/spec/factories/phone_factories.rb +6 -0
  35. data/spec/item_spec.rb +42 -0
  36. data/spec/payer_spec.rb +31 -0
  37. data/spec/phone_spec.rb +23 -0
  38. data/spec/services/installments_spec.rb +36 -0
  39. data/spec/services/payment_options_spec.rb +22 -0
  40. data/spec/services/transaction_spec.rb +80 -0
  41. data/spec/spec_helper.rb +31 -0
  42. data/spec/support/configuration.rb +7 -0
  43. data/spec/support/shared_examples/transferrable_example.rb +22 -0
  44. metadata +142 -12
  45. data/LICENSE.txt +0 -22
  46. data/lib/akatus/configuracao.rb +0 -40
  47. data/lib/akatus/formatadores.rb +0 -7
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Kauplus
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,40 +0,0 @@
1
- require 'singleton'
2
-
3
- module Akatus
4
-
5
- def self.configuracao
6
- Configuracao.instance
7
- end
8
-
9
- #
10
- # Private.
11
- #
12
- private
13
-
14
- class Configuracao
15
- include Singleton
16
-
17
- attr_accessor :env, :sandbox, :url_carrinho
18
-
19
- #
20
- # Private methods.
21
- #
22
- private
23
-
24
- def initialize
25
- if defined? Rails
26
- path = "#{Rails.root}/config/akatus.yml"
27
- self.env = Rails.env
28
- else
29
- path = "#{Dir.pwd}/config/akatus.yml"
30
- self.env = ENV['AKATUS_ENV'] || 'development'
31
- end
32
- conf = File.exists?(path) ? YAML.load_file(path)[self.env] : {}
33
-
34
- self.sandbox = conf['sandbox'].present? && conf['sandbox'] == true
35
- self.url_carrinho = self.sandbox ? 'https://dev.akatus.com/carrinho/' : 'https://www.akatus.com/carrinho/'
36
- end
37
-
38
- end
39
-
40
- end
@@ -1,7 +0,0 @@
1
- module Akatus
2
-
3
- def self.formatar_numero(number)
4
- ActiveSupport::NumberHelper.number_to_rounded(number.try(:to_d), :precision => 2, :separator => '', :delimiter => '')
5
- end
6
-
7
- end