pactas_itero 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/Gemfile.lock +65 -0
- data/lib/pactas_itero/api/contracts.rb +10 -0
- data/lib/pactas_itero/api/customers.rb +6 -1
- data/lib/pactas_itero/api/payment_transactions.rb +11 -0
- data/lib/pactas_itero/api/rated_items.rb +8 -0
- data/lib/pactas_itero/api.rb +2 -0
- data/lib/pactas_itero/version.rb +1 -1
- data/lib/pactas_itero.rb +10 -10
- data/spec/fixtures/contract_termination_response.json +79 -0
- data/spec/fixtures/payment_transaction.json +37 -0
- data/spec/fixtures/rated_items.json +12 -0
- data/spec/fixtures/self_service_token.json +6 -0
- data/spec/pactas_itero/api/contracts_spec.rb +47 -0
- data/spec/pactas_itero/api/customers_spec.rb +41 -0
- data/spec/pactas_itero/api/oauth_spec.rb +29 -25
- data/spec/pactas_itero/api/payment_transactions_spec.rb +66 -0
- data/spec/pactas_itero/api/rated_items_spec.rb +39 -0
- data/spec/pactas_itero_spec.rb +7 -0
- data/spec/spec_helper.rb +2 -2
- metadata +42 -36
- data/.gitignore +0 -39
- data/.hound.yml +0 -14
- data/.rubocop.yml +0 -2
- data/.ruby-style.yml +0 -268
- data/.travis.yml +0 -13
- data/pactas_itero.gemspec +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bc6c5dcbd7b3d3452d98aaa6fa08a4f2293a940
|
4
|
+
data.tar.gz: ab8d8da8107bf030a685408492e9c6811ebdde00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5041f67b356be598b7205fdfe4c108cfb83213ffce791f5970a0205129367bf4853381a358b615cafc60048d2ab68f2c67424b75a70c04b5aef17bbb49073b1d
|
7
|
+
data.tar.gz: 3783e55053dfb19c92296a7a890b94415be4ad7b45db4e99fd4b5243f490f74cf4e460b9fd9f9a08b84241a48d724ccd87ed6c2fb4e2e45ae06315de0d4a997d
|
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,29 @@
|
|
11
11
|
|
12
12
|
### Security
|
13
13
|
|
14
|
+
## [0.3.0] - 2017-09-04
|
15
|
+
### Added
|
16
|
+
- get a self service token for a given contract
|
17
|
+
- get a specific customer by id
|
18
|
+
- get and delete rated items
|
19
|
+
- get a specific payment transaction by id
|
20
|
+
- call to terminate a contract
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
- update version of jruby to 9.1.5.0
|
24
|
+
|
25
|
+
### Deprecated
|
26
|
+
|
27
|
+
### Removed
|
28
|
+
- support for ruby version 1.8.x and 1.9.x
|
29
|
+
- support for rubinius
|
30
|
+
|
31
|
+
### Fixed
|
32
|
+
- issue where stubbing the PactasItero.client method caused
|
33
|
+
a "Stack level too deep" error on rspec > 3.3
|
34
|
+
|
35
|
+
### Security
|
36
|
+
|
14
37
|
## [0.2.0] - 2016-02-04
|
15
38
|
### Added
|
16
39
|
- a changelog
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pactas_itero (0.2.0)
|
5
|
+
faraday_middleware (>= 0.9.1, < 0.12)
|
6
|
+
rash
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.5.0)
|
12
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
13
|
+
crack (0.4.3)
|
14
|
+
safe_yaml (~> 1.0.0)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
docile (1.1.5)
|
17
|
+
faraday (0.12.2)
|
18
|
+
multipart-post (>= 1.2, < 3)
|
19
|
+
faraday_middleware (0.11.0.1)
|
20
|
+
faraday (>= 0.7.4, < 1.0)
|
21
|
+
hashdiff (0.3.2)
|
22
|
+
hashie (2.0.5)
|
23
|
+
json (2.0.2)
|
24
|
+
multipart-post (2.0.0)
|
25
|
+
public_suffix (2.0.4)
|
26
|
+
rake (10.4.2)
|
27
|
+
rash (0.4.0)
|
28
|
+
hashie (~> 2.0.0)
|
29
|
+
rspec (3.6.0)
|
30
|
+
rspec-core (~> 3.6.0)
|
31
|
+
rspec-expectations (~> 3.6.0)
|
32
|
+
rspec-mocks (~> 3.6.0)
|
33
|
+
rspec-core (3.6.0)
|
34
|
+
rspec-support (~> 3.6.0)
|
35
|
+
rspec-expectations (3.6.0)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.6.0)
|
38
|
+
rspec-mocks (3.6.0)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.6.0)
|
41
|
+
rspec-support (3.6.0)
|
42
|
+
safe_yaml (1.0.4)
|
43
|
+
simplecov (0.12.0)
|
44
|
+
docile (~> 1.1.0)
|
45
|
+
json (>= 1.8, < 3)
|
46
|
+
simplecov-html (~> 0.10.0)
|
47
|
+
simplecov-html (0.10.0)
|
48
|
+
webmock (2.3.2)
|
49
|
+
addressable (>= 2.3.6)
|
50
|
+
crack (>= 0.3.2)
|
51
|
+
hashdiff
|
52
|
+
|
53
|
+
PLATFORMS
|
54
|
+
ruby
|
55
|
+
|
56
|
+
DEPENDENCIES
|
57
|
+
bundler
|
58
|
+
pactas_itero!
|
59
|
+
rake
|
60
|
+
rspec (~> 3.6.0)
|
61
|
+
simplecov (~> 0.12.0)
|
62
|
+
webmock (~> 2.3)
|
63
|
+
|
64
|
+
BUNDLED WITH
|
65
|
+
1.15.3
|
@@ -25,6 +25,16 @@ module PactasItero
|
|
25
25
|
options = options.camelize_keys
|
26
26
|
get "api/v1/contracts/#{contract_id}/cancellationPreview", options
|
27
27
|
end
|
28
|
+
|
29
|
+
def get_self_service_token_for_contract(contract_id, options = {})
|
30
|
+
options = options.camelize_keys
|
31
|
+
get "api/v1/contracts/#{contract_id}/SelfServiceToken", options
|
32
|
+
end
|
33
|
+
|
34
|
+
def terminate_contract(contract_id, options = {})
|
35
|
+
options = options.camelize_keys
|
36
|
+
post "api/v1/contracts/#{contract_id}/end", options
|
37
|
+
end
|
28
38
|
end
|
29
39
|
end
|
30
40
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module PactasItero
|
2
2
|
module Api
|
3
3
|
module Customers
|
4
|
-
def create_customer(options= {})
|
4
|
+
def create_customer(options = {})
|
5
5
|
options = options.camelize_keys
|
6
6
|
post "api/v1/customers", options
|
7
7
|
end
|
@@ -11,6 +11,11 @@ module PactasItero
|
|
11
11
|
get "api/v1/customers", options
|
12
12
|
end
|
13
13
|
|
14
|
+
def customer(customer_id, options = {})
|
15
|
+
options = options.camelize_keys
|
16
|
+
get "api/v1/customers/#{customer_id}", options
|
17
|
+
end
|
18
|
+
|
14
19
|
def update_customer(customer_id, options = {})
|
15
20
|
options = options.camelize_keys
|
16
21
|
patch "api/v1/customers/#{customer_id}", options
|
@@ -11,6 +11,14 @@ module PactasItero
|
|
11
11
|
options = options.camelize_keys
|
12
12
|
post "api/v1/contracts/#{contract_id}/ratedItems", options
|
13
13
|
end
|
14
|
+
|
15
|
+
def rated_items(contract_id)
|
16
|
+
get "api/v1/contracts/#{contract_id}/ratedItems"
|
17
|
+
end
|
18
|
+
|
19
|
+
def delete_rated_item(rated_item_id)
|
20
|
+
delete "api/v1/ratedItems/#{rated_item_id}"
|
21
|
+
end
|
14
22
|
end
|
15
23
|
end
|
16
24
|
end
|
data/lib/pactas_itero/api.rb
CHANGED
@@ -5,6 +5,7 @@ require 'pactas_itero/api/customers'
|
|
5
5
|
require 'pactas_itero/api/contracts'
|
6
6
|
require 'pactas_itero/api/orders'
|
7
7
|
require 'pactas_itero/api/invoices'
|
8
|
+
require "pactas_itero/api/payment_transactions"
|
8
9
|
|
9
10
|
module PactasItero
|
10
11
|
module Api
|
@@ -14,5 +15,6 @@ module PactasItero
|
|
14
15
|
include PactasItero::Api::Contracts
|
15
16
|
include PactasItero::Api::Orders
|
16
17
|
include PactasItero::Api::Invoices
|
18
|
+
include PactasItero::Api::PaymentTransactions
|
17
19
|
end
|
18
20
|
end
|
data/lib/pactas_itero/version.rb
CHANGED
data/lib/pactas_itero.rb
CHANGED
@@ -2,7 +2,6 @@ require 'pactas_itero/client'
|
|
2
2
|
require 'pactas_itero/default'
|
3
3
|
|
4
4
|
module PactasItero
|
5
|
-
|
6
5
|
class << self
|
7
6
|
include PactasItero::Configurable
|
8
7
|
|
@@ -10,20 +9,21 @@ module PactasItero
|
|
10
9
|
#
|
11
10
|
# @return [PactasItero::Client] API wrapper
|
12
11
|
def client
|
13
|
-
|
14
|
-
@client
|
12
|
+
PactasItero::Client.new(options)
|
15
13
|
end
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
def respond_to?(method_name, include_private=false); client.respond_to?(method_name, include_private) || super; end if RUBY_VERSION < "1.9"
|
15
|
+
def respond_to_missing?(method_name, include_private = false)
|
16
|
+
method_name != :client && client.respond_to?(method_name, include_private) || super
|
17
|
+
end
|
21
18
|
|
22
|
-
|
19
|
+
private
|
23
20
|
|
24
21
|
def method_missing(method_name, *args, &block)
|
25
|
-
|
26
|
-
|
22
|
+
if method_name != :client && client.respond_to?(method_name)
|
23
|
+
client.send(method_name, *args, &block)
|
24
|
+
else
|
25
|
+
super
|
26
|
+
end
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
{
|
2
|
+
"ContractAfter": {
|
3
|
+
"Balance": -7.27,
|
4
|
+
"BilledUntil": "2017-09-30T22:00:00.0000000Z",
|
5
|
+
"BillingSuspended": false,
|
6
|
+
"Currency": "EUR",
|
7
|
+
"CurrentPhase": {
|
8
|
+
"PlanId": "5357b8561d8dd00fa0db6c19",
|
9
|
+
"PlanVariantId": "5357b8f11d8dd00fa0db6c1b",
|
10
|
+
"Quantity": 1,
|
11
|
+
"StartDate": "2017-08-08T12:30:39.8320000Z",
|
12
|
+
"Type": "Normal"
|
13
|
+
},
|
14
|
+
"CustomFields": {},
|
15
|
+
"CustomerId": "5922f1eeba5c1e0570f72e04",
|
16
|
+
"CustomerName": "Musterfirma",
|
17
|
+
"EndDate": "2017-10-01T14:51:29.3390000Z",
|
18
|
+
"EscalationSuspended": false,
|
19
|
+
"Id": "5922f50b81b1f007e0e4d738",
|
20
|
+
"IsDeletable": false,
|
21
|
+
"LastBillingDate": "2017-08-31T22:00:00.0000000Z",
|
22
|
+
"LifecycleStatus": "Active",
|
23
|
+
"NextBillingDate": "2017-09-30T22:00:00.0000000Z",
|
24
|
+
"PaymentProvider": "PayOne",
|
25
|
+
"PaymentProviderRole": "OnAccount",
|
26
|
+
"PaymentProviderSupportRefunds": true,
|
27
|
+
"Phases": [
|
28
|
+
{
|
29
|
+
"PlanId": "5357b8561d8dd00fa0db6c19",
|
30
|
+
"PlanVariantId": "5357b8f11d8dd00fa0db6c1b",
|
31
|
+
"Quantity": 1,
|
32
|
+
"StartDate": "2017-05-22T14:26:19.6390000Z",
|
33
|
+
"Type": "Normal"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"StartDate": "2017-05-22T14:26:20.0000000Z",
|
37
|
+
"Type": "Inactive"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"PlanId": "5357b8561d8dd00fa0db6c19",
|
41
|
+
"PlanVariantId": "5357b8f11d8dd00fa0db6c1b",
|
42
|
+
"Quantity": 1,
|
43
|
+
"StartDate": "2017-08-08T12:30:39.8320000Z",
|
44
|
+
"Type": "Normal"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"StartDate": "2017-10-01T14:51:29.3390000Z",
|
48
|
+
"Type": "Inactive"
|
49
|
+
}
|
50
|
+
],
|
51
|
+
"PlanGroupId": "53567a731d8dd00df056564a",
|
52
|
+
"PlanId": "5357b8561d8dd00fa0db6c19",
|
53
|
+
"PlanVariantId": "5357b8f11d8dd00fa0db6c1b",
|
54
|
+
"RecurringPaymentsPaused": false,
|
55
|
+
"ReferenceCode": "NYXC-NPXH",
|
56
|
+
"StartDate": "2017-05-22T14:26:19.6390000Z"
|
57
|
+
},
|
58
|
+
"EndDate": "2017-10-01T14:51:29.3390000Z",
|
59
|
+
"Invoice": {
|
60
|
+
"ContractId": "5922f50b81b1f007e0e4d738",
|
61
|
+
"CustomerId": "5922f1eeba5c1e0570f72e04",
|
62
|
+
"ExternalCustomerId": "a0979458",
|
63
|
+
"ItemList": [],
|
64
|
+
"RecipientAddress": {
|
65
|
+
"City": "Musterstadt",
|
66
|
+
"Country": "DE",
|
67
|
+
"HouseNumber": "123",
|
68
|
+
"PostalCode": "12345",
|
69
|
+
"Street": "Musterstraße, 123"
|
70
|
+
},
|
71
|
+
"RecipientName": "Musterfirma",
|
72
|
+
"RecipientSubName": "Max Mustermann",
|
73
|
+
"ReverseCharge": false,
|
74
|
+
"TotalGross": 0,
|
75
|
+
"TotalNet": 0,
|
76
|
+
"TotalVat": 0,
|
77
|
+
"VatDescriptors": []
|
78
|
+
}
|
79
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"Amount": 11.89,
|
3
|
+
"ContractId": "592d74a981b1f010f04293a4",
|
4
|
+
"Currency": "EUR",
|
5
|
+
"CustomerId": "592d74a881b1f010f04293a2",
|
6
|
+
"CustomerName": "Example Company",
|
7
|
+
"Id": "597de03d81b1ef0d18a46f4e",
|
8
|
+
"PaymentProvider": "Example Provider",
|
9
|
+
"PaymentProviderRole": "CreditCard",
|
10
|
+
"Preauth": false,
|
11
|
+
"ProviderTransactionId": "ccec718e-271e-4d0e-b0e1-94894e40c0c7",
|
12
|
+
"Status": {
|
13
|
+
"Amount": 11.89,
|
14
|
+
"HttpCode": 0,
|
15
|
+
"Preauth": false,
|
16
|
+
"Status": "Succeeded",
|
17
|
+
"Timestamp": "2017-07-30T13:33:49.9900000Z"
|
18
|
+
},
|
19
|
+
"StatusHistory": [
|
20
|
+
{
|
21
|
+
"Amount": 11.89,
|
22
|
+
"HttpCode": 0,
|
23
|
+
"Preauth": false,
|
24
|
+
"Status": "InProgress",
|
25
|
+
"Timestamp": "2017-07-30T13:33:49.9760000Z"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"Amount": 11.89,
|
29
|
+
"HttpCode": 0,
|
30
|
+
"Preauth": false,
|
31
|
+
"Status": "Succeeded",
|
32
|
+
"Timestamp": "2017-07-30T13:33:49.9900000Z"
|
33
|
+
}
|
34
|
+
],
|
35
|
+
"StatusTimestamp": "2017-07-30T13:33:49.9900000Z",
|
36
|
+
"Trigger": "Recurring"
|
37
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"id": "591b847314aa03167c5a3b08",
|
4
|
+
"line_item_id": "59308e9781b1ef1190f21478",
|
5
|
+
"description": "1x DHL Versandmarken",
|
6
|
+
"quantity": 1,
|
7
|
+
"price_per_unit": 3.9,
|
8
|
+
"tax_policy_id": "tax-policy-id",
|
9
|
+
"period_start": "2017-05-15T22:00:00.0000000Z",
|
10
|
+
"period_end": "2017-05-15T22:00:00.0000000Z"
|
11
|
+
}
|
12
|
+
]
|
@@ -115,4 +115,51 @@ describe PactasItero::Api::Customers do
|
|
115
115
|
expect(request).to have_been_made
|
116
116
|
end
|
117
117
|
end
|
118
|
+
|
119
|
+
describe ".terminate_contract" do
|
120
|
+
it "requests the correct resource" do
|
121
|
+
client = PactasItero::Client.new(bearer_token: "bt")
|
122
|
+
request = stub_post("/api/v1/contracts/5922f50b81b1f007e0e4d738/end").
|
123
|
+
with(
|
124
|
+
body: { EndDate: "2017-10-01T14:51:29.3390000Z" }.to_json,
|
125
|
+
).
|
126
|
+
to_return(
|
127
|
+
body: fixture("contract_termination_response.json"),
|
128
|
+
headers: { content_type: "application/json; charset=utf-8" },
|
129
|
+
)
|
130
|
+
|
131
|
+
client.terminate_contract(
|
132
|
+
"5922f50b81b1f007e0e4d738",
|
133
|
+
end_date: "2017-10-01T14:51:29.3390000Z",
|
134
|
+
)
|
135
|
+
|
136
|
+
expect(request).to have_been_made
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
describe ".get_self_service_token_for_contract" do
|
141
|
+
it "requests the correct resource" do
|
142
|
+
client = PactasItero::Client.new(bearer_token: "bt")
|
143
|
+
request = stub_get("/api/v1/contracts/5357bc4f1d8dd00fa0db6c31/SelfServiceToken").to_return(
|
144
|
+
body: fixture("self_service_token.json"),
|
145
|
+
headers: { content_type: "application/json; charset=utf-8" },
|
146
|
+
)
|
147
|
+
|
148
|
+
client.get_self_service_token_for_contract("5357bc4f1d8dd00fa0db6c31")
|
149
|
+
|
150
|
+
expect(request).to have_been_made
|
151
|
+
end
|
152
|
+
|
153
|
+
it "returns a self service token" do
|
154
|
+
client = PactasItero::Client.new(bearer_token: "bt")
|
155
|
+
stub_get("/api/v1/contracts/5357bc4f1d8dd00fa0db6c31/SelfServiceToken").to_return(
|
156
|
+
body: fixture("self_service_token.json"),
|
157
|
+
headers: { content_type: "application/json; charset=utf-8" },
|
158
|
+
)
|
159
|
+
|
160
|
+
self_service_token = client.get_self_service_token_for_contract("5357bc4f1d8dd00fa0db6c31")
|
161
|
+
|
162
|
+
expect(self_service_token.token).to eq "522703b9eb596a0f40480825$1378374980$JDBWmg34kr_mFIUFP"
|
163
|
+
end
|
164
|
+
end
|
118
165
|
end
|
@@ -160,6 +160,47 @@ describe PactasItero::Api::Customers do
|
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
163
|
+
describe ".customer" do
|
164
|
+
it "requests the correct resource" do
|
165
|
+
client = PactasItero::Client.new(bearer_token: "bearer_token")
|
166
|
+
request = stub_get("/api/v1/customers/customer-id").to_return(
|
167
|
+
body: fixture("customer.json"),
|
168
|
+
headers: { content_type: "application/json; charset=utf-8" },
|
169
|
+
)
|
170
|
+
|
171
|
+
client.customer("customer-id")
|
172
|
+
|
173
|
+
expect(request).to have_been_made
|
174
|
+
end
|
175
|
+
|
176
|
+
it "returns the customer details" do
|
177
|
+
client = PactasItero::Client.new(bearer_token: "bearer_token")
|
178
|
+
stub_get("/api/v1/customers/customer-id").to_return(
|
179
|
+
body: fixture("customer.json"),
|
180
|
+
headers: { content_type: "application/json; charset=utf-8" },
|
181
|
+
)
|
182
|
+
|
183
|
+
customer = client.customer("customer-id")
|
184
|
+
|
185
|
+
address = customer.address
|
186
|
+
expect(address.city).to eq "Example City"
|
187
|
+
expect(address.country).to eq "DE"
|
188
|
+
expect(address.house_number).to eq "42"
|
189
|
+
expect(address.postal_code).to eq "12345"
|
190
|
+
expect(address.street).to eq "Example Street"
|
191
|
+
|
192
|
+
expect(customer.company_name).to eq "Example Company"
|
193
|
+
expect(customer.default_bearer_medium).to eq"Email"
|
194
|
+
expect(customer.email_address).to eq "jane.doe@example.com"
|
195
|
+
expect(customer.external_customer_id).to eq "1234"
|
196
|
+
expect(customer.first_name).to eq "Jane"
|
197
|
+
expect(customer.language).to eq "de-DE"
|
198
|
+
expect(customer.last_name).to eq "Doe"
|
199
|
+
expect(customer.locale).to eq "de-DE"
|
200
|
+
expect(customer.vat_id).to eq "DE123456710"
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
163
204
|
describe '.update_customer' do
|
164
205
|
it 'requests the correct resource' do
|
165
206
|
client = PactasItero::Client.new(bearer_token: 'bt')
|
@@ -1,39 +1,43 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe PactasItero::Api::OAuth do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
:headers => {
|
13
|
-
:content_type => 'application/json; charset=utf-8'
|
14
|
-
}
|
4
|
+
describe "#token" do
|
5
|
+
it "requests the correct resource" do
|
6
|
+
client_credentials_request = stub_post("https://sandbox.billwerk.com/oauth/token").with(
|
7
|
+
basic_auth: %w(a_client_id a_client_secret),
|
8
|
+
body: "grant_type=client_credentials",
|
9
|
+
headers: {
|
10
|
+
"Content-Type" => "application/x-www-form-urlencoded; charset=UTF-8",
|
11
|
+
},
|
15
12
|
)
|
16
|
-
end
|
17
13
|
|
18
|
-
|
19
|
-
client = PactasItero::Client.new(client_id: 'a_client_id', client_secret: 'a_client_secret')
|
14
|
+
client = PactasItero::Client.new(client_id: "a_client_id", client_secret: "a_client_secret")
|
20
15
|
|
21
16
|
client.token
|
22
17
|
|
23
|
-
expect(
|
24
|
-
:body => "grant_type=client_credentials",
|
25
|
-
:headers => {
|
26
|
-
'Content-Type'=>'application/x-www-form-urlencoded; charset=UTF-8'
|
27
|
-
}
|
28
|
-
)).to have_been_made
|
18
|
+
expect(client_credentials_request).to have_been_made
|
29
19
|
end
|
30
20
|
|
31
|
-
it
|
32
|
-
|
21
|
+
it "returns the bearer token" do
|
22
|
+
stub_post("https://sandbox.billwerk.com/oauth/token").with(
|
23
|
+
basic_auth: %w(a_client_id a_client_secret),
|
24
|
+
body: "grant_type=client_credentials",
|
25
|
+
headers: {
|
26
|
+
"Content-Type" => "application/x-www-form-urlencoded; charset=UTF-8",
|
27
|
+
},
|
28
|
+
).to_return(
|
29
|
+
status: 200,
|
30
|
+
body: fixture("bearer_token.json"),
|
31
|
+
headers: {
|
32
|
+
content_type: "application/json; charset=utf-8",
|
33
|
+
},
|
34
|
+
)
|
35
|
+
|
36
|
+
client = PactasItero::Client.new(client_id: "a_client_id", client_secret: "a_client_secret")
|
33
37
|
bearer_token = client.token
|
34
38
|
|
35
|
-
expect(bearer_token.access_token).to eq(
|
36
|
-
expect(bearer_token.token_type).to eq(
|
39
|
+
expect(bearer_token.access_token).to eq("top_secret_access_token")
|
40
|
+
expect(bearer_token.token_type).to eq("bearer")
|
37
41
|
expect(bearer_token.expires).to eq(0)
|
38
42
|
end
|
39
43
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe PactasItero::Api::PaymentTransactions do
|
5
|
+
describe ".payment_transaction" do
|
6
|
+
it "requests the correct resource" do
|
7
|
+
client = PactasItero::Client.new(bearer_token: "bearer_token")
|
8
|
+
request = stub_get("/api/v1/PaymentTransactions/payment_transaction_id").to_return(
|
9
|
+
body: fixture("payment_transaction.json"),
|
10
|
+
headers: { content_type: "application/json; charset=utf-8" },
|
11
|
+
)
|
12
|
+
|
13
|
+
client.payment_transaction("payment_transaction_id")
|
14
|
+
|
15
|
+
expect(request).to have_been_made
|
16
|
+
end
|
17
|
+
|
18
|
+
it "returns the payment transaction details" do
|
19
|
+
client = PactasItero::Client.new(bearer_token: "bearer_token")
|
20
|
+
stub_get("/api/v1/PaymentTransactions/payment_transaction_id").to_return(
|
21
|
+
body: fixture("payment_transaction.json"),
|
22
|
+
headers: { content_type: "application/json; charset=utf-8" },
|
23
|
+
)
|
24
|
+
|
25
|
+
transaction = client.payment_transaction("payment_transaction_id")
|
26
|
+
|
27
|
+
expect(transaction.amount).to eq 11.89
|
28
|
+
expect(transaction.contract_id).to eq "592d74a981b1f010f04293a4"
|
29
|
+
expect(transaction.currency).to eq "EUR"
|
30
|
+
expect(transaction.customer_id).to eq "592d74a881b1f010f04293a2"
|
31
|
+
expect(transaction.customer_name).to eq "Example Company"
|
32
|
+
expect(transaction.id).to eq "597de03d81b1ef0d18a46f4e"
|
33
|
+
expect(transaction.payment_provider).to eq "Example Provider"
|
34
|
+
expect(transaction.payment_provider_role).to eq "CreditCard"
|
35
|
+
expect(transaction.preauth).to eq false
|
36
|
+
expect(transaction.provider_transaction_id).to eq "ccec718e-271e-4d0e-b0e1-94894e40c0c7"
|
37
|
+
expect(transaction.status).to eq(
|
38
|
+
"amount" => 11.89,
|
39
|
+
"http_code" => 0,
|
40
|
+
"preauth" => false,
|
41
|
+
"status" => "Succeeded",
|
42
|
+
"timestamp" => "2017-07-30T13:33:49.9900000Z",
|
43
|
+
)
|
44
|
+
expect(transaction.status_history).to eq(
|
45
|
+
[
|
46
|
+
{
|
47
|
+
"amount" => 11.89,
|
48
|
+
"http_code" => 0,
|
49
|
+
"preauth" => false,
|
50
|
+
"status" => "InProgress",
|
51
|
+
"timestamp" => "2017-07-30T13:33:49.9760000Z",
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"amount" => 11.89,
|
55
|
+
"http_code" => 0,
|
56
|
+
"preauth" => false,
|
57
|
+
"status" => "Succeeded",
|
58
|
+
"timestamp" => "2017-07-30T13:33:49.9900000Z",
|
59
|
+
},
|
60
|
+
],
|
61
|
+
)
|
62
|
+
expect(transaction.status_timestamp).to eq "2017-07-30T13:33:49.9900000Z"
|
63
|
+
expect(transaction.trigger).to eq "Recurring"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -71,4 +71,43 @@ describe PactasItero::Api::RatedItems do
|
|
71
71
|
expect(rated_item.tax_policy_id).to eq 'tax-policy-id'
|
72
72
|
end
|
73
73
|
end
|
74
|
+
|
75
|
+
describe ".rated_items" do
|
76
|
+
it "returns rated items" do
|
77
|
+
client = PactasItero::Client.new(bearer_token: 'bt')
|
78
|
+
stub_get("/api/v1/contracts/contract-id/ratedItems").
|
79
|
+
to_return(
|
80
|
+
body: fixture("rated_items.json"),
|
81
|
+
headers: { content_type: "application/json; charset=utf-8"}
|
82
|
+
)
|
83
|
+
|
84
|
+
rated_items = client.rated_items("contract-id")
|
85
|
+
|
86
|
+
expect(rated_items).to be_a Array
|
87
|
+
rated_item = rated_items.first
|
88
|
+
expect(rated_item.id).to eq "591b847314aa03167c5a3b08"
|
89
|
+
expect(rated_item.line_item_id).to eq "59308e9781b1ef1190f21478"
|
90
|
+
expect(rated_item.quantity).to eq 1
|
91
|
+
expect(rated_item.price_per_unit).to eq 3.9
|
92
|
+
expect(rated_item.tax_policy_id).to eq "tax-policy-id"
|
93
|
+
expect(rated_item.description).to eq "1x DHL Versandmarken"
|
94
|
+
expect(rated_item.period_end).to eq "2017-05-15T22:00:00.0000000Z"
|
95
|
+
expect(rated_item.period_start).to eq "2017-05-15T22:00:00.0000000Z"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
describe ".delete_rated_item" do
|
100
|
+
it "deletes a rated item" do
|
101
|
+
client = PactasItero::Client.new(bearer_token: 'bt')
|
102
|
+
stub_delete("/api/v1/ratedItems/rated-item-id").
|
103
|
+
to_return(
|
104
|
+
body: "",
|
105
|
+
headers: { content_type: "application/json; charset=utf-8"}
|
106
|
+
)
|
107
|
+
|
108
|
+
response = client.delete_rated_item("rated-item-id")
|
109
|
+
|
110
|
+
expect(response).to be_nil
|
111
|
+
end
|
112
|
+
end
|
74
113
|
end
|
data/spec/pactas_itero_spec.rb
CHANGED
@@ -16,6 +16,13 @@ describe PactasItero do
|
|
16
16
|
it "creates new client everytime" do
|
17
17
|
expect(PactasItero.client).to_not eq(PactasItero.client)
|
18
18
|
end
|
19
|
+
|
20
|
+
it "allows stubbing the method" do
|
21
|
+
pactas_client = instance_double(PactasItero::Client)
|
22
|
+
allow(PactasItero).to receive(:client).and_return(pactas_client)
|
23
|
+
|
24
|
+
expect(PactasItero.client).to be_kind_of RSpec::Mocks::InstanceVerifyingDouble
|
25
|
+
end
|
19
26
|
end
|
20
27
|
|
21
28
|
describe ".configure" do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,119 +1,119 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pactas_itero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Fröhler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday_middleware
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.9.1
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0.12'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 0.9.1
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.12'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rash
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0
|
39
|
+
version: '0'
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - "
|
44
|
+
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0
|
46
|
+
version: '0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: bundler
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
|
-
- - "
|
51
|
+
- - ">="
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
53
|
+
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
|
-
- - "
|
58
|
+
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rake
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
|
-
- - "
|
65
|
+
- - ">="
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
67
|
+
version: '0'
|
62
68
|
type: :development
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
|
-
- - "
|
72
|
+
- - ">="
|
67
73
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
74
|
+
version: '0'
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: rspec
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
79
|
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
81
|
+
version: 3.6.0
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
88
|
+
version: 3.6.0
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: simplecov
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
86
92
|
requirements:
|
87
93
|
- - "~>"
|
88
94
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
95
|
+
version: 0.15.0
|
90
96
|
type: :development
|
91
97
|
prerelease: false
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
93
99
|
requirements:
|
94
100
|
- - "~>"
|
95
101
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
102
|
+
version: 0.15.0
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: webmock
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
100
106
|
requirements:
|
101
107
|
- - "~>"
|
102
108
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
104
|
-
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: 1.18.0
|
109
|
+
version: '2.3'
|
107
110
|
type: :development
|
108
111
|
prerelease: false
|
109
112
|
version_requirements: !ruby/object:Gem::Requirement
|
110
113
|
requirements:
|
111
114
|
- - "~>"
|
112
115
|
- !ruby/object:Gem::Version
|
113
|
-
version: '
|
114
|
-
- - ">="
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: 1.18.0
|
116
|
+
version: '2.3'
|
117
117
|
description: |-
|
118
118
|
pactas_itero provides a client mapping for accessing
|
119
119
|
the Pactas Itero API, making it easy to post your data to, adn read your
|
@@ -123,13 +123,9 @@ executables: []
|
|
123
123
|
extensions: []
|
124
124
|
extra_rdoc_files: []
|
125
125
|
files:
|
126
|
-
- ".gitignore"
|
127
|
-
- ".hound.yml"
|
128
|
-
- ".rubocop.yml"
|
129
|
-
- ".ruby-style.yml"
|
130
|
-
- ".travis.yml"
|
131
126
|
- CHANGELOG.md
|
132
127
|
- Gemfile
|
128
|
+
- Gemfile.lock
|
133
129
|
- LICENSE.txt
|
134
130
|
- README.md
|
135
131
|
- Rakefile
|
@@ -140,6 +136,7 @@ files:
|
|
140
136
|
- lib/pactas_itero/api/invoices.rb
|
141
137
|
- lib/pactas_itero/api/oauth.rb
|
142
138
|
- lib/pactas_itero/api/orders.rb
|
139
|
+
- lib/pactas_itero/api/payment_transactions.rb
|
143
140
|
- lib/pactas_itero/api/rated_items.rb
|
144
141
|
- lib/pactas_itero/client.rb
|
145
142
|
- lib/pactas_itero/configurable.rb
|
@@ -148,11 +145,11 @@ files:
|
|
148
145
|
- lib/pactas_itero/ext/hash/camelize_keys.rb
|
149
146
|
- lib/pactas_itero/response/raise_error.rb
|
150
147
|
- lib/pactas_itero/version.rb
|
151
|
-
- pactas_itero.gemspec
|
152
148
|
- spec/fixtures/bearer_token.json
|
153
149
|
- spec/fixtures/commit_order_response.json
|
154
150
|
- spec/fixtures/contract.json
|
155
151
|
- spec/fixtures/contract_cancellation_preview_response.json
|
152
|
+
- spec/fixtures/contract_termination_response.json
|
156
153
|
- spec/fixtures/contracts.json
|
157
154
|
- spec/fixtures/create_order_response.json
|
158
155
|
- spec/fixtures/create_rated_item.json
|
@@ -161,11 +158,15 @@ files:
|
|
161
158
|
- spec/fixtures/invoice.json
|
162
159
|
- spec/fixtures/invoices.json
|
163
160
|
- spec/fixtures/order.json
|
161
|
+
- spec/fixtures/payment_transaction.json
|
162
|
+
- spec/fixtures/rated_items.json
|
163
|
+
- spec/fixtures/self_service_token.json
|
164
164
|
- spec/pactas_itero/api/contracts_spec.rb
|
165
165
|
- spec/pactas_itero/api/customers_spec.rb
|
166
166
|
- spec/pactas_itero/api/invoices_spec.rb
|
167
167
|
- spec/pactas_itero/api/oauth_spec.rb
|
168
168
|
- spec/pactas_itero/api/orders_spec.rb
|
169
|
+
- spec/pactas_itero/api/payment_transactions_spec.rb
|
169
170
|
- spec/pactas_itero/api/rated_items_spec.rb
|
170
171
|
- spec/pactas_itero/client_spec.rb
|
171
172
|
- spec/pactas_itero_spec.rb
|
@@ -182,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
183
|
requirements:
|
183
184
|
- - ">="
|
184
185
|
- !ruby/object:Gem::Version
|
185
|
-
version: '0'
|
186
|
+
version: '2.0'
|
186
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
188
|
requirements:
|
188
189
|
- - ">="
|
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
191
|
version: '0'
|
191
192
|
requirements: []
|
192
193
|
rubyforge_project:
|
193
|
-
rubygems_version: 2.
|
194
|
+
rubygems_version: 2.6.13
|
194
195
|
signing_key:
|
195
196
|
specification_version: 4
|
196
197
|
summary: pactas_itero provides a client mapping for accessing the Pactas Itero API.
|
@@ -199,6 +200,7 @@ test_files:
|
|
199
200
|
- spec/fixtures/commit_order_response.json
|
200
201
|
- spec/fixtures/contract.json
|
201
202
|
- spec/fixtures/contract_cancellation_preview_response.json
|
203
|
+
- spec/fixtures/contract_termination_response.json
|
202
204
|
- spec/fixtures/contracts.json
|
203
205
|
- spec/fixtures/create_order_response.json
|
204
206
|
- spec/fixtures/create_rated_item.json
|
@@ -207,11 +209,15 @@ test_files:
|
|
207
209
|
- spec/fixtures/invoice.json
|
208
210
|
- spec/fixtures/invoices.json
|
209
211
|
- spec/fixtures/order.json
|
212
|
+
- spec/fixtures/payment_transaction.json
|
213
|
+
- spec/fixtures/rated_items.json
|
214
|
+
- spec/fixtures/self_service_token.json
|
210
215
|
- spec/pactas_itero/api/contracts_spec.rb
|
211
216
|
- spec/pactas_itero/api/customers_spec.rb
|
212
217
|
- spec/pactas_itero/api/invoices_spec.rb
|
213
218
|
- spec/pactas_itero/api/oauth_spec.rb
|
214
219
|
- spec/pactas_itero/api/orders_spec.rb
|
220
|
+
- spec/pactas_itero/api/payment_transactions_spec.rb
|
215
221
|
- spec/pactas_itero/api/rated_items_spec.rb
|
216
222
|
- spec/pactas_itero/client_spec.rb
|
217
223
|
- spec/pactas_itero_spec.rb
|
data/.gitignore
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# Created by https://www.gitignore.io/api/ruby
|
2
|
-
|
3
|
-
### Ruby ###
|
4
|
-
*.gem
|
5
|
-
*.rbc
|
6
|
-
/.config
|
7
|
-
/coverage/
|
8
|
-
/InstalledFiles
|
9
|
-
/pkg/
|
10
|
-
/spec/reports/
|
11
|
-
/spec/examples.txt
|
12
|
-
/test/tmp/
|
13
|
-
/test/version_tmp/
|
14
|
-
/tmp/
|
15
|
-
|
16
|
-
## Specific to RubyMotion:
|
17
|
-
.dat*
|
18
|
-
.repl_history
|
19
|
-
build/
|
20
|
-
|
21
|
-
## Documentation cache and generated files:
|
22
|
-
/.yardoc/
|
23
|
-
/_yardoc/
|
24
|
-
/doc/
|
25
|
-
/rdoc/
|
26
|
-
|
27
|
-
## Environment normalisation:
|
28
|
-
/.bundle/
|
29
|
-
/vendor/bundle
|
30
|
-
/lib/bundler/man/
|
31
|
-
|
32
|
-
# for a library or gem, you might want to ignore these files since the code is
|
33
|
-
# intended to run in multiple environments; otherwise, check them in:
|
34
|
-
Gemfile.lock
|
35
|
-
.ruby-version
|
36
|
-
.ruby-gemset
|
37
|
-
|
38
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
39
|
-
.rvmrc
|
data/.hound.yml
DELETED
data/.rubocop.yml
DELETED
data/.ruby-style.yml
DELETED
@@ -1,268 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
TargetRubyVersion: 2.1
|
3
|
-
Exclude:
|
4
|
-
- "vendor/**/*"
|
5
|
-
- "db/schema.rb"
|
6
|
-
UseCache: false
|
7
|
-
Rails:
|
8
|
-
Enabled: true
|
9
|
-
Rails/FindBy:
|
10
|
-
Enabled: false
|
11
|
-
Metrics/LineLength:
|
12
|
-
Max: 100
|
13
|
-
Style/CollectionMethods:
|
14
|
-
Description: Preferred collection methods.
|
15
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
16
|
-
Enabled: true
|
17
|
-
PreferredMethods:
|
18
|
-
collect: map
|
19
|
-
collect!: map!
|
20
|
-
find: detect
|
21
|
-
find_all: select
|
22
|
-
reduce: inject
|
23
|
-
Style/DotPosition:
|
24
|
-
Description: Checks the position of the dot in multi-line method calls.
|
25
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
26
|
-
Enabled: true
|
27
|
-
EnforcedStyle: trailing
|
28
|
-
SupportedStyles:
|
29
|
-
- trailing
|
30
|
-
Style/FileName:
|
31
|
-
Description: Use snake_case for source file names.
|
32
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
33
|
-
Enabled: false
|
34
|
-
Exclude: []
|
35
|
-
Style/FirstArrayElementLineBreak:
|
36
|
-
Description: >-
|
37
|
-
Checks for a line break before the first element in a
|
38
|
-
multi-line array.
|
39
|
-
Enabled: true
|
40
|
-
Style/FirstHashElementLineBreak:
|
41
|
-
Description: >-
|
42
|
-
Checks for a line break before the first element in a
|
43
|
-
multi-line hash.
|
44
|
-
Enabled: true
|
45
|
-
Style/FirstMethodArgumentLineBreak:
|
46
|
-
Description: >-
|
47
|
-
Checks for a line break before the first argument in a
|
48
|
-
multi-line method call.
|
49
|
-
Enabled: true
|
50
|
-
Style/GuardClause:
|
51
|
-
Description: Check for conditionals that can be replaced with guard clauses
|
52
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
53
|
-
Enabled: false
|
54
|
-
MinBodyLength: 1
|
55
|
-
Style/IfUnlessModifier:
|
56
|
-
Description: Favor modifier if/unless usage when you have a single-line body.
|
57
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
58
|
-
Enabled: false
|
59
|
-
MaxLineLength: 80
|
60
|
-
Style/OptionHash:
|
61
|
-
Description: Don't use option hashes when you can use keyword arguments.
|
62
|
-
Enabled: false
|
63
|
-
Style/PercentLiteralDelimiters:
|
64
|
-
Description: Use `%`-literal delimiters consistently
|
65
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
66
|
-
Enabled: false
|
67
|
-
PreferredDelimiters:
|
68
|
-
"%": "()"
|
69
|
-
"%i": "()"
|
70
|
-
"%q": "()"
|
71
|
-
"%Q": "()"
|
72
|
-
"%r": "{}"
|
73
|
-
"%s": "()"
|
74
|
-
"%w": "()"
|
75
|
-
"%W": "()"
|
76
|
-
"%x": "()"
|
77
|
-
Style/PredicateName:
|
78
|
-
Description: Check the names of predicate methods.
|
79
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
80
|
-
Enabled: true
|
81
|
-
NamePrefix:
|
82
|
-
- is_
|
83
|
-
- has_
|
84
|
-
- have_
|
85
|
-
NamePrefixBlacklist:
|
86
|
-
- is_
|
87
|
-
Exclude:
|
88
|
-
- spec/**/*
|
89
|
-
Style/RaiseArgs:
|
90
|
-
Description: Checks the arguments passed to raise/fail.
|
91
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
92
|
-
Enabled: false
|
93
|
-
EnforcedStyle: exploded
|
94
|
-
SupportedStyles:
|
95
|
-
- compact
|
96
|
-
- exploded
|
97
|
-
Style/SignalException:
|
98
|
-
Description: Checks for proper usage of fail and raise.
|
99
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
100
|
-
Enabled: false
|
101
|
-
EnforcedStyle: semantic
|
102
|
-
SupportedStyles:
|
103
|
-
- only_raise
|
104
|
-
- only_fail
|
105
|
-
- semantic
|
106
|
-
Style/SingleLineBlockParams:
|
107
|
-
Description: Enforces the names of some block params.
|
108
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
109
|
-
Enabled: false
|
110
|
-
Methods:
|
111
|
-
- reduce:
|
112
|
-
- a
|
113
|
-
- e
|
114
|
-
- inject:
|
115
|
-
- a
|
116
|
-
- e
|
117
|
-
Style/SingleLineMethods:
|
118
|
-
Description: Avoid single-line methods.
|
119
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
120
|
-
Enabled: false
|
121
|
-
AllowIfMethodIsEmpty: true
|
122
|
-
Style/StringLiterals:
|
123
|
-
Description: Checks if uses of quotes match the configured preference.
|
124
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
125
|
-
Enabled: true
|
126
|
-
EnforcedStyle: double_quotes
|
127
|
-
SupportedStyles:
|
128
|
-
- single_quotes
|
129
|
-
- double_quotes
|
130
|
-
Style/StringLiteralsInInterpolation:
|
131
|
-
Description: Checks if uses of quotes inside expressions in interpolated strings
|
132
|
-
match the configured preference.
|
133
|
-
Enabled: true
|
134
|
-
EnforcedStyle: single_quotes
|
135
|
-
SupportedStyles:
|
136
|
-
- single_quotes
|
137
|
-
- double_quotes
|
138
|
-
Style/TrailingCommaInArguments:
|
139
|
-
Description: 'Checks for trailing comma in argument lists.'
|
140
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
141
|
-
Enabled: true
|
142
|
-
EnforcedStyleForMultiline: comma
|
143
|
-
SupportedStyles:
|
144
|
-
- comma
|
145
|
-
- consistent_comma
|
146
|
-
- no_comma
|
147
|
-
Style/TrailingCommaInLiteral:
|
148
|
-
Description: 'Checks for trailing comma in array and hash literals.'
|
149
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
150
|
-
Enabled: true
|
151
|
-
EnforcedStyleForMultiline: comma
|
152
|
-
SupportedStyles:
|
153
|
-
- comma
|
154
|
-
- consistent_comma
|
155
|
-
- no_comma
|
156
|
-
Metrics/AbcSize:
|
157
|
-
Description: A calculated magnitude based on number of assignments, branches, and
|
158
|
-
conditions.
|
159
|
-
Enabled: false
|
160
|
-
Max: 15
|
161
|
-
Metrics/ClassLength:
|
162
|
-
Description: Avoid classes longer than 100 lines of code.
|
163
|
-
Enabled: false
|
164
|
-
CountComments: false
|
165
|
-
Max: 100
|
166
|
-
Metrics/ModuleLength:
|
167
|
-
CountComments: false
|
168
|
-
Max: 100
|
169
|
-
Description: Avoid modules longer than 100 lines of code.
|
170
|
-
Enabled: false
|
171
|
-
Metrics/CyclomaticComplexity:
|
172
|
-
Description: A complexity metric that is strongly correlated to the number of test
|
173
|
-
cases needed to validate a method.
|
174
|
-
Enabled: false
|
175
|
-
Max: 6
|
176
|
-
Metrics/MethodLength:
|
177
|
-
Description: Avoid methods longer than 10 lines of code.
|
178
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
179
|
-
Enabled: false
|
180
|
-
CountComments: false
|
181
|
-
Max: 10
|
182
|
-
Metrics/ParameterLists:
|
183
|
-
Description: Avoid parameter lists longer than three or four parameters.
|
184
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
185
|
-
Enabled: false
|
186
|
-
Max: 5
|
187
|
-
CountKeywordArgs: true
|
188
|
-
Metrics/PerceivedComplexity:
|
189
|
-
Description: A complexity metric geared towards measuring complexity for a human
|
190
|
-
reader.
|
191
|
-
Enabled: false
|
192
|
-
Max: 7
|
193
|
-
Lint/AssignmentInCondition:
|
194
|
-
Description: Don't use assignment in conditions.
|
195
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
196
|
-
Enabled: false
|
197
|
-
AllowSafeAssignment: true
|
198
|
-
Style/InlineComment:
|
199
|
-
Description: Avoid inline comments.
|
200
|
-
Enabled: false
|
201
|
-
Style/AccessorMethodName:
|
202
|
-
Description: Check the naming of accessor methods for get_/set_.
|
203
|
-
Enabled: false
|
204
|
-
Style/Alias:
|
205
|
-
Description: Use alias_method instead of alias.
|
206
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
207
|
-
Enabled: false
|
208
|
-
Style/Documentation:
|
209
|
-
Description: Document classes and non-namespace modules.
|
210
|
-
Enabled: false
|
211
|
-
Style/DoubleNegation:
|
212
|
-
Description: Checks for uses of double negation (!!).
|
213
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
214
|
-
Enabled: false
|
215
|
-
Style/EachWithObject:
|
216
|
-
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
217
|
-
Enabled: false
|
218
|
-
Style/EmptyLiteral:
|
219
|
-
Description: Prefer literals to Array.new/Hash.new/String.new.
|
220
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
221
|
-
Enabled: false
|
222
|
-
Style/ModuleFunction:
|
223
|
-
Description: Checks for usage of `extend self` in modules.
|
224
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
225
|
-
Enabled: false
|
226
|
-
Style/OneLineConditional:
|
227
|
-
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
228
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
229
|
-
Enabled: false
|
230
|
-
Style/PerlBackrefs:
|
231
|
-
Description: Avoid Perl-style regex back references.
|
232
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
233
|
-
Enabled: false
|
234
|
-
Style/Send:
|
235
|
-
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
236
|
-
may overlap with existing methods.
|
237
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
238
|
-
Enabled: false
|
239
|
-
Style/SpecialGlobalVars:
|
240
|
-
Description: Avoid Perl-style global variables.
|
241
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
242
|
-
Enabled: false
|
243
|
-
Style/VariableInterpolation:
|
244
|
-
Description: Don't interpolate global, instance and class variables directly in
|
245
|
-
strings.
|
246
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
247
|
-
Enabled: false
|
248
|
-
Style/WhenThen:
|
249
|
-
Description: Use when x then ... for one-line cases.
|
250
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
251
|
-
Enabled: false
|
252
|
-
Lint/EachWithObjectArgument:
|
253
|
-
Description: Check for immutable argument given to each_with_object.
|
254
|
-
Enabled: true
|
255
|
-
Lint/EndAlignment:
|
256
|
-
Description: This cop checks whether the end keywords are aligned properly.
|
257
|
-
AlignWith: variable
|
258
|
-
Enabled: true
|
259
|
-
Lint/HandleExceptions:
|
260
|
-
Description: Don't suppress exception.
|
261
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
262
|
-
Enabled: false
|
263
|
-
Lint/LiteralInCondition:
|
264
|
-
Description: Checks of literals used in conditions.
|
265
|
-
Enabled: false
|
266
|
-
Lint/LiteralInInterpolation:
|
267
|
-
Description: Checks for literals used in interpolation.
|
268
|
-
Enabled: false
|
data/.travis.yml
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
cache: bundler
|
4
|
-
rvm:
|
5
|
-
- 2.2.3
|
6
|
-
- 2.1.7
|
7
|
-
- 2.0.0
|
8
|
-
- 1.9.3
|
9
|
-
- jruby
|
10
|
-
- rbx-2
|
11
|
-
notifications:
|
12
|
-
flowdock:
|
13
|
-
secure: fSZxX5z3bHWT8aCFKBFrDDt5o3Jb6EFWcm+pAcMabpfDHc4iktWuCUlSM405798TRdKdws1A2RncQGYiQyLbqNvtLz48dvj4BxgYW7P/vg0koN+I/H2MjpZeuIQ7BRSEJIq2sAYNVya+hSil+SPEBMTngJiP6VYG0dm6fFnRkyk=
|
data/pactas_itero.gemspec
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'pactas_itero/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'pactas_itero'
|
8
|
-
spec.version = PactasItero::VERSION
|
9
|
-
spec.authors = ['Simon Fröhler']
|
10
|
-
spec.email = "simon@shipcloud.io"
|
11
|
-
spec.summary = %q{pactas_itero provides a client mapping for accessing
|
12
|
-
the Pactas Itero API.}
|
13
|
-
spec.description = %q{pactas_itero provides a client mapping for accessing
|
14
|
-
the Pactas Itero API, making it easy to post your data to, adn read your
|
15
|
-
data from your Pactas account.}
|
16
|
-
spec.homepage = 'https://github.com/webionate/pactas_itero'
|
17
|
-
spec.license = 'MIT'
|
18
|
-
|
19
|
-
spec.files = `git ls-files`.split("\n")
|
20
|
-
spec.test_files = `git ls-files -- spec/*`.split("\n")
|
21
|
-
spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
-
spec.require_paths = ['lib']
|
23
|
-
|
24
|
-
spec.add_dependency('faraday_middleware', '~> 0.9.1')
|
25
|
-
spec.add_dependency('rash', '~> 0.4.0')
|
26
|
-
|
27
|
-
spec.add_development_dependency 'bundler', '~> 1.7'
|
28
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
29
|
-
spec.add_development_dependency "rspec", '~> 3.0'
|
30
|
-
spec.add_development_dependency("simplecov", "~> 0")
|
31
|
-
spec.add_development_dependency("webmock", "~> 1.18", ">= 1.18.0")
|
32
|
-
end
|