hydrogen-electron-api 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +86 -0
- data/Rakefile +8 -0
- data/electron_api.gemspec +46 -0
- data/git_push.sh +55 -0
- data/lib/electron_api/api/ach_api.rb +75 -0
- data/lib/electron_api/api/card_api.rb +639 -0
- data/lib/electron_api/api_client.rb +391 -0
- data/lib/electron_api/api_error.rb +38 -0
- data/lib/electron_api/auth_configuration.rb +181 -0
- data/lib/electron_api/configuration.rb +209 -0
- data/lib/electron_api/environment.rb +36 -0
- data/lib/electron_api/models/ach_card_request_co.rb +180 -0
- data/lib/electron_api/models/ach_card_response_vo.rb +216 -0
- data/lib/electron_api/models/base_response_vo.rb +198 -0
- data/lib/electron_api/models/card_base_request_co.rb +200 -0
- data/lib/electron_api/models/card_client_request_co.rb +191 -0
- data/lib/electron_api/models/card_load_request_co.rb +189 -0
- data/lib/electron_api/models/card_load_unload_response_vo.rb +234 -0
- data/lib/electron_api/models/card_replace_response_vo.rb +234 -0
- data/lib/electron_api/models/card_reserve_account_response_vo.rb +234 -0
- data/lib/electron_api/models/card_spending_control_request_co.rb +180 -0
- data/lib/electron_api/models/card_spending_control_response_vo.rb +216 -0
- data/lib/electron_api/models/card_unload_request_co.rb +189 -0
- data/lib/electron_api/models/create_card_client_response_vo.rb +216 -0
- data/lib/electron_api/models/spending_control_vendor_request_data_vo.rb +254 -0
- data/lib/electron_api/models/update_card_client_response_vo.rb +216 -0
- data/lib/electron_api/version.rb +15 -0
- data/lib/electron_api.rb +57 -0
- data/spec/api/ach_api_spec.rb +46 -0
- data/spec/api/card_api_spec.rb +166 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/ach_card_request_co_spec.rb +41 -0
- data/spec/models/ach_card_response_vo_spec.rb +65 -0
- data/spec/models/base_response_vo_spec.rb +53 -0
- data/spec/models/card_base_request_co_spec.rb +53 -0
- data/spec/models/card_client_request_co_spec.rb +47 -0
- data/spec/models/card_load_request_co_spec.rb +47 -0
- data/spec/models/card_load_unload_response_vo_spec.rb +77 -0
- data/spec/models/card_replace_response_vo_spec.rb +77 -0
- data/spec/models/card_reserve_account_response_vo_spec.rb +77 -0
- data/spec/models/card_spending_control_request_co_spec.rb +41 -0
- data/spec/models/card_spending_control_response_vo_spec.rb +65 -0
- data/spec/models/card_unload_request_co_spec.rb +47 -0
- data/spec/models/create_card_client_response_vo_spec.rb +65 -0
- data/spec/models/spending_control_vendor_request_data_vo_spec.rb +89 -0
- data/spec/models/update_card_client_response_vo_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +312 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a7760fcdfee153854cb7c17ecf12b3a3b31477d081f0a999419e39895cc65266
|
4
|
+
data.tar.gz: 1e90f1b25c9f4cc823092f030df848f849c6199fa5b5989decd05ee86495d97a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 975773ad33855977230120ab095539cdf3f29ea1f4c1329619642ef321290d03de248fd0b7d19b3bfe72d2f0716f995670ebc616b2f538fda5a8c394daab0315
|
7
|
+
data.tar.gz: f1c06ca0dda8d7d98fb25718a2187129896d6285daa2b4c576c7e159b02600f0c89211dd693806987e853aaf4568d9caa7f00048fd841b3797289fbcffa07e5c
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
# Hydrogen Electron API
|
2
|
+
Hydrogen Electron API
|
3
|
+
- API version: 1.3.1
|
4
|
+
- Build date: 27-12-2021
|
5
|
+
For more information, please visit [https://www.hydrogenplatform.com/contact](https://www.hydrogenplatform.com/contact)
|
6
|
+
|
7
|
+
## Documentation
|
8
|
+
|
9
|
+
https://www.hydrogenplatform.com/docs/electron/v1
|
10
|
+
|
11
|
+
## Requirements
|
12
|
+
1. Ruby 2.7+
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
### Install via Ruby Gems
|
17
|
+
|
18
|
+
Install the gem:
|
19
|
+
|
20
|
+
```shell
|
21
|
+
gem install hydrogen-electron-api
|
22
|
+
```
|
23
|
+
|
24
|
+
The add this to the Gemfile:
|
25
|
+
|
26
|
+
gem 'hydrogen-electron-api', '~> 1.3', '>= 1.3.1'
|
27
|
+
|
28
|
+
|
29
|
+
## Getting Started
|
30
|
+
|
31
|
+
Please first follow the [installation](#installation) instructions. Then make sure you use the proper base URL:
|
32
|
+
### Base URL
|
33
|
+
|
34
|
+
|
35
|
+
Create an object of **Environment** and use the **set_environment** method to update the environment.
|
36
|
+
|
37
|
+
**Sandbox URL**
|
38
|
+
|
39
|
+
environment_config = ElectronApi::Environment.new
|
40
|
+
|
41
|
+
environment_config.set_environment(environment_config.SANDBOX)
|
42
|
+
|
43
|
+
**Production URL**
|
44
|
+
|
45
|
+
environment_config = ElectronApi::Environment.new
|
46
|
+
|
47
|
+
environment_config.set_environment(environment_config.PRODUCTION)
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
# Load the gem
|
51
|
+
require 'electron_api'
|
52
|
+
environment_config = ElectronApi::Environment.new
|
53
|
+
environment_config.set_environment(environment_config.PRODUCTION)
|
54
|
+
|
55
|
+
# Setup authorization
|
56
|
+
ElectronApi.configure do |config|
|
57
|
+
# Use one of the below method to generate oauth token
|
58
|
+
# Creating a token for grant_type=client_credentials
|
59
|
+
config.create_client_credential("CLIENT_ID", "CLIENT_SECRET");
|
60
|
+
# Creating a token for grant_type=password
|
61
|
+
config.create_password_credential("CLIENT_ID", "CLIENT_SECRET", "USERNAME", "PASSWORD");
|
62
|
+
# Creating a token using client token
|
63
|
+
config.create_client_token_credential("CLIENT_ID", "CLIENT_SECRET", "CLIENT_TOKEN")
|
64
|
+
end
|
65
|
+
|
66
|
+
api_instance = ElectronApi::ACHApi.new
|
67
|
+
|
68
|
+
ach_card_request_co = ElectronApi::AchCardRequestCO.new # AchCardRequestCO | achCardRequestCO
|
69
|
+
|
70
|
+
|
71
|
+
begin
|
72
|
+
#Fund card
|
73
|
+
result = api_instance.fund_card_using_post(ach_card_request_co)
|
74
|
+
p result
|
75
|
+
rescue ElectronApi::ApiError => e
|
76
|
+
puts "Exception when calling ACHApi->fund_card_using_post: #{e}"
|
77
|
+
end
|
78
|
+
|
79
|
+
```
|
80
|
+
|
81
|
+
## Author
|
82
|
+
The Hydrogen Technology Corporation
|
83
|
+
|
84
|
+
https://www.hydrogenplatform.com
|
85
|
+
|
86
|
+
*Generated using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)*
|
data/Rakefile
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#Hydrogen Electron API
|
5
|
+
|
6
|
+
#The Hydrogen Electron API
|
7
|
+
|
8
|
+
OpenAPI spec version: 1.3.1
|
9
|
+
Contact: info@hydrogenplatform.com
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
11
|
+
Swagger Codegen version: 2.4.24
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "electron_api/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "hydrogen-electron-api"
|
20
|
+
s.version = ElectronApi::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["Hydrogen Platform"]
|
23
|
+
s.email = ["info@hydrogenplatform.com"]
|
24
|
+
s.homepage = "https://www.hydrogenplatform.com"
|
25
|
+
s.summary = "Hydrogen Electron API Ruby Gem"
|
26
|
+
s.description = "The Hydrogen Electron API"
|
27
|
+
s.license = "Unlicense"
|
28
|
+
s.required_ruby_version = ">= 1.9"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
+
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
32
|
+
s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0'
|
33
|
+
|
34
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
35
|
+
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
36
|
+
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
|
37
|
+
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
38
|
+
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
39
|
+
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
40
|
+
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
|
41
|
+
|
42
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
43
|
+
s.test_files = `find spec/*`.split("\n")
|
44
|
+
s.executables = []
|
45
|
+
s.require_paths = ["lib"]
|
46
|
+
end
|
data/git_push.sh
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
4
|
+
#
|
5
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
6
|
+
#
|
7
|
+
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
8
|
+
|
9
|
+
git_user_id=$1
|
10
|
+
git_repo_id=$2
|
11
|
+
release_note=$3
|
12
|
+
|
13
|
+
if [ "$git_user_id" = "" ]; then
|
14
|
+
git_user_id=""
|
15
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
16
|
+
fi
|
17
|
+
|
18
|
+
if [ "$git_repo_id" = "" ]; then
|
19
|
+
git_repo_id=""
|
20
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
21
|
+
fi
|
22
|
+
|
23
|
+
if [ "$release_note" = "" ]; then
|
24
|
+
release_note=""
|
25
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
26
|
+
fi
|
27
|
+
|
28
|
+
# Initialize the local directory as a Git repository
|
29
|
+
git init
|
30
|
+
|
31
|
+
# Adds the files in the local repository and stages them for commit.
|
32
|
+
git add .
|
33
|
+
|
34
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
35
|
+
git commit -m "$release_note"
|
36
|
+
|
37
|
+
# Sets the new remote
|
38
|
+
git_remote=`git remote`
|
39
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
40
|
+
|
41
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
42
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
43
|
+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
44
|
+
else
|
45
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
46
|
+
fi
|
47
|
+
|
48
|
+
fi
|
49
|
+
|
50
|
+
git pull origin master
|
51
|
+
|
52
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
53
|
+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
54
|
+
git push origin master 2>&1 | grep -v 'To https'
|
55
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
=begin
|
2
|
+
#Hydrogen Electron API
|
3
|
+
|
4
|
+
#The Hydrogen Electron API
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.3.1
|
7
|
+
Contact: info@hydrogenplatform.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.24
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module ElectronApi
|
16
|
+
class ACHApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Fund card
|
23
|
+
# @param ach_card_request_co achCardRequestCO
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [AchCardResponseVO]
|
26
|
+
def fund_card_using_post(ach_card_request_co, opts = {})
|
27
|
+
data, _status_code, _headers = fund_card_using_post_with_http_info(ach_card_request_co, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Fund card
|
32
|
+
# @param ach_card_request_co achCardRequestCO
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(AchCardResponseVO, Fixnum, Hash)>] AchCardResponseVO data, response status code and response headers
|
35
|
+
def fund_card_using_post_with_http_info(ach_card_request_co, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: ACHApi.fund_card_using_post ...'
|
38
|
+
end
|
39
|
+
# verify the required parameter 'ach_card_request_co' is set
|
40
|
+
if @api_client.config.client_side_validation && ach_card_request_co.nil?
|
41
|
+
fail ArgumentError, "Missing the required parameter 'ach_card_request_co' when calling ACHApi.fund_card_using_post"
|
42
|
+
end
|
43
|
+
# resource path
|
44
|
+
local_var_path = '/ach/card'
|
45
|
+
|
46
|
+
# query parameters
|
47
|
+
query_params = {}
|
48
|
+
|
49
|
+
# header parameters
|
50
|
+
header_params = {}
|
51
|
+
# HTTP header 'Accept' (if needed)
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
53
|
+
# HTTP header 'Content-Type'
|
54
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = @api_client.object_to_http_body(ach_card_request_co)
|
61
|
+
auth_names = ['oauth2']
|
62
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => 'AchCardResponseVO')
|
69
|
+
if @api_client.config.debugging
|
70
|
+
@api_client.config.logger.debug "API called: ACHApi#fund_card_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
71
|
+
end
|
72
|
+
return data, status_code, headers
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|