-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f02031
commit d158943
Showing
3 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,9 @@ provided by [Gerencianet](http://gerencianet.com.br). | |
[](https://codeclimate.com/github/gerencianet/gn-api-sdk-ruby) | ||
|
||
:warning: **Gerencianet API is under BETA version, meaning that it's not available for all users right now. If you're interested, you can always send an email to | ||
[email protected] and we'll enable it for your account** | ||
[email protected] and we'll enable it for your account** | ||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
|
||
|
@@ -27,10 +29,90 @@ Or install it yourself as: | |
$ gem install gerencianet | ||
``` | ||
|
||
## Basic usage | ||
|
||
```ruby | ||
require "gerencianet" | ||
|
||
options = { | ||
client_id: "client_id", | ||
client_secret: "client_secret", | ||
sandbox: true | ||
} | ||
|
||
gerencianet = Gerencianet.new(@options) | ||
|
||
input = { | ||
items: [{ | ||
name: "Product A", | ||
value: 1000, | ||
amount: 2 | ||
}] | ||
} | ||
|
||
response = gerencianet.create_charge(input) | ||
``` | ||
|
||
## Tests | ||
|
||
To run the tests, just run *rspec*: | ||
|
||
```bash | ||
$ rspec | ||
``` | ||
|
||
Or use *guard* to watch files and automatically run *rspec* | ||
|
||
```bash | ||
$ guard -n false -c | ||
``` | ||
|
||
## Additional documentation | ||
|
||
### Charges | ||
|
||
- [Creating charges](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/charges.md) | ||
- [Paying a charge](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/charge-payment.md) | ||
- [Detailing charges](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/charge-detailing.md) | ||
- [Updating informations](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/charge-update.md) | ||
|
||
### Carnets | ||
|
||
- [Creating carnets](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/carnets.md) | ||
- [Detailing carnets](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/carnet-detailing.md) | ||
- [Updating informations](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/carnet-update.md) | ||
|
||
### Subscriptions | ||
|
||
- [Creating subscriptions](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/subscriptions.md) | ||
- [Paying a subscription](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/subscription-payment.md) | ||
- [Detailing subscriptions](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/subscription-detailing.md) | ||
- [Updating informations](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/subscription-update.md) | ||
|
||
### Marketplace | ||
|
||
- [Creating a marketplace](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/charge-with-marketplace.md) | ||
|
||
### Notifications | ||
|
||
- [Getting notifications](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/notifications.md) | ||
|
||
### Payments | ||
|
||
- [Getting installments](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/installments.md) | ||
|
||
### All in one | ||
|
||
- [Usage](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/docs/all-in-one.md) | ||
|
||
## Changelog | ||
|
||
[CHANGELOG](https://github.com/gerencianet/gn-api-sdk-ruby/tree/master/CHANGELOG.md) | ||
|
||
## Contributing | ||
|
||
Bug reports and pull requests are welcome on GitHub at https://github.com/gerencianet/gn-api-sdk-ruby. This project is intended to be a safe, welcoming space for collaboration. | ||
|
||
## License | ||
|
||
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). | ||
The gem is available as open source under the terms of the [MIT License](LICENSE). |