https://github.com/brandaoplaster/paypix
A very simple one that makes external api calls to create a pix.
https://github.com/brandaoplaster/paypix
gem ruby
Last synced: about 1 year ago
JSON representation
A very simple one that makes external api calls to create a pix.
- Host: GitHub
- URL: https://github.com/brandaoplaster/paypix
- Owner: brandaoplaster
- License: mit
- Created: 2023-02-08T21:03:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-13T01:45:21.000Z (over 3 years ago)
- Last Synced: 2025-02-03T23:48:30.998Z (over 1 year ago)
- Topics: gem, ruby
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Paypix
A simple gem for pix creation
## Installation
Install the gem and add to the application's Gemfile by executing:
$ bundle add paypix
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install paypix
## Usage
- Copy **env-example** file to **.env** and inform the token
```
cp env-example .env
source .env
```
- An example hash that can be used for testing.
- An attention to the **pix_account_id** that has to be created on the platform
```
data = {
:payer => {
:document_number => "682.571.466-09",
:name => "Luna"
},
:additional_info => {
:last_name => "Carl"
},
:charge => {
:amount => 10.50,
:pix_account_id => 90,
:expire_at => "2023-12-02T10:03:56-03:00",
:message => "Hello word"
}
}
```
```ruby
pix = Paypix::Pix.new # instance a class
pix.create(data) # Calls the create method which receives a hash
```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/brandaoplaster/paypix.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).