shift4 2.0.0 → 2.2.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/charge_splits.rb +27 -0
- 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 +2 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0acebc68ad1e1c7012875e3cccaf657b4c22b1c98517be45500fb9337b882e4c
|
4
|
+
data.tar.gz: ffba4e2ebf7991ace179c60e3d53b126eac706a3aed309c015499567e0e0d0ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703aaebd93db11f290b2b91aa4ce7d2b8bd21660f5fab19cc9816eac26e4f284eec639a397324c970a1e782c8f588c299b9a8358248d521bf19db87598984fc2
|
7
|
+
data.tar.gz: 3c5e5708edd1c00186ec236d034a0f276794e66340933fd50f3758b8c45fbd03e45991a0b2784b959b136524d579623d9f87cd1b2a52a193028c90f833a4d5ab
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Shift4
|
4
|
+
class ChargeSplits
|
5
|
+
extend TransactionBase
|
6
|
+
|
7
|
+
def self.retrieve(split_id, config = Configuration)
|
8
|
+
communicator.get("#{config.api_url}/charge-splits/#{split_id}", config: config)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.list(params, config = Configuration)
|
12
|
+
communicator.get("#{config.api_url}/charge-splits", query: params, config: config)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.refund(params, config = Configuration)
|
16
|
+
communicator.post("#{config.api_url}/charge-split-refunds", json: params, config: config)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.retrieve_refund(split_refund_id, config = Configuration)
|
20
|
+
communicator.get("#{config.api_url}/charge-split-refunds/#{split_refund_id}", config: config)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.list_refunds(params, config = Configuration)
|
24
|
+
communicator.get("#{config.api_url}/charge-split-refunds", query: params, config: config)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
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
@@ -7,6 +7,7 @@ require 'shift4/shift4_pay_exception'
|
|
7
7
|
require 'shift4/blacklist'
|
8
8
|
require 'shift4/cards'
|
9
9
|
require 'shift4/charges'
|
10
|
+
require 'shift4/charge_splits'
|
10
11
|
require 'shift4/communicator'
|
11
12
|
require 'shift4/configuration'
|
12
13
|
require 'shift4/credits'
|
@@ -17,6 +18,7 @@ require 'shift4/file_uploads'
|
|
17
18
|
require 'shift4/fraud_warnings'
|
18
19
|
require 'shift4/payment_methods'
|
19
20
|
require 'shift4/plans'
|
21
|
+
require 'shift4/request_options'
|
20
22
|
require 'shift4/subscriptions'
|
21
23
|
require 'shift4/tokens'
|
22
24
|
|
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.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shift4
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- lib/shift4.rb
|
176
176
|
- lib/shift4/blacklist.rb
|
177
177
|
- lib/shift4/cards.rb
|
178
|
+
- lib/shift4/charge_splits.rb
|
178
179
|
- lib/shift4/charges.rb
|
179
180
|
- lib/shift4/communicator.rb
|
180
181
|
- lib/shift4/configuration.rb
|
@@ -186,6 +187,7 @@ files:
|
|
186
187
|
- lib/shift4/fraud_warnings.rb
|
187
188
|
- lib/shift4/payment_methods.rb
|
188
189
|
- lib/shift4/plans.rb
|
190
|
+
- lib/shift4/request_options.rb
|
189
191
|
- lib/shift4/shift4_pay_exception.rb
|
190
192
|
- lib/shift4/subscriptions.rb
|
191
193
|
- lib/shift4/tokens.rb
|
@@ -195,7 +197,7 @@ homepage: https://shift4.com
|
|
195
197
|
licenses:
|
196
198
|
- MIT
|
197
199
|
metadata: {}
|
198
|
-
post_install_message:
|
200
|
+
post_install_message:
|
199
201
|
rdoc_options: []
|
200
202
|
require_paths:
|
201
203
|
- lib
|
@@ -210,8 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
212
|
- !ruby/object:Gem::Version
|
211
213
|
version: '0'
|
212
214
|
requirements: []
|
213
|
-
rubygems_version: 3.
|
214
|
-
signing_key:
|
215
|
+
rubygems_version: 3.2.3
|
216
|
+
signing_key:
|
215
217
|
specification_version: 4
|
216
218
|
summary: Shift4 Ruby Gem
|
217
219
|
test_files: []
|