shift4 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/cross_sale_offers.rb +10 -10
- 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
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0978ba46e4ec7c2a473b8d26f7d0ead83a271c9aa7c6425ce50e59a7ad6e2deb'
|
4
|
+
data.tar.gz: fd28c39b5dff40dc896df38aa4e536e9a1d0548edc4674c97114533ce34577e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce9798a45ec15a56092293ffc3ec26387e1e112a0070c124a50ccfa8d4573d0159695fab9723cd9c8eafeb854b416349ff0e6d17b2a8b64276e37aa4b95b9780
|
7
|
+
data.tar.gz: dbc088cf95d86adea3f4625aa3c70ec3ab0a0b29451561d98058a05b9465925bb5162058dd5b6812c20bdde43c5f6a987b90a6cb8361b3b218d665aa66b068c4
|
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
|
@@ -4,24 +4,24 @@ module Shift4
|
|
4
4
|
class CrossSaleOffers
|
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}/cross-sale-offers", json: params, config: config)
|
9
9
|
end
|
10
10
|
|
11
|
-
def self.retrieve(cross_sale_offer_id)
|
12
|
-
communicator.get("#{
|
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
13
|
end
|
14
14
|
|
15
|
-
def self.update(cross_sale_offer_id, params)
|
16
|
-
communicator.post("#{
|
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
17
|
end
|
18
18
|
|
19
|
-
def self.delete(cross_sale_offer_id)
|
20
|
-
communicator.delete("#{
|
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
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}/cross-sale-offers", query: params, config: config)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
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
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.
|
4
|
+
version: 1.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: 2023-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -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.
|
214
|
+
rubygems_version: 3.4.10
|
215
215
|
signing_key:
|
216
216
|
specification_version: 4
|
217
217
|
summary: Shift4 Ruby Gem
|