api-moip-assinaturas 0.0.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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTE4N2FkNDM0OTBiMGM1MGNkYWVkMjk4YmJmNjU2MGZkZDY1YmMxYQ==
5
+ data.tar.gz: !binary |-
6
+ MTUzYWNmZWRiMTNiNDE0ODAwYjUzNmJjNmI3MGM3MGIyMTYzNzc5MA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZmYwMDg2NGE2NmFiOTYyNDQyMmUyNDE5N2VhMWZhNmM3NmI5NGU4MGVlYWIw
10
+ OTA5OGViNTI0NmY0NWMwYmYwNzQ4ZmNiMTQ5MWY0NzkyZmVhMGJmOTliNGFh
11
+ NDJhMjZlNmVkODkwNDQ0YTBhYWI4YmQ4Zjk5NDNhMDFjOWI2MWE=
12
+ data.tar.gz: !binary |-
13
+ N2JhMTI3M2I0Y2ViNzlhNWFjM2Q4ZTc5Y2E2ZjE4OWNhNzNkYWRjN2RhM2Q1
14
+ ZjRjY2MzMDc5NDNhYWI3NGUxZmJiYTkzYWFkNWQ5MDYzYjg2ZDVkM2E0NDVj
15
+ YmIwYjAyNjIxNWNjNjU5YzVhYjhhMzRkYWJiNGY0MjRkY2E5NGQ=
@@ -0,0 +1,15 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'api-moip-assinaturas'
3
+ s.version = '0.0.1'
4
+ s.date = '2013-05-29'
5
+ s.summary = "Moip Assinaturas by Pixxel"
6
+ s.description = "Gem desenvolvida para atender aos requisitos do moip api de assinaturas"
7
+ s.authors = ["Douglas Rossignolli"]
8
+ s.email = 'douglas@pixxel.net.br'
9
+ s.homepage = 'http://pixxel.net.br'
10
+ s.files = Dir["{lib/**/*.rb,README.rdoc,test/**/*.rb,Rakefile,*.gemspec}"]
11
+
12
+ s.required_ruby_version = '>= 1.9.3'
13
+ s.required_rubygems_version = '>= 1.8.11'
14
+ s.add_dependency 'httparty', ' >= 0.11.0'
15
+ end
data/lib/moip.rb ADDED
@@ -0,0 +1,19 @@
1
+ module Moip
2
+ class T
3
+ def teste
4
+ # dir = Dir.pwd
5
+ # puts Dir.pwd
6
+ puts Dir["moip/models/**.rb"]
7
+ end
8
+ end
9
+ end
10
+
11
+
12
+
13
+ require "moip/configuration"
14
+ require "moip/header"
15
+ require "moip/webhooks"
16
+ require "httparty"
17
+
18
+ # require all models
19
+ Dir["#{Dir.pwd}/lib/moip/models/**"].each { |file| require file }
@@ -0,0 +1,25 @@
1
+ module Moip
2
+ # Configures global settings for Moip
3
+ # Moip.configure do |config|
4
+ # config.token = "secret"
5
+ # config.key = "secret"
6
+ # end
7
+ def self.configure(&block)
8
+ yield @config ||= Moip::Configuration.new
9
+ end
10
+
11
+ # Global settings for Moip
12
+ def self.config
13
+ @config
14
+ end
15
+
16
+ class Configuration
17
+ attr_accessor :token, :acount_key
18
+
19
+ def initialize
20
+ self.token = ""
21
+ self.acount_key = ""
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,23 @@
1
+ module Moip
2
+ module Header
3
+ def default_header body = nil
4
+ header = {}
5
+ header.merge! :basic_auth => auth
6
+ header.merge! :headers => { 'Content-Type' => 'application/json', 'Accept' => 'application/json' }
7
+ header.merge! :body => body.to_json if body
8
+
9
+ header
10
+ end
11
+
12
+ def auth
13
+ @auth ||= {:username => Moip.config.token, :password => Moip.config.acount_key}
14
+ end
15
+
16
+ def base_url model, options = {}
17
+ url = "https://sandbox.moip.com.br/assinaturas/v1/#{model.to_s}"
18
+ url << "/#{options[:code]}" if options[:code]
19
+ url << "/#{options[:status]}" if options[:status]
20
+ url
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ class Moip::Costumer
2
+ include HTTParty
3
+ include Moip::Header
4
+
5
+ def list
6
+ self.class.get(base_url(:costumers), default_header).parsed_response
7
+ end
8
+
9
+ def create
10
+ # todo: the create
11
+ end
12
+
13
+ def find
14
+ # todo: the find
15
+ end
16
+
17
+ def delete
18
+ # todo: the delete
19
+ end
20
+
21
+ end
@@ -0,0 +1,21 @@
1
+ class Moip::Invoice
2
+ include HTTParty
3
+ include Moip::Header
4
+
5
+ def list
6
+ self.class.get(base_url(:invoices), default_header).parsed_response
7
+ end
8
+
9
+ def create
10
+ # todo: the create
11
+ end
12
+
13
+ def find
14
+ # todo: the find
15
+ end
16
+
17
+ def delete
18
+ # todo: the delete
19
+ end
20
+
21
+ end
@@ -0,0 +1,21 @@
1
+ class Moip::Payment
2
+ include HTTParty
3
+ include Moip::Header
4
+
5
+ def list
6
+ self.class.get(base_url(:payments), default_header).parsed_response
7
+ end
8
+
9
+ def create
10
+ # todo: the create
11
+ end
12
+
13
+ def find
14
+ # todo: the find
15
+ end
16
+
17
+ def delete
18
+ # todo: the delete
19
+ end
20
+
21
+ end
@@ -0,0 +1,21 @@
1
+ class Moip::Plan
2
+ include HTTParty
3
+ include Moip::Header
4
+
5
+ def list
6
+ self.class.get(base_url(:plans), default_header).parsed_response
7
+ end
8
+
9
+ def create
10
+ # todo: the create
11
+ end
12
+
13
+ def find
14
+ # todo: the find
15
+ end
16
+
17
+ def delete
18
+ # todo: the delete
19
+ end
20
+
21
+ end
@@ -0,0 +1,21 @@
1
+ class Moip::Subscription
2
+ include HTTParty
3
+ include Moip::Header
4
+
5
+ def list
6
+ self.class.get(base_url(:subscriptions), default_header).parsed_response
7
+ end
8
+
9
+ def create
10
+ # todo: the create
11
+ end
12
+
13
+ def find
14
+ # todo: the find
15
+ end
16
+
17
+ def delete
18
+ # todo: the delete
19
+ end
20
+
21
+ end
@@ -0,0 +1,4 @@
1
+ module Moip
2
+ module Webhooks
3
+ end
4
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: api-moip-assinaturas
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Douglas Rossignolli
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.11.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.11.0
27
+ description: Gem desenvolvida para atender aos requisitos do moip api de assinaturas
28
+ email: douglas@pixxel.net.br
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/moip/configuration.rb
34
+ - lib/moip/header.rb
35
+ - lib/moip/models/costumer.rb
36
+ - lib/moip/models/invoice.rb
37
+ - lib/moip/models/payment.rb
38
+ - lib/moip/models/plan.rb
39
+ - lib/moip/models/subscription.rb
40
+ - lib/moip/webhooks.rb
41
+ - lib/moip.rb
42
+ - api_moip_assinaturas.gemspec
43
+ homepage: http://pixxel.net.br
44
+ licenses: []
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 1.9.3
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: 1.8.11
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.0.3
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Moip Assinaturas by Pixxel
66
+ test_files: []
67
+ has_rdoc: