Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce new Bambora::Credentials class #51

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ jobs:
${{ runner.os }}-gem-
- name: Setup ruby
uses: ruby/setup-ruby@v1
- run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Install dependencies
run: bundle install
Comment on lines -21 to +22
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step was failing as you can see here. It was failing to install the correct version of bundler for the given Ruby version.

The https://github.com/ruby/setup-ruby GitHub Action comes with Bundler installed by default, so we don't really need to re-install bundler. This ensures a correct version of bundler is installed, and now the tests and linting pass.

- name: Rubocop checks
run: bundle exec rubocop
6 changes: 2 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Install dependencies
run: bundle install
- name: Run Tests
run: |
bundle exec rake spec
1 change: 1 addition & 0 deletions lib/bambora/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
require 'multiparty' # Multipart/mixed requests

require 'bambora/client/version'
require 'bambora/credentials'

# Adapters
require 'bambora/adapters/response'
Expand Down
12 changes: 12 additions & 0 deletions lib/bambora/credentials.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Bambora
class Credentials
attr_reader :merchant_id, :reporting_passcode

def initialize(options = {})
@merchant_id = options[:merchant_id]
@reporting_passcode = options[:reporting_passcode]
end
end
end
Loading