amex_tokenization_client 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/amex_tokenization_client/request.rb +3 -0
- data/lib/amex_tokenization_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c62e09182ba57700d963be41b847603d89a6323bce020c9e55dc505f628a0e25
|
4
|
+
data.tar.gz: f762f6e1827b2e44ff8ecc3fafc58614b24bb7ae2640dfcb57aaff1efcf41855
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa54da88d1bbb087dff44abc4e3042e6dd459ca7fba71fa7245ed629878178cb8a3ee25eed4bf8a5e2ded85bba39b3e46724a640217e9662a031b7c8bbce937
|
7
|
+
data.tar.gz: 68e290243275f584da6367c737942e78ccad1d32b2e8cf3c3ff45562ec7b9208e9c0e09b51eac43f0193b996a5bd7bfb94c680f9276be3f7c0c7307e25c06244
|
data/README.md
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
# AmexTokenizationClient
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/amex_tokenization_client)
|
3
4
|
[](https://travis-ci.org/varyonic/amex-api-ruby-client)
|
4
5
|
|
5
6
|
Unofficial Ruby wrapper for the American Express Tokenization Service (AETS).
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
9
|
-
Add
|
10
|
+
Add to your application's Gemfile:
|
10
11
|
|
11
12
|
```ruby
|
12
13
|
gem 'amex_tokenization_client'
|
14
|
+
gem 'jwe', git: 'https://github.com/varyonic/ruby-jwe', branch: 'PR18' # A256KW fix
|
13
15
|
```
|
14
16
|
|
15
17
|
And then execute:
|
@@ -4,12 +4,14 @@ require 'net/http'
|
|
4
4
|
class AmexTokenizationClient
|
5
5
|
class Request
|
6
6
|
attr_reader :uri, :request
|
7
|
+
attr_reader :headers
|
7
8
|
attr_reader :logger
|
8
9
|
|
9
10
|
def initialize(method, path, headers, logger:)
|
10
11
|
@logger = logger
|
11
12
|
@uri = URI(path)
|
12
13
|
@request = Net::HTTP.const_get(method.capitalize).new(uri)
|
14
|
+
@headers = headers
|
13
15
|
headers.each_pair { |k, v| request[k] = v }
|
14
16
|
end
|
15
17
|
|
@@ -37,6 +39,7 @@ class AmexTokenizationClient
|
|
37
39
|
# Log response and time taken.
|
38
40
|
def log_request_response(data = nil)
|
39
41
|
logger.info "[#{self.class.name}] request = #{request.method} #{uri}#{data ? '?' + data : ''}"
|
42
|
+
logger.info "[#{self.class.name}] request_id = #{headers['x-amex-request-id']}"
|
40
43
|
response = nil
|
41
44
|
tms = Benchmark.measure do
|
42
45
|
response = yield
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amex_tokenization_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piers Chambers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwe
|