{"id":20779133,"url":"https://github.com/solidusio/solidus_bolt","last_synced_at":"2025-10-11T16:01:45.193Z","repository":{"id":36959628,"uuid":"475611314","full_name":"solidusio/solidus_bolt","owner":"solidusio","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-05T10:09:40.000Z","size":415,"stargazers_count":1,"open_issues_count":17,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-03-25T21:23:45.756Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solidusio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"open_collective":"solidus"}},"created_at":"2022-03-29T20:35:44.000Z","updated_at":"2023-11-29T20:56:33.000Z","dependencies_parsed_at":"2022-06-30T20:27:52.985Z","dependency_job_id":"b5eee95d-b313-405b-b6ae-753a532d0238","html_url":"https://github.com/solidusio/solidus_bolt","commit_stats":null,"previous_names":["nebulab/solidus_bolt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio%2Fsolidus_bolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio%2Fsolidus_bolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio%2Fsolidus_bolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio%2Fsolidus_bolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solidusio","download_url":"https://codeload.github.com/solidusio/solidus_bolt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243119537,"owners_count":20239321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hacktoberfest"],"created_at":"2024-11-17T13:26:12.403Z","updated_at":"2025-10-11T16:01:45.139Z","avatar_url":"https://github.com/solidusio.png","language":"Ruby","funding_links":["https://opencollective.com/solidus"],"categories":[],"sub_categories":[],"readme":"# Solidus Bolt\n\n[![CircleCI](https://circleci.com/gh/solidusio/solidus_bolt.svg?style=shield)](https://circleci.com/gh/solidusio-contrib/solidus_bolt)\n[![codecov](https://codecov.io/gh/solidusio/solidus_bolt/branch/main/graph/badge.svg)](https://codecov.io/gh/solidusio-contrib/solidus_bolt)\n\n\u003c!-- Explain what your extension does. --\u003e\n\n## Installation\n\nAdd solidus_bolt to your Gemfile:\n\n```ruby\ngem 'solidus_bolt'\n```\n\nBundle your dependencies and run the installation generator (before running the following command, we recommend setting up the environment variables and seeds as described in the sections below):\n\n```shell\nbin/rails generate solidus_bolt:install\n```\n\n## Usage\n\n### Setting up Bolt Configuration\n\nMany of the API calls handled by this gem use the variables set in Bolt Configuration. Since this extension's seeds automatically generate a Bolt Configuration, the easiest and safest way to configure it would be by setting the following environment variables:\n\n```\nBOLT_ENVIRONMENT\nBOLT_API_KEY\nBOLT_SIGNING_SECRET\nBOLT_PUBLISHABLE_KEY\n```\n\nAlternatively you can setup the Bolt Configuration manually by visiting `/admin/bolt`\n\n### Using solidus_bolt Seeds\n\nProvided you setup the environment variables, you can simplify the setup of a Bolt application by running the [gem's seeds](https://github.com/solidusio/solidus_bolt/blob/main/db/seeds.rb). This will automatically create the following:\n\n- BoltConfiguration\n- AuthenticationMethod\n- PaymentMethod\n\nYou can run solidus_bolt's seeds either by running\n```shell\nbin/rails db:seed:solidus_bolt\n```\nor by adding the following line to your seed file:\n```ruby\nSolidusBolt::Engine.load_seed if defined?(SolidusBolt)\n```\n\n### Creating a new Payment Method\n\nAssuming you've used environment variables to configure your Bolt Configuration, creating a Bolt payment method is very easy:\n\n1. Visit `/admin/payment_methods/new`\n2. Set `provider` to SolidusBolt::PaymentMethod\n3. Click \"Save\"\n4. Choose `bolt_credentials` from the `Preference Source` select\n5. Click `Update` to save\n\nIf you've instead decided to setup the Bolt Configuration manually, follow the same process mentioned above but at step 4 pick `bolt_config_credentials` instead of `bolt_credentials`.\n\nIn both cases you can alternatively create a payment method from the Rails console with:\n\n```ruby\nSolidusBolt::PaymentMethod.create(\n  name: \"Bolt\",\n  preference_source: \"bolt_credentials\" # or \"bolt_config_credentials\"\n)\n```\n\nThe final (not recommended) option is to not select any `Preference Source` at step 4 and instead fill up the inputs manually.\n\n### How to set the webhooks\n\n(For latest up to date guide check [Bolt's Documentation](https://help.bolt.com/developers/guides/webhooks/))\n\n1. Login to your [Bolt Merchant Dashboard](https://merchant.bolt.com/).\n\n2. Navigate to **Developers**.\n\n3. Scroll to **Merchant API**.\n\n4. Add your webhook endpoints (by default it's your store's url plus `/webhooks/bolt`)\n\nImportant use cases include:\n\n- Notifying your e-commerce store when a transaction has been approved or rejected by Bolt.\n- Sending your e-commerce store with the `transaction_id`, which is necessary for back-office operations.\n- Sending your e-commerce store more information about a transaction such as credit card details.\n\n## Development\n\n### Testing the extension\n\nFirst bundle your dependencies, then run `bin/rake`. `bin/rake` will default to building the dummy\napp if it does not exist, then it will run specs. The dummy app can be regenerated by using\n`bin/rake extension:test_app`.\n\n```shell\nbin/rake\n```\n\nTo run [Rubocop](https://github.com/bbatsov/rubocop) static code analysis run\n\n```shell\nbundle exec rubocop\n```\n\nWhen testing your application's integration with this extension you may use its factories.\nSimply add this require statement to your `spec/spec_helper.rb`:\n\n```ruby\nrequire 'solidus_bolt/testing_support/factories'\n```\n\nOr, if you are using `FactoryBot.definition_file_paths`, you can load Solidus core\nfactories along with this extension's factories using this statement:\n\n```ruby\nSolidusDevSupport::TestingSupport::Factories.load_for(SolidusBolt::Engine)\n```\n\n#### Special Tests\n\nA few tests in the test suite require some additional steps to execute successfully when they are modified. These are listed below along with the steps needed to execute these tests.\n\n- `/spec/services/solidus_bolt/accounts/detail_service_spec.rb`\nThis test requires a valid `bolt_access_token` to execute successfully when modified.\nFollow the steps below to get a `bolt_access_token`.\n  1. Login as a User using a Bolt Account.\n  2. Put a `binding.pry` on any view.\n  3. Print `session['bolt_access_token']` in the pry console.\n  4. Copy the result and set the value of the environment variable `BOLT_ACCESS_TOKEN` to this result.\n\n### Running the sandbox\n\nTo run this extension in a sandboxed Solidus application, you can run `bin/sandbox`. The path for\nthe sandbox app is `./sandbox` and `bin/rails` will forward any Rails commands to\n`sandbox/bin/rails`.\n\nHere's an example:\n\n```\n$ bin/rails server\n=\u003e Booting Puma\n=\u003e Rails 6.0.2.1 application starting in development\n* Listening on tcp://127.0.0.1:3000\nUse Ctrl-C to stop\n```\n\n### Updating the changelog\n\nBefore and after releases the changelog should be updated to reflect the up-to-date status of\nthe project:\n\n```shell\nbin/rake changelog\ngit add CHANGELOG.md\ngit commit -m \"Update the changelog\"\n```\n\n### Releasing new versions\n\nPlease refer to the dedicated [page](https://github.com/solidusio/solidus/wiki/How-to-release-extensions) on Solidus wiki.\n\n## License\n\nCopyright (c) 2022 [name of extension author], released under the New BSD License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidusio%2Fsolidus_bolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidusio%2Fsolidus_bolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidusio%2Fsolidus_bolt/lists"}