shift4 1.0.0 → 2.0.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/blacklist.rb +8 -8
- data/lib/shift4/cards.rb +10 -10
- data/lib/shift4/charges.rb +12 -12
- data/lib/shift4/communicator.rb +10 -8
- data/lib/shift4/configuration.rb +30 -15
- data/lib/shift4/credits.rb +8 -8
- data/lib/shift4/customers.rb +10 -10
- data/lib/shift4/disputes.rb +8 -8
- data/lib/shift4/events.rb +4 -4
- data/lib/shift4/file_uploads.rb +6 -6
- data/lib/shift4/fraud_warnings.rb +4 -4
- data/lib/shift4/payment_methods.rb +8 -8
- data/lib/shift4/plans.rb +10 -10
- data/lib/shift4/subscriptions.rb +10 -10
- data/lib/shift4/tokens.rb +4 -4
- data/lib/shift4/version.rb +1 -1
- data/lib/shift4.rb +0 -1
- metadata +3 -4
- data/lib/shift4/cross_sale_offers.rb +0 -27
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '07539d434b346dfb29dac676752d4092b16d0eb8505256892faf077305a80db3'
|
|
4
|
+
data.tar.gz: 633888e89d127192b15f2d68708d914d34a4bb090e8e1f2c55dc39d003fbaee9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a3f1da475ce49f70a83ac114efa899d3c06445c3f5305aec46b37f3f3729a02a41f34464d3669ca1f09a110e771cbfb920eed6b39bced3b3dc7092d245ae31b
|
|
7
|
+
data.tar.gz: e353e59012771baa7173df0e62ca1cc9d57a9d0aa076fbf98e0209749dae0203414bde1f6896c3612ce9f6b8d769e29552313f70b3fa4235fa9cd9f07f6500d2
|
data/lib/shift4/blacklist.rb
CHANGED
|
@@ -5,20 +5,20 @@ module Shift4
|
|
|
5
5
|
class Blacklist
|
|
6
6
|
extend TransactionBase
|
|
7
7
|
|
|
8
|
-
def self.create(params)
|
|
9
|
-
communicator.post("#{
|
|
8
|
+
def self.create(params, config = Configuration)
|
|
9
|
+
communicator.post("#{config.api_url}/blacklist", json: params, config: config)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def self.retrieve(blacklist_rule_id)
|
|
13
|
-
communicator.get("#{
|
|
12
|
+
def self.retrieve(blacklist_rule_id, config = Configuration)
|
|
13
|
+
communicator.get("#{config.api_url}/blacklist/#{blacklist_rule_id}", config: config)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def self.delete(blacklist_rule_id)
|
|
17
|
-
communicator.delete("#{
|
|
16
|
+
def self.delete(blacklist_rule_id, config = Configuration)
|
|
17
|
+
communicator.delete("#{config.api_url}/blacklist/#{blacklist_rule_id}", config: config)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def self.list(params = nil)
|
|
21
|
-
communicator.get("#{
|
|
20
|
+
def self.list(params = nil, config = Configuration)
|
|
21
|
+
communicator.get("#{config.api_url}/blacklist", query: params, config: config)
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
end
|
data/lib/shift4/cards.rb
CHANGED
|
@@ -4,24 +4,24 @@ module Shift4
|
|
|
4
4
|
class Cards
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.create(customer_id, params)
|
|
8
|
-
communicator.post("#{
|
|
7
|
+
def self.create(customer_id, params, config = Configuration)
|
|
8
|
+
communicator.post("#{config.api_url}/customers/#{customer_id}/cards", json: params, config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.retrieve(customer_id, card_id)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.retrieve(customer_id, card_id, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/customers/#{customer_id}/cards/#{card_id}", config: config)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.update(customer_id, card_id, params)
|
|
16
|
-
communicator.post("#{
|
|
15
|
+
def self.update(customer_id, card_id, params, config = Configuration)
|
|
16
|
+
communicator.post("#{config.api_url}/customers/#{customer_id}/cards/#{card_id}", json: params, config: config)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.delete(customer_id, card_id)
|
|
20
|
-
communicator.delete("#{
|
|
19
|
+
def self.delete(customer_id, card_id, config = Configuration)
|
|
20
|
+
communicator.delete("#{config.api_url}/customers/#{customer_id}/cards/#{card_id}", config: config)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def self.list(customer_id, params = nil)
|
|
24
|
-
communicator.get("#{
|
|
23
|
+
def self.list(customer_id, params = nil, config = Configuration)
|
|
24
|
+
communicator.get("#{config.api_url}/customers/#{customer_id}/cards", query: params, config: config)
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
data/lib/shift4/charges.rb
CHANGED
|
@@ -4,28 +4,28 @@ module Shift4
|
|
|
4
4
|
class Charges
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.create(params)
|
|
8
|
-
communicator.post("#{
|
|
7
|
+
def self.create(params, config = Configuration)
|
|
8
|
+
communicator.post("#{config.api_url}/charges", json: params, config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.retrieve(charge_id)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.retrieve(charge_id, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/charges/#{charge_id}", config: config)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.update(charge_id, params)
|
|
16
|
-
communicator.post("#{
|
|
15
|
+
def self.update(charge_id, params, config = Configuration)
|
|
16
|
+
communicator.post("#{config.api_url}/charges/#{charge_id}", json: params, config: config)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.list(params = nil)
|
|
20
|
-
communicator.get("#{
|
|
19
|
+
def self.list(params = nil, config = Configuration)
|
|
20
|
+
communicator.get("#{config.api_url}/charges", query: params, config: config)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def self.capture(charge_id)
|
|
24
|
-
communicator.post("#{
|
|
23
|
+
def self.capture(charge_id, config = Configuration)
|
|
24
|
+
communicator.post("#{config.api_url}/charges/#{charge_id}/capture", config: config)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
def self.refund(charge_id, params = nil)
|
|
28
|
-
communicator.post("#{
|
|
27
|
+
def self.refund(charge_id, params = nil, config = Configuration)
|
|
28
|
+
communicator.post("#{config.api_url}/charges/#{charge_id}/refund", json: params, config: config)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
end
|
data/lib/shift4/communicator.rb
CHANGED
|
@@ -10,29 +10,31 @@ module Shift4
|
|
|
10
10
|
|
|
11
11
|
@web_consumer = HTTParty
|
|
12
12
|
|
|
13
|
-
def self.get(url, query: nil)
|
|
14
|
-
response = web_consumer.get(url, request(query: query))
|
|
13
|
+
def self.get(url, query: nil, config: Configuration)
|
|
14
|
+
response = web_consumer.get(url, request(query: query, config: config))
|
|
15
15
|
handle_response(response)
|
|
16
16
|
response
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.post(url, json: nil, body: nil)
|
|
20
|
-
response = web_consumer.post(url, request(json: json, body: body))
|
|
19
|
+
def self.post(url, json: nil, body: nil, config: Configuration)
|
|
20
|
+
response = web_consumer.post(url, request(json: json, body: body, config: config))
|
|
21
21
|
handle_response(response)
|
|
22
22
|
response
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def self.delete(url)
|
|
26
|
-
response = web_consumer.delete(url, request)
|
|
25
|
+
def self.delete(url, config: Configuration)
|
|
26
|
+
response = web_consumer.delete(url, request(config: config))
|
|
27
27
|
handle_response(response)
|
|
28
28
|
response
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def self.request(json: nil, query: nil, body: nil)
|
|
31
|
+
def self.request(json: nil, query: nil, body: nil, config: Configuration)
|
|
32
32
|
headers = {
|
|
33
33
|
"User-Agent" => "Shift4-Ruby/#{Shift4::VERSION} (Ruby/#{RUBY_VERSION})",
|
|
34
34
|
"Accept" => "application/json",
|
|
35
35
|
}
|
|
36
|
+
headers["Shift4-Merchant"] = config.merchant unless config.merchant.nil?
|
|
37
|
+
|
|
36
38
|
if json
|
|
37
39
|
raise ArgumentError("Cannot specify both body and json") if body
|
|
38
40
|
|
|
@@ -45,7 +47,7 @@ module Shift4
|
|
|
45
47
|
query: query,
|
|
46
48
|
headers: headers,
|
|
47
49
|
basic_auth: {
|
|
48
|
-
username:
|
|
50
|
+
username: config.secret_key
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
end
|
data/lib/shift4/configuration.rb
CHANGED
|
@@ -3,27 +3,42 @@
|
|
|
3
3
|
module Shift4
|
|
4
4
|
class Configuration
|
|
5
5
|
class << self
|
|
6
|
-
attr_accessor :secret_key
|
|
6
|
+
attr_accessor :secret_key, :merchant
|
|
7
7
|
attr_reader :api_url, :uploads_url
|
|
8
|
+
|
|
9
|
+
@api_url = 'https://api.shift4.com'
|
|
10
|
+
@uploads_url = 'https://uploads.api.shift4.com'
|
|
11
|
+
|
|
12
|
+
def api_url=(api_url)
|
|
13
|
+
@api_url = api_url.nil? ? 'https://api.shift4.com' : api_url.gsub(%r{/$}, "")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def uploads_url=(uploads_url)
|
|
17
|
+
@uploads_url = uploads_url.nil? ? 'https://uploads.api.shift4.com' : uploads_url.gsub(%r{/$}, "")
|
|
18
|
+
end
|
|
8
19
|
end
|
|
9
20
|
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
attr_accessor :secret_key, :merchant
|
|
22
|
+
attr_reader :api_url, :uploads_url
|
|
23
|
+
|
|
24
|
+
def initialize(
|
|
25
|
+
secret_key:,
|
|
26
|
+
merchant: nil,
|
|
27
|
+
api_url: 'https://api.shift4.com',
|
|
28
|
+
uploads_url: 'https://uploads.api.shift4.com'
|
|
29
|
+
)
|
|
30
|
+
self.api_url = api_url
|
|
31
|
+
self.uploads_url = uploads_url
|
|
32
|
+
self.secret_key = secret_key
|
|
33
|
+
self.merchant = merchant
|
|
34
|
+
end
|
|
12
35
|
|
|
13
|
-
def
|
|
14
|
-
@api_url =
|
|
15
|
-
'https://api.shift4.com'
|
|
16
|
-
else
|
|
17
|
-
api_url.gsub(%r{/$}, "")
|
|
18
|
-
end
|
|
36
|
+
def api_url=(api_url)
|
|
37
|
+
@api_url = api_url.nil? ? 'https://api.shift4.com' : api_url.gsub(%r{/$}, "")
|
|
19
38
|
end
|
|
20
39
|
|
|
21
|
-
def
|
|
22
|
-
@uploads_url =
|
|
23
|
-
'https://uploads.api.shift4.com'
|
|
24
|
-
else
|
|
25
|
-
uploads_url.gsub(%r{/$}, "")
|
|
26
|
-
end
|
|
40
|
+
def uploads_url=(uploads_url)
|
|
41
|
+
@uploads_url = uploads_url.nil? ? 'https://uploads.api.shift4.com' : uploads_url.gsub(%r{/$}, "")
|
|
27
42
|
end
|
|
28
43
|
end
|
|
29
44
|
end
|
data/lib/shift4/credits.rb
CHANGED
|
@@ -4,20 +4,20 @@ module Shift4
|
|
|
4
4
|
class Credits
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.create(params)
|
|
8
|
-
communicator.post("#{
|
|
7
|
+
def self.create(params, config = Configuration)
|
|
8
|
+
communicator.post("#{config.api_url}/credits", json: params, config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.retrieve(credit_id)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.retrieve(credit_id, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/credits/#{credit_id}", config: config)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.update(credit_id, params)
|
|
16
|
-
communicator.post("#{
|
|
15
|
+
def self.update(credit_id, params, config = Configuration)
|
|
16
|
+
communicator.post("#{config.api_url}/credits/#{credit_id}", json: params, config: config)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.list(params = nil)
|
|
20
|
-
communicator.get("#{
|
|
19
|
+
def self.list(params = nil, config = Configuration)
|
|
20
|
+
communicator.get("#{config.api_url}/credits", query: params, config: config)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
end
|
data/lib/shift4/customers.rb
CHANGED
|
@@ -4,24 +4,24 @@ module Shift4
|
|
|
4
4
|
class Customers
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.create(params)
|
|
8
|
-
communicator.post("#{
|
|
7
|
+
def self.create(params, config = Configuration)
|
|
8
|
+
communicator.post("#{config.api_url}/customers", json: params, config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.retrieve(customer_id)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.retrieve(customer_id, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/customers/#{customer_id}", config: config)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.update(customer_id, params)
|
|
16
|
-
communicator.post("#{
|
|
15
|
+
def self.update(customer_id, params, config = Configuration)
|
|
16
|
+
communicator.post("#{config.api_url}/customers/#{customer_id}", json: params, config: config)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.delete(customer_id)
|
|
20
|
-
communicator.delete("#{
|
|
19
|
+
def self.delete(customer_id, config = Configuration)
|
|
20
|
+
communicator.delete("#{config.api_url}/customers/#{customer_id}", config: config)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def self.list(params = nil)
|
|
24
|
-
communicator.get("#{
|
|
23
|
+
def self.list(params = nil, config = Configuration)
|
|
24
|
+
communicator.get("#{config.api_url}/customers", query: params, config: config)
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
data/lib/shift4/disputes.rb
CHANGED
|
@@ -4,20 +4,20 @@ module Shift4
|
|
|
4
4
|
class Disputes
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.retrieve(dispute_id)
|
|
8
|
-
communicator.get("#{
|
|
7
|
+
def self.retrieve(dispute_id, config = Configuration)
|
|
8
|
+
communicator.get("#{config.api_url}/disputes/#{dispute_id}", config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.update(dispute_id, params)
|
|
12
|
-
communicator.post("#{
|
|
11
|
+
def self.update(dispute_id, params, config = Configuration)
|
|
12
|
+
communicator.post("#{config.api_url}/disputes/#{dispute_id}", json: params, config: config)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.close(dispute_id)
|
|
16
|
-
communicator.post("#{
|
|
15
|
+
def self.close(dispute_id, config = Configuration)
|
|
16
|
+
communicator.post("#{config.api_url}/disputes/#{dispute_id}/close", config: config)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.list(params = nil)
|
|
20
|
-
communicator.get("#{
|
|
19
|
+
def self.list(params = nil, config = Configuration)
|
|
20
|
+
communicator.get("#{config.api_url}/disputes", query: params, config: config)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
end
|
data/lib/shift4/events.rb
CHANGED
|
@@ -4,12 +4,12 @@ module Shift4
|
|
|
4
4
|
class Events
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.retrieve(event_id)
|
|
8
|
-
communicator.get("#{
|
|
7
|
+
def self.retrieve(event_id, config = Configuration)
|
|
8
|
+
communicator.get("#{config.api_url}/events/#{event_id}", config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.list(params = nil)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.list(params = nil, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/events", query: params, config: config)
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
end
|
data/lib/shift4/file_uploads.rb
CHANGED
|
@@ -4,17 +4,17 @@ module Shift4
|
|
|
4
4
|
class FileUploads
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.upload(file, params)
|
|
7
|
+
def self.upload(file, params, config = Configuration)
|
|
8
8
|
body = { file: file }.merge(params)
|
|
9
|
-
communicator.post("#{
|
|
9
|
+
communicator.post("#{config.uploads_url}/files", body: body, config: config)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def self.list(params = nil)
|
|
13
|
-
communicator.get("#{
|
|
12
|
+
def self.list(params = nil, config = Configuration)
|
|
13
|
+
communicator.get("#{config.uploads_url}/files", query: params, config: config)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def self.retrieve(file_upload_id)
|
|
17
|
-
communicator.get("#{
|
|
16
|
+
def self.retrieve(file_upload_id, config = Configuration)
|
|
17
|
+
communicator.get("#{config.uploads_url}/files/#{file_upload_id}", config: config)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -4,12 +4,12 @@ module Shift4
|
|
|
4
4
|
class FraudWarnings
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.retrieve(fraud_warning_id)
|
|
8
|
-
communicator.get("#{
|
|
7
|
+
def self.retrieve(fraud_warning_id, config = Configuration)
|
|
8
|
+
communicator.get("#{config.api_url}/fraud-warnings/#{fraud_warning_id}", config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.list(params = nil)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.list(params = nil, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/fraud-warnings", query: params, config: config)
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
end
|
|
@@ -4,20 +4,20 @@ module Shift4
|
|
|
4
4
|
class PaymentMethods
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.create(params)
|
|
8
|
-
communicator.post("#{
|
|
7
|
+
def self.create(params, config = Configuration)
|
|
8
|
+
communicator.post("#{config.api_url}/payment-methods", json: params, config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.retrieve(plan_id)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.retrieve(plan_id, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/payment-methods/#{plan_id}", config: config)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.delete(plan_id)
|
|
16
|
-
communicator.delete("#{
|
|
15
|
+
def self.delete(plan_id, config = Configuration)
|
|
16
|
+
communicator.delete("#{config.api_url}/payment-methods/#{plan_id}", config: config)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.list(params = nil)
|
|
20
|
-
communicator.get("#{
|
|
19
|
+
def self.list(params = nil, config = Configuration)
|
|
20
|
+
communicator.get("#{config.api_url}/payment-methods", query: params, config: config)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
end
|
data/lib/shift4/plans.rb
CHANGED
|
@@ -4,24 +4,24 @@ module Shift4
|
|
|
4
4
|
class Plans
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.create(params)
|
|
8
|
-
communicator.post("#{
|
|
7
|
+
def self.create(params, config = Configuration)
|
|
8
|
+
communicator.post("#{config.api_url}/plans", json: params, config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.retrieve(plan_id)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.retrieve(plan_id, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/plans/#{plan_id}", config: config)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.update(plan_id, params)
|
|
16
|
-
communicator.post("#{
|
|
15
|
+
def self.update(plan_id, params, config = Configuration)
|
|
16
|
+
communicator.post("#{config.api_url}/plans/#{plan_id}", json: params, config: config)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.delete(plan_id)
|
|
20
|
-
communicator.delete("#{
|
|
19
|
+
def self.delete(plan_id, config = Configuration)
|
|
20
|
+
communicator.delete("#{config.api_url}/plans/#{plan_id}", config: config)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def self.list(params = nil)
|
|
24
|
-
communicator.get("#{
|
|
23
|
+
def self.list(params = nil, config = Configuration)
|
|
24
|
+
communicator.get("#{config.api_url}/plans", query: params, config: config)
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
data/lib/shift4/subscriptions.rb
CHANGED
|
@@ -4,24 +4,24 @@ module Shift4
|
|
|
4
4
|
class Subscriptions
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.create(params)
|
|
8
|
-
communicator.post("#{
|
|
7
|
+
def self.create(params, config = Configuration)
|
|
8
|
+
communicator.post("#{config.api_url}/subscriptions", json: params, config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.retrieve(subscription_id)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.retrieve(subscription_id, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/subscriptions/#{subscription_id}", config: config)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def self.update(subscription_id, params)
|
|
16
|
-
communicator.post("#{
|
|
15
|
+
def self.update(subscription_id, params, config = Configuration)
|
|
16
|
+
communicator.post("#{config.api_url}/subscriptions/#{subscription_id}", json: params, config: config)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def self.cancel(subscription_id)
|
|
20
|
-
communicator.delete("#{
|
|
19
|
+
def self.cancel(subscription_id, config = Configuration)
|
|
20
|
+
communicator.delete("#{config.api_url}/subscriptions/#{subscription_id}", config: config)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def self.list(params = nil)
|
|
24
|
-
communicator.get("#{
|
|
23
|
+
def self.list(params = nil, config = Configuration)
|
|
24
|
+
communicator.get("#{config.api_url}/subscriptions", query: params, config: config)
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
data/lib/shift4/tokens.rb
CHANGED
|
@@ -4,12 +4,12 @@ module Shift4
|
|
|
4
4
|
class Tokens
|
|
5
5
|
extend TransactionBase
|
|
6
6
|
|
|
7
|
-
def self.create(params)
|
|
8
|
-
communicator.post("#{
|
|
7
|
+
def self.create(params, config = Configuration)
|
|
8
|
+
communicator.post("#{config.api_url}/tokens", json: params, config: config)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.retrieve(token_id)
|
|
12
|
-
communicator.get("#{
|
|
11
|
+
def self.retrieve(token_id, config = Configuration)
|
|
12
|
+
communicator.get("#{config.api_url}/tokens/#{token_id}", config: config)
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
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:
|
|
4
|
+
version: 2.0.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: 2023-11-09 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
|
|
@@ -211,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
211
210
|
- !ruby/object:Gem::Version
|
|
212
211
|
version: '0'
|
|
213
212
|
requirements: []
|
|
214
|
-
rubygems_version: 3.
|
|
213
|
+
rubygems_version: 3.4.10
|
|
215
214
|
signing_key:
|
|
216
215
|
specification_version: 4
|
|
217
216
|
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)
|
|
8
|
-
communicator.post("#{Configuration.api_url}/cross-sale-offers", json: params)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def self.retrieve(cross_sale_offer_id)
|
|
12
|
-
communicator.get("#{Configuration.api_url}/cross-sale-offers/#{cross_sale_offer_id}")
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def self.update(cross_sale_offer_id, params)
|
|
16
|
-
communicator.post("#{Configuration.api_url}/cross-sale-offers/#{cross_sale_offer_id}", json: params)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def self.delete(cross_sale_offer_id)
|
|
20
|
-
communicator.delete("#{Configuration.api_url}/cross-sale-offers/#{cross_sale_offer_id}")
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def self.list(params = nil)
|
|
24
|
-
communicator.get("#{Configuration.api_url}/cross-sale-offers", query: params)
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|