iugu 1.0.0 → 1.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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGM3Mjc3MTEwMTE2OWFlNmI0MWM5ZmU3NDY0Yzg3NGE5ODIyZmU2YQ==
4
+ M2U2ZGUzMzgwOTA5ZTdmZjIwMGU3YTljYjIzMjMzMzJkYTFmYmViYQ==
5
5
  data.tar.gz: !binary |-
6
- ZGIyMzk0OTI3NGM1NjFhYmFlYTcxNDFkMjY2NGUwNTMwN2E0MWUyMA==
6
+ M2U2Zjc0MjFkNWExZDU2NjlkMjA1Y2UzMjhmOTRjMWNlOGM0ZTQ4Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmJhZGI5ZjU0NDgzODlkZWEzY2QwODcyZjYxMTgzZmQ3YTkyZmYyZjlkZjRl
10
- YmRmNGZiMzkyOGJlMDZkMDhjNTYyYTI0NzIzOTk3ZDdmNzEzOGU4OTgwM2M3
11
- ZTE1NjY2ZWY4NDY3MDYxNDJkNzg4ZTIyM2M4YjBmMWJhMzQxMTQ=
9
+ ZTU1ZGNiNDk0NTg0OTI0NDk2ZjU2MzgxYjY2YmYyMzYxMDNiNDgzNTMzOGRj
10
+ ODMwNTVlNTUyOTQ3ZDBkYzBlNWVjNWZkNzg4MWEyNzU1NjVlM2QxYWI3ZTFi
11
+ NWNmNjJkNWJmMzdiODRmODI4YjczOWNhMzYzOTRlMTE1OTNjY2E=
12
12
  data.tar.gz: !binary |-
13
- MzczY2U4OWI4MTIyNDAzZDhkODc5NzA5NTVhNWRlYTI4ZjY2MjUzYjM5ZDc4
14
- M2UyN2ExMzM5OTgzM2FkNzI5OTAzMjUxMzg4MWRlMTJmYjE3MjM0NzFlYjIx
15
- OGRjNDJiNTVjZDk5ZjU3YmU1NzBiMGZkN2RlNzU3YzNkMjk3ZjM=
13
+ MjdhMGM4ZWU4NWI2NTFhMzI3ZWJkZjExMDRlZjJkNWQ1OGFjZTM0MzAwNjcy
14
+ YTY3ZDZlNDFiMWM0Y2JkNDY3ZTNlZGE5MzgwNmRhNDNhM2VlOTJhZGYzZjhm
15
+ OWQwNzkwODQxOTJhNDg1NzczNTA3OTQ1MjkyODNiZmZlNGViMjA=
data/README.md CHANGED
@@ -1,29 +1,57 @@
1
- # Iugu::Ruby
1
+ # Iugu
2
2
 
3
- TODO: Write a gem description
3
+ Gem para acesso a API da Iugu
4
4
 
5
- ## Installation
5
+ ## Instalação
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Adicione essa linha ao Gemfile de sua aplicação:
8
8
 
9
- gem 'iugu-ruby'
9
+ gem 'iugu'
10
10
 
11
- And then execute:
11
+ Depois execute:
12
12
 
13
13
  $ bundle
14
14
 
15
- Or install it yourself as:
16
-
17
- $ gem install iugu-ruby
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
- ## Contributing
24
-
25
- 1. Fork it ( http://github.com/<my-github-username>/iugu-ruby/fork )
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
15
+ Ou instale você mesmo com:
16
+
17
+ $ gem install iugu
18
+
19
+ ## Exemplos de Uso
20
+
21
+ ~~~
22
+ # Configure seu api key
23
+ Iugu.api_key = SEU_TOKEN_DE_API
24
+
25
+ # Exemplo de cobrança direta de CC em Ruby
26
+ Iugu::Charge.create(
27
+ {
28
+ "token"=> "TOKEN DO IUGU.JS ou LIB",
29
+ "email"=>"endereço do email do cliente",
30
+ "months"=>"quantidade de parcelas",
31
+ "items" =>
32
+ [
33
+ {
34
+ "description"=>"Item Teste",
35
+ "quantity"=>"1",
36
+ "price_cents"=>"1000"
37
+ }
38
+ ]
39
+ }
40
+ )
41
+
42
+ # Exemplo de Gestão de Assinaturas em meia dúzia de linhas. Com direito a pagamento recorrente via Cartão ou Boleto. No caso de Cartão, recomenda-se vincular um token ao customer (Default Payment Method).
43
+ customer = Iugu::Customer.create({
44
+ "email"=>"EMAIL DO CLIENTE",
45
+ "name"=>"NOME DO CLIENTE"
46
+ })
47
+
48
+ subscription = Iugu::Subscription.create({
49
+ "plan_identifier" => "basic_plan", "customer_id" => customer.id
50
+ })
51
+
52
+ # Exemplo de Downgrade/Upgrade de Conta (Com cálculo automático de diferença de valores entre planos, créditos, etc)
53
+ subscription.change_plan( "novo_plano" );
54
+
55
+ # Histórico de Pagamentos do Cliente
56
+ customer.invoices
57
+ ~~~
@@ -31,7 +31,8 @@ module Iugu
31
31
  headers: default_headers,
32
32
  method: method,
33
33
  payload: data.to_json,
34
- url: url
34
+ url: url,
35
+ timeout: 30
35
36
  }
36
37
  end
37
38
 
data/lib/iugu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Iugu
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iugu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Paez Sequeira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-16 00:00:00.000000000 Z
11
+ date: 2014-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client