shift4 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0978ba46e4ec7c2a473b8d26f7d0ead83a271c9aa7c6425ce50e59a7ad6e2deb'
4
- data.tar.gz: fd28c39b5dff40dc896df38aa4e536e9a1d0548edc4674c97114533ce34577e3
3
+ metadata.gz: 7de9e08271e1c5ba30a77d0b1c042b2d2c4d77dfe5abcc2575ccdf48edb1cc7f
4
+ data.tar.gz: a8703f50147daade03309a81d3be80dadd0e054661e3de87b1e1fe025d0ff885
5
5
  SHA512:
6
- metadata.gz: ce9798a45ec15a56092293ffc3ec26387e1e112a0070c124a50ccfa8d4573d0159695fab9723cd9c8eafeb854b416349ff0e6d17b2a8b64276e37aa4b95b9780
7
- data.tar.gz: dbc088cf95d86adea3f4625aa3c70ec3ab0a0b29451561d98058a05b9465925bb5162058dd5b6812c20bdde43c5f6a987b90a6cb8361b3b218d665aa66b068c4
6
+ metadata.gz: ff5e87306468578452ad0598a7a7cdd120cddcc8e57057d67c45fe263a86b390e5af2c24154e19ad5ad42fa80072017e688c2c359ec944a470ba3efaa5211096
7
+ data.tar.gz: b8cd9e6d74effd4c6adc6839fee5fab4d12a9fb57b6aa79a65d292322a64352046fd153fd3127d2f4090d4c27dda1d71df3d41f077abc1fc72fa4ac0d78ddcec
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shift4
4
- VERSION = '1.1.0'
4
+ VERSION = '2.1.0'
5
5
  end
data/lib/shift4.rb CHANGED
@@ -10,7 +10,6 @@ require 'shift4/charges'
10
10
  require 'shift4/communicator'
11
11
  require 'shift4/configuration'
12
12
  require 'shift4/credits'
13
- require 'shift4/cross_sale_offers'
14
13
  require 'shift4/customers'
15
14
  require 'shift4/disputes'
16
15
  require 'shift4/events'
@@ -18,6 +17,7 @@ require 'shift4/file_uploads'
18
17
  require 'shift4/fraud_warnings'
19
18
  require 'shift4/payment_methods'
20
19
  require 'shift4/plans'
20
+ require 'shift4/request_options'
21
21
  require 'shift4/subscriptions'
22
22
  require 'shift4/tokens'
23
23
 
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: 1.1.0
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: 2023-07-20 00:00:00.000000000 Z
11
+ date: 2024-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -179,7 +179,6 @@ files:
179
179
  - lib/shift4/communicator.rb
180
180
  - lib/shift4/configuration.rb
181
181
  - lib/shift4/credits.rb
182
- - lib/shift4/cross_sale_offers.rb
183
182
  - lib/shift4/customers.rb
184
183
  - lib/shift4/disputes.rb
185
184
  - lib/shift4/events.rb
@@ -187,6 +186,7 @@ files:
187
186
  - lib/shift4/fraud_warnings.rb
188
187
  - lib/shift4/payment_methods.rb
189
188
  - lib/shift4/plans.rb
189
+ - lib/shift4/request_options.rb
190
190
  - lib/shift4/shift4_pay_exception.rb
191
191
  - lib/shift4/subscriptions.rb
192
192
  - lib/shift4/tokens.rb
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
211
  - !ruby/object:Gem::Version
212
212
  version: '0'
213
213
  requirements: []
214
- rubygems_version: 3.4.10
214
+ rubygems_version: 3.5.11
215
215
  signing_key:
216
216
  specification_version: 4
217
217
  summary: Shift4 Ruby Gem
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Shift4
4
- class CrossSaleOffers
5
- extend TransactionBase
6
-
7
- def self.create(params, config = Configuration)
8
- communicator.post("#{config.api_url}/cross-sale-offers", json: params, config: config)
9
- end
10
-
11
- def self.retrieve(cross_sale_offer_id, config = Configuration)
12
- communicator.get("#{config.api_url}/cross-sale-offers/#{cross_sale_offer_id}", config: config)
13
- end
14
-
15
- def self.update(cross_sale_offer_id, params, config = Configuration)
16
- communicator.post("#{config.api_url}/cross-sale-offers/#{cross_sale_offer_id}", json: params, config: config)
17
- end
18
-
19
- def self.delete(cross_sale_offer_id, config = Configuration)
20
- communicator.delete("#{config.api_url}/cross-sale-offers/#{cross_sale_offer_id}", config: config)
21
- end
22
-
23
- def self.list(params = nil, config = Configuration)
24
- communicator.get("#{config.api_url}/cross-sale-offers", query: params, config: config)
25
- end
26
- end
27
- end