cardconnect 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/CHANGELOG.md +27 -0
- data/README.md +10 -0
- data/lib/cardconnect/configuration.rb +2 -0
- data/lib/cardconnect/connection.rb +12 -4
- data/lib/cardconnect/version.rb +1 -1
- data/test/cardconnect/configuration_test.rb +4 -0
- data/test/cardconnect/connection_test.rb +11 -0
- data/test/test_helper.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1424e5c7c8b8b7da969afddb41d96b38251e6c7f
|
4
|
+
data.tar.gz: 4d108dc528103808b4c9688c4afab51c4b833bb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db20abb8bd3a1125ead42db2e54d03b1864a530139d2fd669be621510851bf5537b86f5a5289a5fa98cc8855acf6ee7b84e5051f54ceb128635bb1b512ce8fea
|
7
|
+
data.tar.gz: 5a524dd23a749c7232831d8d75a3f72fe34b0e1f890d378a985b408b2f3312340b6c6cf06a31b12d08f69ee509a5a49e19224fe58e2fd738fa01617e28a70c84
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## v2.1.0
|
4
|
+
|
5
|
+
* Add ability to pass connection options to the Faraday connection (@jhanggi)
|
6
|
+
|
7
|
+
## v2.0.1
|
8
|
+
|
9
|
+
* Upgrades `faraday` and `faraday_middleware` dependency versions
|
10
|
+
|
11
|
+
## v2.0.0
|
12
|
+
|
13
|
+
* Added support for Profile Service (@AndreiBujenitsa)
|
14
|
+
* Removes Deposit Service support
|
15
|
+
|
16
|
+
## v1.1.1
|
17
|
+
|
18
|
+
* Reintroduced Capture and Inquire settlement status constants to resolve some compatibility issues
|
19
|
+
|
20
|
+
## v1.1.0
|
21
|
+
|
22
|
+
* Adding the `profileid` to the Authorization Response.
|
23
|
+
* Added fields necessary for Authorization Capture requests
|
24
|
+
|
25
|
+
## v1.0.0
|
26
|
+
|
27
|
+
* First version! Don't downgrade from here!
|
data/README.md
CHANGED
@@ -37,6 +37,16 @@ CardConnect.configure do |config|
|
|
37
37
|
end
|
38
38
|
```
|
39
39
|
|
40
|
+
You may pass additional options into the [Faraday connection](https://github.com/lostisland/faraday/blob/master/lib/faraday/connection.rb) via `connection_options`.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
CardConnection.configure do |config|
|
44
|
+
config.connection_options = { ssl: your_ssl_options }
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
_Note: We do not recommend setting `verify: false`_
|
49
|
+
|
40
50
|
## Services
|
41
51
|
|
42
52
|
### Authorization Service
|
@@ -3,13 +3,12 @@ require 'faraday_middleware'
|
|
3
3
|
|
4
4
|
module CardConnect
|
5
5
|
class Connection
|
6
|
-
def initialize
|
7
|
-
@config =
|
8
|
-
@headers = { user_agent: "CardConnectRubyGem/#{CardConnect::VERSION}" }
|
6
|
+
def initialize(config = CardConnect.configuration)
|
7
|
+
@config = config
|
9
8
|
end
|
10
9
|
|
11
10
|
def connection
|
12
|
-
@connection ||= Faraday.new(
|
11
|
+
@connection ||= Faraday.new(faraday_options) do |f|
|
13
12
|
f.request :basic_auth, @config.api_username, @config.api_password
|
14
13
|
f.request :json
|
15
14
|
|
@@ -27,5 +26,14 @@ module CardConnect
|
|
27
26
|
rescue Faraday::ClientError => e
|
28
27
|
return e
|
29
28
|
end
|
29
|
+
|
30
|
+
def faraday_options
|
31
|
+
{
|
32
|
+
url: @config.endpoint,
|
33
|
+
headers: {
|
34
|
+
user_agent: "CardConnectRubyGem/#{CardConnect::VERSION}"
|
35
|
+
},
|
36
|
+
}.merge(@config.connection_options)
|
37
|
+
end
|
30
38
|
end
|
31
39
|
end
|
data/lib/cardconnect/version.rb
CHANGED
@@ -31,6 +31,17 @@ describe CardConnect::Connection do
|
|
31
31
|
it 'must have a handler for parsing the json response third' do
|
32
32
|
@connection.builder.handlers[2].must_be :===, FaradayMiddleware::ParseJson
|
33
33
|
end
|
34
|
+
|
35
|
+
it 'has ssl verification on by default' do
|
36
|
+
assert(@connection.ssl.verify?)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'has the ability to accept ssl options' do
|
40
|
+
config = CardConnect.configuration.dup
|
41
|
+
config.connection_options = { ssl: { verify: false } }
|
42
|
+
connection = CardConnect::Connection.new(config).connection
|
43
|
+
refute(connection.ssl.verify)
|
44
|
+
end
|
34
45
|
end
|
35
46
|
end
|
36
47
|
end
|
data/test/test_helper.rb
CHANGED
@@ -19,7 +19,7 @@ end
|
|
19
19
|
module CardConnect
|
20
20
|
class Connection
|
21
21
|
def connection
|
22
|
-
@connection ||= Faraday.new(
|
22
|
+
@connection ||= Faraday.new(faraday_options) do |faraday|
|
23
23
|
faraday.request :basic_auth, @config.api_username, @config.api_password
|
24
24
|
faraday.request :json
|
25
25
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim McKenzie
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- ".gitignore"
|
68
68
|
- ".rubocop.yml"
|
69
69
|
- ".travis.yml"
|
70
|
+
- CHANGELOG.md
|
70
71
|
- Gemfile
|
71
72
|
- LICENSE.txt
|
72
73
|
- README.md
|