{"id":15603160,"url":"https://github.com/wedsonlima/rvindi","last_synced_at":"2026-04-24T19:31:54.166Z","repository":{"id":56893942,"uuid":"371817370","full_name":"wedsonlima/rvindi","owner":"wedsonlima","description":"ActiveRecord-like way to interact with Vindi API","archived":false,"fork":false,"pushed_at":"2021-12-04T20:40:42.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-16T20:16:48.590Z","etag":null,"topics":["api","brazil","payments","vindi"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/rvindi","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wedsonlima.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-28T21:00:38.000Z","updated_at":"2021-12-04T20:46:46.000Z","dependencies_parsed_at":"2022-08-20T17:40:31.199Z","dependency_job_id":null,"html_url":"https://github.com/wedsonlima/rvindi","commit_stats":null,"previous_names":["wedsonlima/vindi-ruby"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wedsonlima/rvindi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wedsonlima%2Frvindi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wedsonlima%2Frvindi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wedsonlima%2Frvindi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wedsonlima%2Frvindi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wedsonlima","download_url":"https://codeload.github.com/wedsonlima/rvindi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wedsonlima%2Frvindi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32238305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","brazil","payments","vindi"],"created_at":"2024-10-03T03:01:49.969Z","updated_at":"2026-04-24T19:31:54.150Z","avatar_url":"https://github.com/wedsonlima.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vindi Ruby\n\nActiveRecord-like way to interact with Vindi API\n\n## Vindi\n\n[Vindi](https://vindi.com.br) is a brazilian fintech, that was recently acquired by [Locaweb](https://blog.vindi.com.br/agora-a-vindi-faz-parte-do-grupo-locaweb), that helps other companies to work with **recurring payments**.\n\n### API docs\n\n  * [Swagger sandbox](https://vindi.github.io/api-docs/dist/?url=https://sandbox-app.vindi.com.br/api/v1/docs#/)\n  * [Swagger prod](https://vindi.github.io/api-docs/dist)\n  *\n    [Vindi - Official Gem](https://github.com/vindi/vindi-ruby)\n\n    \u003e You may ask: Why create another gem if there is already one that's official?\n    \u003e *And I'll tell you, **little grasshopper**: Because MIT licenses are better than GPLv3.*\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"rvindi\"\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install rvindi\n\n## Usage\n\n### Config\n\n```ruby\n# config/initializers/vindi.rb\nVindi.configure do |c|\n  c.sandbox = true # default is false\n  c.api_key = \"YOUR API KEY\"\n  c.webhook_secret_name = \"BASIC AUTH NAME\"\n  c.webhook_secret_password = \"BASIC AUTH PASSWORD\"\nend\n```\n\n### Examples\n\n#### Saruman creates a subscription business to rent his Palantir\n\n```ruby\n# Let's say that Gandalf wants to borrow Saruman's Palantir\n# promising he'll give it back before the end of the 3rd era.\n#\n# But Saruman is wise and he thinks he could make a good money\n# charging a rent for the use of the magic ball.\n#\n# So, Saruman went on to Vindi and creates a product...\n#\npalantir = Vindi::Product.new.tap do |p|\n  p.code = \"palantir\"\n  p.name = \"Palantir\"\n  p.description = \"The Twitch of Istari folk\"\n  p.pricing_schema = { price: 42.42 }\n  p.save\nend\n\n# ...then creates a recurring plan.\none_plan = Vindi::Plan.new.tap do |p|\n  p.code = \"the-one-plan\"\n  p.name = \"Monthly Plan\"\n  p.description = \"The One Plan To Rule Them All\"\n  p.period = \"monthly\"\n  p.recurring = true\n  p.plan_items = [\n    {\n      cycles: nil, # untill the end of time\n      product_id: palantir.id\n    }\n  ]\n  p.save\nend\n\n# Gandalf uses his fellow Bilbo's address to receive the invoices...\ngandalf = Vindi::Customer.new.tap do |c|\n  c.code = 1\n  c.name = \"Gandalf the Grey\"\n  c.email = \"mithrandir@middlearth.io\"\n  c.address = {\n    street: \"Bagshot Row\",\n    number: \"Bag End\",\n    neighborhood: \"Hobbiton\",\n    city: \"Shire\"\n  }\n  c.save\nend\n\n# ...uses Elrond's credit card to create a payment profile...\npp = Vindi::PaymentProfile.new.tap do |pp|\n  pp.holder_name = \"Elrond Half-elven\"\n  pp.card_expiration = \"12/3021\"\n  pp.card_number = \"5167454851671773\"\n  pp.card_cvv = \"123\"\n  pp.customer_id = gandalf.id\n  pp.save\nend\n\n# ...subscribes to `the one plan` and then get the palantir.\nsubscription = Vindi::Subscription.new.tap do |s|\n  s.plan_id = one_plan.id\n  s.customer_id = gandalf.id\n  s.payment_method_code = \"credit_card\"\n  s.save\nend\n```\n\n#### After some time he wants to know how the business is going\n\n```ruby\n# Active customers\ncustomers = Vindi::Customer.active\n\n# Active subscriptions\nsubscriptions = Vindi::Subscriptions.active\n\n# Subscriptions for the-one-plan\nsubscriptions = Vindi::Plan.find_by(code: \"the-one-plan\").subscriptions\n\n# Filter Gandalf\ngandalf = Vindi::Customer.find_by(email: \"mithrandir@middlearth.io\")\n\n# All Gandalf's subscriptions\nsubscriptions = gandalf.subscriptions.active\n\n# Cancel Gandalf's subscription\ngandalf.subscriptions.active.last.cancel!\n\n# Refund the last Gandalf's payment\ngandalf.charges.last.refund!\n```\n\n## Webhooks\n\nYou must validate incoming data from Vindi.\n  * [Vindi Blog Post](https://atendimento.vindi.com.br/hc/pt-br/articles/203305800)\n\nYou can validate webhook calls using baisc auth.\nJust configure a webhook call with something like this `https://NAME:PASSWORD@www.startupmassa.com/vindi/webhook`.\n\nOn Vindi admin dashboard\n\n```bash\nhttps://vindi:123456@www.startupmassa.com/vindi/webhook\n```\n\nOn your project\n\n```ruby\n# config/initializers/vindi.rb\nVindi.configure do |config|\n  config.api_key = \"123456\"\n  config.webhook_secret_name = \"vindi\"\n  config.webhook_secret_password = \"123456\"\nend\n\n# routes.rb\nnamespace :vindi do\n  post :webhook, to: \"webhook#listener\"\nend\n\n# vindi/webhook_controller.rb\nclass Vindi::Webhook \u003c ActionController::Base\n  http_basic_authenticate_with name: Vindi.webhook_secret_name, password: Vindi.webhook_secret_password\n\n  # POST https://usuario:senha@www.startupmassa.com/vindi/webhook\n  def listener\n    case event_params[:type]\n    when \"charge_rejected\" # defaulting user?\n    when \"bill_paid\" # do the magic\n    else\n      head :ok\n    end\n  end\n\n  private\n\n    def event_params\n      params.require(:event).permit!\n    end\nend\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/wedsonlima/vindi-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/wedsonlima/vindi-ruby/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Vindi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/wedsonlima/vindi-ruby/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwedsonlima%2Frvindi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwedsonlima%2Frvindi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwedsonlima%2Frvindi/lists"}