act_as_api_client 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 585bfe652e889c7eaebcd2dfefd0a0c295ae87a390f9522de24fc2126e9011b3
4
- data.tar.gz: 5d61e33b3f9702b1bbcc2bac97913278dcbcfc6e7db780e0ea4b1a1efdfb14cb
3
+ metadata.gz: 2879b607f0a39fdba8f0b5c92097320aacafd5e98a23e8082f051e9b95340765
4
+ data.tar.gz: c694503be26586f6c184f64b1df4084d261c1dae82aede31951fe7aa023d2c10
5
5
  SHA512:
6
- metadata.gz: e2cc7b10a33b1d6955b6aad98709aa58ddba78e38e7804ab6f8b4b8be49ce4ac4b93077cdfa0a9f81e6ea5501784ce02d0ff278228affb4a33a23d71ed52adbe
7
- data.tar.gz: c3926de463c5fef33ce98c7158165cffe8fb19d5eef4a94b72fc14fbc51b9a0966134845d899a23310e26b786326a1fe9ee1f058390f7c19809efefa43f7b822
6
+ metadata.gz: 8d94a6752470991a895526ed0a371e34c44a5db3cc7c1f6d9a81a3e38c4d1ba7a3b39ab0a2406277aa407037744b60f2bbe0408197eaf6cccd625b9f80ef767d
7
+ data.tar.gz: fc1abaa4b3ae8541dd3a67de89d0a74035ebc8d909aab2d1d48f1d2d34b609bd8406aa28a5a864eff3402aa5a922abcfecf6169b022c9408d6eebc8620d9b65d
@@ -0,0 +1,11 @@
1
+ {
2
+ "dockerComposeFile": "./docker-compose.yml",
3
+ "service": "app",
4
+ "customizations": {
5
+ "vscode": {
6
+ "extensions": [
7
+ "ms-azuretools.vscode-docker"
8
+ ]
9
+ }
10
+ }
11
+ }
@@ -9,9 +9,9 @@ name: Ruby
9
9
 
10
10
  on:
11
11
  push:
12
- branches: [ main ]
12
+ branches: [main]
13
13
  pull_request:
14
- branches: [ main ]
14
+ branches: [main]
15
15
 
16
16
  permissions:
17
17
  contents: read
@@ -21,7 +21,7 @@ jobs:
21
21
  runs-on: ubuntu-latest
22
22
  strategy:
23
23
  matrix:
24
- ruby-version: ['3.0']
24
+ ruby-version: ["3.0"]
25
25
  steps:
26
26
  - uses: actions/checkout@v3
27
27
  - name: Set up Ruby
@@ -35,15 +35,16 @@ jobs:
35
35
  runs-on: ubuntu-latest
36
36
  strategy:
37
37
  matrix:
38
- ruby-version: ['2.6', '2.7', '3.0']
38
+ os: [ubuntu-latest, macos-latest]
39
+ ruby-version: ["2.6", "2.7", "3.0", "3.1", "3.2"]
39
40
  steps:
40
41
  - uses: actions/checkout@v3
41
42
  - name: Set up Ruby
42
- uses: ruby/setup-ruby@2b019609e2b0f1ea1a2bc8ca11cb82ab46ada124
43
+ uses: ruby/setup-ruby@v1
43
44
  with:
44
45
  ruby-version: ${{ matrix.ruby-version }}
45
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
46
+ bundler-cache: true
46
47
  - name: Copy credentials file for CI
47
48
  run: mv spec/credentials.example.yml spec/credentials.yml
48
49
  - name: Run tests
49
- run: bundle exec rspec
50
+ run: bundle exec rspec
data/.rubocop.yml CHANGED
@@ -16,7 +16,7 @@ Layout/LineLength:
16
16
 
17
17
  AllCops:
18
18
  NewCops: enable
19
- TargetRubyVersion: 2.4
19
+ TargetRubyVersion: 2.6
20
20
 
21
21
  Style/Documentation:
22
- Enabled: false
22
+ Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -10,61 +10,64 @@
10
10
  # Configuration parameters: IgnoredMethods, Max.
11
11
  Metrics/AbcSize:
12
12
  Exclude:
13
- - 'lib/act_as_api_client/clients/github_client.rb'
13
+ - "lib/act_as_api_client/clients/github_repositories_client.rb"
14
14
 
15
15
  # Offense count: 5
16
16
  # Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods.
17
17
  # ExcludedMethods: refine
18
18
  Metrics/BlockLength:
19
19
  Exclude:
20
- - '**/*.gemspec'
21
- - 'spec/act_as_api_client/clients/authorize_net/authorize_net_notifications_client_spec.rb'
22
- - 'spec/act_as_api_client/clients/github_client/find_by_spec.rb'
23
- - 'spec/act_as_api_client/clients/github_client/find_spec.rb'
24
- - 'spec/act_as_api_client/clients/github_client/where_spec.rb'
20
+ - "**/*.gemspec"
21
+ - "spec/act_as_api_client/clients/authorize_net/authorize_net_notifications_client_spec.rb"
22
+ - "spec/act_as_api_client/clients/github_client/find_by_spec.rb"
23
+ - "spec/act_as_api_client/clients/github_client/find_spec.rb"
24
+ - "spec/act_as_api_client/clients/github_client/where_spec.rb"
25
25
 
26
26
  # Offense count: 1
27
27
  # Configuration parameters: IgnoredMethods, Max.
28
28
  Metrics/CyclomaticComplexity:
29
29
  Exclude:
30
- - 'lib/act_as_api_client/clients/github_client.rb'
30
+ - "lib/act_as_api_client/clients/github_repositories_client.rb"
31
31
 
32
32
  # Offense count: 2
33
33
  # Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods.
34
34
  Metrics/MethodLength:
35
35
  Exclude:
36
- - 'lib/act_as_api_client/clients/github_client.rb'
37
- - 'lib/act_as_api_client/clients/http_client.rb'
36
+ - "lib/act_as_api_client/clients/github_repositories_client.rb"
37
+ - "lib/act_as_api_client/clients/http_client.rb"
38
38
 
39
39
  # Offense count: 2
40
40
  Naming/AccessorMethodName:
41
41
  Exclude:
42
- - 'lib/act_as_api_client.rb'
42
+ - "lib/act_as_api_client.rb"
43
43
 
44
44
  # Offense count: 1
45
45
  # Configuration parameters: Max.
46
46
  RSpec/ExampleLength:
47
47
  Exclude:
48
- - 'spec/act_as_api_client/clients/http_client_spec.rb'
48
+ - "spec/act_as_api_client/clients/http_client_spec.rb"
49
49
 
50
50
  # Offense count: 2
51
51
  # Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
52
52
  RSpec/FilePath:
53
53
  Exclude:
54
- - 'spec/act_as_api_client/clients/authorize_net/authorize_net_notifications_client_spec.rb'
55
- - 'spec/act_as_api_client/clients/authorize_net/authorize_net_webhooks_client_spec.rb'
54
+ - "spec/act_as_api_client/clients/authorize_net/authorize_net_notifications_client_spec.rb"
55
+ - "spec/act_as_api_client/clients/authorize_net/authorize_net_webhooks_client_spec.rb"
56
+ - "spec/act_as_api_client/clients/github_client/find_by_spec.rb"
57
+ - "spec/act_as_api_client/clients/github_client/find_spec.rb"
58
+ - "spec/act_as_api_client/clients/github_client/where_spec.rb"
56
59
 
57
60
  # Offense count: 3
58
61
  # Configuration parameters: Max.
59
62
  RSpec/NestedGroups:
60
63
  Exclude:
61
- - 'spec/act_as_api_client/clients/github_client/find_by_spec.rb'
64
+ - "spec/act_as_api_client/clients/github_client/find_by_spec.rb"
62
65
 
63
66
  # Offense count: 1
64
67
  # Configuration parameters: MinBodyLength.
65
68
  Style/GuardClause:
66
69
  Exclude:
67
- - 'lib/act_as_api_client/clients/authorize_net_webhooks_client.rb'
70
+ - "lib/act_as_api_client/clients/authorize_net_webhooks_client.rb"
68
71
 
69
72
  # Offense count: 4
70
73
  # Cop supports --auto-correct.
@@ -72,5 +75,5 @@ Style/GuardClause:
72
75
  # URISchemes: http, https
73
76
  Layout/LineLength:
74
77
  Exclude:
75
- - 'lib/act_as_api_client/clients/github_client.rb'
76
- - 'spec/support/vcr_setup.rb'
78
+ - "lib/act_as_api_client/clients/github_repositories_client.rb"
79
+ - "spec/support/vcr_setup.rb"
data/Dockerfile ADDED
@@ -0,0 +1,3 @@
1
+ FROM ruby:2.6-bullseye
2
+ COPY Gemfile Gemfile.lock act_as_api_client.gemspec .
3
+ RUN bundle install
data/Gemfile CHANGED
@@ -4,11 +4,3 @@ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in act_as_api_client.gemspec
6
6
  gemspec
7
-
8
- gem "byebug", "~> 11.1"
9
- gem "rake", "~> 13.0"
10
- gem "rspec", "~> 3.0"
11
- gem "rubocop", "~> 0.80"
12
- gem "rubocop-rspec", require: false
13
- gem "vcr", "~> 6.1"
14
- gem "webmock", "~> 3.14"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- act_as_api_client (0.2.0)
4
+ act_as_api_client (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -71,4 +71,4 @@ DEPENDENCIES
71
71
  webmock (~> 3.14)
72
72
 
73
73
  BUNDLED WITH
74
- 2.2.3
74
+ 1.17.2
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # act_as_api_client
2
2
 
3
- How to create api clients for your application? What is a better way to encapsualte interactions with third APIs? My answer is `act_as_api_client`.
3
+ How to create api clients for your application? What is a better way to encapsualte interactions with third party APIs? My answer is `act_as_api_client`.
4
4
 
5
5
  Let's assume you have a typical Rails or any ruby application and want to play around with an API, Github for example. See the [Usage](https://github.com/Rukomoynikov/act_as_api_client#usage) section to find how to use existing preconfigured API's and encapsulate all logic inside `APIClient` classes.
6
6
 
7
- _At the moment i experiment in order to make api clients behavior very similiar to `ActiveRecord` models, so out of the box most of the clients support these methods: find, where, delete, update, find_by, create, update_
8
-
9
7
  ## Installation
10
8
 
11
9
  Add this line to your application's Gemfile:
@@ -25,14 +23,14 @@ Or install it yourself as:
25
23
  ## Usage
26
24
 
27
25
  ### Folder for clients:
28
- Create a folder in your app for examples `api_clients` inside your `lib` directory. This will be the place where you will keep all... api clients.
26
+ Create a folder in your app for examples `api_clients`. This will be the place where you will keep all servies responsible for communication with external HTTP APIs.
29
27
 
30
28
  ### Create API client class:
31
- For example you want to fetch and update Github repositoties, then you class may have a form like this:
29
+ For example, you need to fetch and update Github repositories, then you class may have a form like this:
32
30
 
33
31
  ```ruby
34
32
  class GithubClient < ApiClient
35
- act_as_api_client for: :github
33
+ act_as_api_client for: :github_repositories
36
34
  end
37
35
  ```
38
36
 
@@ -40,9 +38,9 @@ In case you want to provide and use authorization token for Github:
40
38
 
41
39
  ```ruby
42
40
  class GithubClient < ApiClient
43
- act_as_api_client for: :github,
41
+ act_as_api_client for: :github_repositories,
44
42
  with: {
45
- token: <your_token>
43
+ token: <your_token> # ENV variable of secret
46
44
  }
47
45
  end
48
46
  ```
@@ -1,10 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/act_as_api_client/version"
4
-
5
3
  Gem::Specification.new do |spec|
6
4
  spec.name = "act_as_api_client"
7
- spec.version = ActAsApiClient::VERSION
5
+ spec.version = "1.0.0"
8
6
  spec.authors = ["Max Rukomoynikov"]
9
7
  spec.email = ["rukomoynikov@gmail.com"]
10
8
 
@@ -12,7 +10,7 @@ Gem::Specification.new do |spec|
12
10
  spec.description = "Helps you to build reliable API clients in a minute. Just add act_as_api_client to your classes"
13
11
  spec.homepage = "https://rubygems.org/gems/act_as_api_client"
14
12
  spec.license = "MIT"
15
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
16
14
 
17
15
  spec.metadata = {
18
16
  "source_code_uri" => "https://github.com/Rukomoynikov/act_as_api_client",
@@ -29,6 +27,13 @@ Gem::Specification.new do |spec|
29
27
  spec.require_paths = ["lib"]
30
28
 
31
29
  # Uncomment to register a new dependency of your gem
30
+ spec.add_development_dependency "byebug", "~> 11.1"
31
+ spec.add_development_dependency "rake", "~> 13.0"
32
+ spec.add_development_dependency "rspec", "~> 3.0"
33
+ spec.add_development_dependency "rubocop", "~> 0.80"
34
+ spec.add_development_dependency "rubocop-rspec"
35
+ spec.add_development_dependency "vcr", "~> 6.1"
36
+ spec.add_development_dependency "webmock", "~> 3.14"
32
37
 
33
38
  # For more information and examples about making a new gem, checkout our
34
39
  # guide at: https://bundler.io/guides/creating_gem.html
data/demo.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require_relative "lib/act_as_api_client"
4
4
 
5
5
  class GithubClient < ApiClient
6
- act_as_api_client for: :github
6
+ act_as_api_client for: :github_repositories
7
7
  end
8
8
 
9
9
  p GithubClient.ancestors
@@ -0,0 +1,9 @@
1
+ services:
2
+ app:
3
+ build:
4
+ dockerfile: Dockerfile
5
+ working_dir: /app
6
+ volumes:
7
+ - ./:/app
8
+ tty: true
9
+ stdin_open: true
@@ -4,7 +4,7 @@ require_relative "http_client"
4
4
 
5
5
  module ActAsApiClient
6
6
  module Clients
7
- module GithubClient
7
+ module GithubRepositoriesClient
8
8
  include HttpClient
9
9
 
10
10
  # Searches Github for one repository by it's owner and repository names.
@@ -30,7 +30,7 @@ module ActAsApiClient
30
30
  #
31
31
  # @example Reverse a string
32
32
  # class GithubClient < ApiClient
33
- # act_as_api_client for: :github
33
+ # act_as_api_client for: :github_repositories
34
34
  # end
35
35
  #
36
36
  # GithubClient.new.where('rails')
@@ -50,7 +50,7 @@ module ActAsApiClient
50
50
  #
51
51
  # @example Reverse a string
52
52
  # class GithubClient < ApiClient
53
- # act_as_api_client for: :github
53
+ # act_as_api_client for: :github_repositories
54
54
  # end
55
55
  #
56
56
  # GithubClient.new.find_by(organization: 'rails')
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "act_as_api_client/version"
4
3
  require_relative "act_as_api_client/base_api_methods"
5
4
 
6
5
  class ApiClient
metadata CHANGED
@@ -1,15 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: act_as_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Rukomoynikov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-29 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: byebug
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '11.1'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '11.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.80'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.80'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: vcr
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '6.1'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '6.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: webmock
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.14'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.14'
13
111
  description: Helps you to build reliable API clients in a minute. Just add act_as_api_client
14
112
  to your classes
15
113
  email:
@@ -18,12 +116,14 @@ executables: []
18
116
  extensions: []
19
117
  extra_rdoc_files: []
20
118
  files:
119
+ - ".devcontainer.json"
21
120
  - ".github/workflows/main.yml"
22
121
  - ".gitignore"
23
122
  - ".rspec"
24
123
  - ".rubocop.yml"
25
124
  - ".rubocop_todo.yml"
26
125
  - CODE_OF_CONDUCT.md
126
+ - Dockerfile
27
127
  - Gemfile
28
128
  - Gemfile.lock
29
129
  - LICENSE.txt
@@ -33,13 +133,11 @@ files:
33
133
  - bin/console
34
134
  - bin/setup
35
135
  - demo.rb
136
+ - docker-compose.yml
36
137
  - lib/act_as_api_client.rb
37
138
  - lib/act_as_api_client/base_api_methods.rb
38
- - lib/act_as_api_client/clients/authorize_net_notifications_client.rb
39
- - lib/act_as_api_client/clients/authorize_net_webhooks_client.rb
40
- - lib/act_as_api_client/clients/github_client.rb
139
+ - lib/act_as_api_client/clients/github_repositories_client.rb
41
140
  - lib/act_as_api_client/clients/http_client.rb
42
- - lib/act_as_api_client/version.rb
43
141
  homepage: https://rubygems.org/gems/act_as_api_client
44
142
  licenses:
45
143
  - MIT
@@ -48,7 +146,7 @@ metadata:
48
146
  homepage_uri: https://rubygems.org/gems/act_as_api_client
49
147
  documentation_uri: https://rubydoc.info/github/Rukomoynikov/act_as_api_client/main
50
148
  bug_tracker_uri: https://github.com/Rukomoynikov/act_as_api_client/issues
51
- post_install_message:
149
+ post_install_message:
52
150
  rdoc_options: []
53
151
  require_paths:
54
152
  - lib
@@ -56,15 +154,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
154
  requirements:
57
155
  - - ">="
58
156
  - !ruby/object:Gem::Version
59
- version: 2.4.0
157
+ version: 2.6.0
60
158
  required_rubygems_version: !ruby/object:Gem::Requirement
61
159
  requirements:
62
160
  - - ">="
63
161
  - !ruby/object:Gem::Version
64
162
  version: '0'
65
163
  requirements: []
66
- rubygems_version: 3.2.3
67
- signing_key:
164
+ rubygems_version: 3.0.3.1
165
+ signing_key:
68
166
  specification_version: 4
69
167
  summary: Collection of predefined API clients
70
168
  test_files: []
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "http_client"
4
- require_relative "./authorize_net_webhooks_client"
5
- require "base64"
6
-
7
- module ActAsApiClient
8
- module Clients
9
- module AuthorizeNetNotificationsClient
10
- include AuthorizeNetWebhooksClient
11
-
12
- def where(parameters = {})
13
- # GET https://apitest.authorize.net/rest/v1/notifications?from_date=2017-03-01&to_date=2017-03-13&offset=0&limit=100
14
- # GET https://apitest.authorize.net/rest/v1/notifications?deliveryStatus=Failed
15
- # [:from_date, :to_date, :offset, :limit, :deliveryStatus]
16
-
17
- get("https://#{base_uri}/rest/v1/notifications/",
18
- headers: { "Authorization" => auth },
19
- params: parameters)
20
- end
21
-
22
- def find(uuid)
23
- raise StandardError, "uuid is not provided" if uuid.empty?
24
-
25
- get("https://#{base_uri}/rest/v1/notifications/#{uuid}",
26
- headers: { "Authorization" => auth })
27
- end
28
- end
29
- end
30
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "http_client"
4
- require "base64"
5
-
6
- module ActAsApiClient
7
- module Clients
8
- module AuthorizeNetWebhooksClient
9
- include HttpClient
10
- DEFAULT_OPTIONS = {
11
- mode: :production
12
- }.freeze
13
-
14
- def initialize
15
- @options = DEFAULT_OPTIONS.merge(options)
16
- end
17
-
18
- def find(uuid)
19
- raise StandardError, "uuid is not provided" if uuid.empty?
20
-
21
- get("https://#{base_uri}/rest/v1/webhooks/#{uuid}",
22
- headers: { "Authorization" => auth })
23
- end
24
-
25
- private
26
-
27
- def base_uri
28
- if @options[:mode] == :test
29
- "apitest.authorize.net"
30
- else
31
- "authorize.net"
32
- end
33
- end
34
-
35
- def auth
36
- if options[:payment_user]
37
- "Basic #{Base64.strict_encode64("#{options[:payment_user]}:#{options[:payment_pass]}")}"
38
- end
39
- end
40
- end
41
- end
42
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ActAsApiClient
4
- VERSION = "0.2.0"
5
- end