shift4 2.0.0 → 2.1.0
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/lib/shift4/communicator.rb +3 -0
- data/lib/shift4/request_options.rb +24 -0
- data/lib/shift4/version.rb +1 -1
- data/lib/shift4.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7de9e08271e1c5ba30a77d0b1c042b2d2c4d77dfe5abcc2575ccdf48edb1cc7f
|
4
|
+
data.tar.gz: a8703f50147daade03309a81d3be80dadd0e054661e3de87b1e1fe025d0ff885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff5e87306468578452ad0598a7a7cdd120cddcc8e57057d67c45fe263a86b390e5af2c24154e19ad5ad42fa80072017e688c2c359ec944a470ba3efaa5211096
|
7
|
+
data.tar.gz: b8cd9e6d74effd4c6adc6839fee5fab4d12a9fb57b6aa79a65d292322a64352046fd153fd3127d2f4090d4c27dda1d71df3d41f077abc1fc72fa4ac0d78ddcec
|
data/lib/shift4/communicator.rb
CHANGED
@@ -34,6 +34,9 @@ module Shift4
|
|
34
34
|
"Accept" => "application/json",
|
35
35
|
}
|
36
36
|
headers["Shift4-Merchant"] = config.merchant unless config.merchant.nil?
|
37
|
+
if config.is_a?(RequestOptions) && !config.idempotency_key.nil?
|
38
|
+
headers["Idempotency-Key"] = config.idempotency_key
|
39
|
+
end
|
37
40
|
|
38
41
|
if json
|
39
42
|
raise ArgumentError("Cannot specify both body and json") if body
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Shift4
|
4
|
+
class RequestOptions < Configuration
|
5
|
+
class << self
|
6
|
+
attr_reader :idempotency_key
|
7
|
+
end
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
config = Configuration,
|
11
|
+
idempotency_key: nil
|
12
|
+
)
|
13
|
+
super(
|
14
|
+
secret_key: config.secret_key,
|
15
|
+
merchant: config.merchant,
|
16
|
+
api_url: config.api_url,
|
17
|
+
uploads_url: config.uploads_url
|
18
|
+
)
|
19
|
+
@idempotency_key = idempotency_key
|
20
|
+
end
|
21
|
+
|
22
|
+
attr_reader :idempotency_key
|
23
|
+
end
|
24
|
+
end
|
data/lib/shift4/version.rb
CHANGED
data/lib/shift4.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shift4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shift4
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- lib/shift4/fraud_warnings.rb
|
187
187
|
- lib/shift4/payment_methods.rb
|
188
188
|
- lib/shift4/plans.rb
|
189
|
+
- lib/shift4/request_options.rb
|
189
190
|
- lib/shift4/shift4_pay_exception.rb
|
190
191
|
- lib/shift4/subscriptions.rb
|
191
192
|
- lib/shift4/tokens.rb
|
@@ -210,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
211
|
- !ruby/object:Gem::Version
|
211
212
|
version: '0'
|
212
213
|
requirements: []
|
213
|
-
rubygems_version: 3.
|
214
|
+
rubygems_version: 3.5.11
|
214
215
|
signing_key:
|
215
216
|
specification_version: 4
|
216
217
|
summary: Shift4 Ruby Gem
|