akatus 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -16
- data/.rspec +2 -0
- data/LICENSE +1 -1
- data/Rakefile +6 -1
- data/akatus.gemspec +18 -11
- data/config/i18n.rb +3 -0
- data/lib/akatus.rb +34 -4
- data/lib/akatus/address.rb +11 -0
- data/lib/akatus/configuration.rb +43 -0
- data/lib/akatus/errors.rb +4 -0
- data/lib/akatus/formatters.rb +22 -0
- data/lib/akatus/installment.rb +6 -0
- data/lib/akatus/installment_options.rb +24 -0
- data/lib/akatus/item.rb +24 -0
- data/lib/akatus/payer.rb +35 -0
- data/lib/akatus/payment.rb +61 -0
- data/lib/akatus/payment_option.rb +6 -0
- data/lib/akatus/payment_types.rb +37 -0
- data/lib/akatus/phone.rb +6 -0
- data/lib/akatus/receiver.rb +6 -0
- data/lib/akatus/service.rb +34 -0
- data/lib/akatus/services/installments.rb +54 -0
- data/lib/akatus/services/payment_options.rb +95 -0
- data/lib/akatus/services/transaction.rb +50 -0
- data/lib/akatus/split_fee.rb +6 -0
- data/lib/akatus/transferrable.rb +58 -0
- data/lib/akatus/version.rb +1 -1
- data/locales/pt-BR.yml +69 -0
- data/spec/address_spec.rb +38 -0
- data/spec/factories/address_factories.rb +18 -0
- data/spec/factories/item_factories.rb +35 -0
- data/spec/factories/payer_factories.rb +8 -0
- data/spec/factories/phone_factories.rb +6 -0
- data/spec/item_spec.rb +42 -0
- data/spec/payer_spec.rb +31 -0
- data/spec/phone_spec.rb +23 -0
- data/spec/services/installments_spec.rb +36 -0
- data/spec/services/payment_options_spec.rb +22 -0
- data/spec/services/transaction_spec.rb +80 -0
- data/spec/spec_helper.rb +31 -0
- data/spec/support/configuration.rb +7 -0
- data/spec/support/shared_examples/transferrable_example.rb +22 -0
- metadata +142 -12
- data/LICENSE.txt +0 -22
- data/lib/akatus/configuracao.rb +0 -40
- 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.
|
data/lib/akatus/configuracao.rb
DELETED
@@ -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
|