gocardless_pro 2.12.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +50 -0
- data/README.md +15 -1
- data/gocardless_pro.gemspec +2 -0
- data/lib/gocardless_pro.rb +3 -0
- data/lib/gocardless_pro/api_service.rb +3 -0
- data/lib/gocardless_pro/client.rb +6 -1
- data/lib/gocardless_pro/error/invalid_state_error.rb +2 -0
- data/lib/gocardless_pro/resources/creditor.rb +4 -0
- data/lib/gocardless_pro/resources/customer.rb +5 -0
- data/lib/gocardless_pro/resources/customer_notification.rb +97 -0
- data/lib/gocardless_pro/resources/event.rb +2 -0
- data/lib/gocardless_pro/resources/mandate_import.rb +1 -1
- data/lib/gocardless_pro/resources/mandate_import_entry.rb +1 -1
- data/lib/gocardless_pro/services/creditor_bank_accounts_service.rb +20 -2
- data/lib/gocardless_pro/services/creditors_service.rb +10 -1
- data/lib/gocardless_pro/services/customer_bank_accounts_service.rb +20 -2
- data/lib/gocardless_pro/services/customer_notifications_service.rb +66 -0
- data/lib/gocardless_pro/services/customers_service.rb +10 -1
- data/lib/gocardless_pro/services/mandate_imports_service.rb +40 -6
- data/lib/gocardless_pro/services/mandates_service.rb +30 -3
- data/lib/gocardless_pro/services/payments_service.rb +30 -3
- data/lib/gocardless_pro/services/redirect_flows_service.rb +20 -2
- data/lib/gocardless_pro/services/refunds_service.rb +11 -6
- data/lib/gocardless_pro/services/subscriptions_service.rb +20 -2
- data/lib/gocardless_pro/version.rb +1 -1
- data/spec/resources/customer_notification_spec.rb +73 -0
- data/spec/resources/customer_spec.rb +13 -0
- data/spec/resources/event_spec.rb +7 -0
- data/spec/services/creditor_bank_accounts_service_spec.rb +33 -4
- data/spec/services/creditors_service_spec.rb +33 -4
- data/spec/services/customer_bank_accounts_service_spec.rb +33 -4
- data/spec/services/customer_notifications_service_spec.rb +84 -0
- data/spec/services/customers_service_spec.rb +50 -4
- data/spec/services/events_service_spec.rb +11 -0
- data/spec/services/mandate_imports_service_spec.rb +33 -4
- data/spec/services/mandates_service_spec.rb +33 -4
- data/spec/services/payments_service_spec.rb +33 -4
- data/spec/services/redirect_flows_service_spec.rb +33 -4
- data/spec/services/refunds_service_spec.rb +33 -4
- data/spec/services/subscriptions_service_spec.rb +33 -4
- metadata +23 -3
- data/circle.yml +0 -11
@@ -156,10 +156,39 @@ describe GoCardlessPro::Services::MandateImportsService do
|
|
156
156
|
)
|
157
157
|
end
|
158
158
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
159
|
+
context 'with default behaviour' do
|
160
|
+
it 'fetches the already-created resource' do
|
161
|
+
post_create_response
|
162
|
+
expect(post_stub).to have_been_requested
|
163
|
+
expect(get_stub).to have_been_requested
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
context 'with on_idempotency_conflict: :raise' do
|
168
|
+
let(:client) do
|
169
|
+
GoCardlessPro::Client.new(
|
170
|
+
access_token: 'SECRET_TOKEN',
|
171
|
+
on_idempotency_conflict: :raise
|
172
|
+
)
|
173
|
+
end
|
174
|
+
|
175
|
+
it 'raises an IdempotencyConflict error' do
|
176
|
+
expect { post_create_response }.
|
177
|
+
to raise_error(GoCardlessPro::IdempotencyConflict)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
context 'with on_idempotency_conflict: :unknown' do
|
182
|
+
let(:client) do
|
183
|
+
GoCardlessPro::Client.new(
|
184
|
+
access_token: 'SECRET_TOKEN',
|
185
|
+
on_idempotency_conflict: :unknown
|
186
|
+
)
|
187
|
+
end
|
188
|
+
|
189
|
+
it 'raises an ArgumentError' do
|
190
|
+
expect { post_create_response }.to raise_error(ArgumentError)
|
191
|
+
end
|
163
192
|
end
|
164
193
|
end
|
165
194
|
end
|
@@ -181,10 +181,39 @@ describe GoCardlessPro::Services::MandatesService do
|
|
181
181
|
)
|
182
182
|
end
|
183
183
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
184
|
+
context 'with default behaviour' do
|
185
|
+
it 'fetches the already-created resource' do
|
186
|
+
post_create_response
|
187
|
+
expect(post_stub).to have_been_requested
|
188
|
+
expect(get_stub).to have_been_requested
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
context 'with on_idempotency_conflict: :raise' do
|
193
|
+
let(:client) do
|
194
|
+
GoCardlessPro::Client.new(
|
195
|
+
access_token: 'SECRET_TOKEN',
|
196
|
+
on_idempotency_conflict: :raise
|
197
|
+
)
|
198
|
+
end
|
199
|
+
|
200
|
+
it 'raises an IdempotencyConflict error' do
|
201
|
+
expect { post_create_response }.
|
202
|
+
to raise_error(GoCardlessPro::IdempotencyConflict)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
context 'with on_idempotency_conflict: :unknown' do
|
207
|
+
let(:client) do
|
208
|
+
GoCardlessPro::Client.new(
|
209
|
+
access_token: 'SECRET_TOKEN',
|
210
|
+
on_idempotency_conflict: :unknown
|
211
|
+
)
|
212
|
+
end
|
213
|
+
|
214
|
+
it 'raises an ArgumentError' do
|
215
|
+
expect { post_create_response }.to raise_error(ArgumentError)
|
216
|
+
end
|
188
217
|
end
|
189
218
|
end
|
190
219
|
end
|
@@ -191,10 +191,39 @@ describe GoCardlessPro::Services::PaymentsService do
|
|
191
191
|
)
|
192
192
|
end
|
193
193
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
194
|
+
context 'with default behaviour' do
|
195
|
+
it 'fetches the already-created resource' do
|
196
|
+
post_create_response
|
197
|
+
expect(post_stub).to have_been_requested
|
198
|
+
expect(get_stub).to have_been_requested
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
context 'with on_idempotency_conflict: :raise' do
|
203
|
+
let(:client) do
|
204
|
+
GoCardlessPro::Client.new(
|
205
|
+
access_token: 'SECRET_TOKEN',
|
206
|
+
on_idempotency_conflict: :raise
|
207
|
+
)
|
208
|
+
end
|
209
|
+
|
210
|
+
it 'raises an IdempotencyConflict error' do
|
211
|
+
expect { post_create_response }.
|
212
|
+
to raise_error(GoCardlessPro::IdempotencyConflict)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
context 'with on_idempotency_conflict: :unknown' do
|
217
|
+
let(:client) do
|
218
|
+
GoCardlessPro::Client.new(
|
219
|
+
access_token: 'SECRET_TOKEN',
|
220
|
+
on_idempotency_conflict: :unknown
|
221
|
+
)
|
222
|
+
end
|
223
|
+
|
224
|
+
it 'raises an ArgumentError' do
|
225
|
+
expect { post_create_response }.to raise_error(ArgumentError)
|
226
|
+
end
|
198
227
|
end
|
199
228
|
end
|
200
229
|
end
|
@@ -181,10 +181,39 @@ describe GoCardlessPro::Services::RedirectFlowsService do
|
|
181
181
|
)
|
182
182
|
end
|
183
183
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
184
|
+
context 'with default behaviour' do
|
185
|
+
it 'fetches the already-created resource' do
|
186
|
+
post_create_response
|
187
|
+
expect(post_stub).to have_been_requested
|
188
|
+
expect(get_stub).to have_been_requested
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
context 'with on_idempotency_conflict: :raise' do
|
193
|
+
let(:client) do
|
194
|
+
GoCardlessPro::Client.new(
|
195
|
+
access_token: 'SECRET_TOKEN',
|
196
|
+
on_idempotency_conflict: :raise
|
197
|
+
)
|
198
|
+
end
|
199
|
+
|
200
|
+
it 'raises an IdempotencyConflict error' do
|
201
|
+
expect { post_create_response }.
|
202
|
+
to raise_error(GoCardlessPro::IdempotencyConflict)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
context 'with on_idempotency_conflict: :unknown' do
|
207
|
+
let(:client) do
|
208
|
+
GoCardlessPro::Client.new(
|
209
|
+
access_token: 'SECRET_TOKEN',
|
210
|
+
on_idempotency_conflict: :unknown
|
211
|
+
)
|
212
|
+
end
|
213
|
+
|
214
|
+
it 'raises an ArgumentError' do
|
215
|
+
expect { post_create_response }.to raise_error(ArgumentError)
|
216
|
+
end
|
188
217
|
end
|
189
218
|
end
|
190
219
|
end
|
@@ -171,10 +171,39 @@ describe GoCardlessPro::Services::RefundsService do
|
|
171
171
|
)
|
172
172
|
end
|
173
173
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
174
|
+
context 'with default behaviour' do
|
175
|
+
it 'fetches the already-created resource' do
|
176
|
+
post_create_response
|
177
|
+
expect(post_stub).to have_been_requested
|
178
|
+
expect(get_stub).to have_been_requested
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
context 'with on_idempotency_conflict: :raise' do
|
183
|
+
let(:client) do
|
184
|
+
GoCardlessPro::Client.new(
|
185
|
+
access_token: 'SECRET_TOKEN',
|
186
|
+
on_idempotency_conflict: :raise
|
187
|
+
)
|
188
|
+
end
|
189
|
+
|
190
|
+
it 'raises an IdempotencyConflict error' do
|
191
|
+
expect { post_create_response }.
|
192
|
+
to raise_error(GoCardlessPro::IdempotencyConflict)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
context 'with on_idempotency_conflict: :unknown' do
|
197
|
+
let(:client) do
|
198
|
+
GoCardlessPro::Client.new(
|
199
|
+
access_token: 'SECRET_TOKEN',
|
200
|
+
on_idempotency_conflict: :unknown
|
201
|
+
)
|
202
|
+
end
|
203
|
+
|
204
|
+
it 'raises an ArgumentError' do
|
205
|
+
expect { post_create_response }.to raise_error(ArgumentError)
|
206
|
+
end
|
178
207
|
end
|
179
208
|
end
|
180
209
|
end
|
@@ -221,10 +221,39 @@ describe GoCardlessPro::Services::SubscriptionsService do
|
|
221
221
|
)
|
222
222
|
end
|
223
223
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
224
|
+
context 'with default behaviour' do
|
225
|
+
it 'fetches the already-created resource' do
|
226
|
+
post_create_response
|
227
|
+
expect(post_stub).to have_been_requested
|
228
|
+
expect(get_stub).to have_been_requested
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
context 'with on_idempotency_conflict: :raise' do
|
233
|
+
let(:client) do
|
234
|
+
GoCardlessPro::Client.new(
|
235
|
+
access_token: 'SECRET_TOKEN',
|
236
|
+
on_idempotency_conflict: :raise
|
237
|
+
)
|
238
|
+
end
|
239
|
+
|
240
|
+
it 'raises an IdempotencyConflict error' do
|
241
|
+
expect { post_create_response }.
|
242
|
+
to raise_error(GoCardlessPro::IdempotencyConflict)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
context 'with on_idempotency_conflict: :unknown' do
|
247
|
+
let(:client) do
|
248
|
+
GoCardlessPro::Client.new(
|
249
|
+
access_token: 'SECRET_TOKEN',
|
250
|
+
on_idempotency_conflict: :unknown
|
251
|
+
)
|
252
|
+
end
|
253
|
+
|
254
|
+
it 'raises an ArgumentError' do
|
255
|
+
expect { post_create_response }.to raise_error(ArgumentError)
|
256
|
+
end
|
228
257
|
end
|
229
258
|
end
|
230
259
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocardless_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.7.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: public_suffix
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.5
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.0.5
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: webmock
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,13 +107,13 @@ executables: []
|
|
93
107
|
extensions: []
|
94
108
|
extra_rdoc_files: []
|
95
109
|
files:
|
110
|
+
- ".circleci/config.yml"
|
96
111
|
- ".rspec"
|
97
112
|
- ".rubocop.yml"
|
98
113
|
- ".travis.yml"
|
99
114
|
- Gemfile
|
100
115
|
- LICENSE.txt
|
101
116
|
- README.md
|
102
|
-
- circle.yml
|
103
117
|
- demo.rb
|
104
118
|
- gocardless_pro.gemspec
|
105
119
|
- lib/gocardless_pro.rb
|
@@ -121,6 +135,7 @@ files:
|
|
121
135
|
- lib/gocardless_pro/resources/creditor_bank_account.rb
|
122
136
|
- lib/gocardless_pro/resources/customer.rb
|
123
137
|
- lib/gocardless_pro/resources/customer_bank_account.rb
|
138
|
+
- lib/gocardless_pro/resources/customer_notification.rb
|
124
139
|
- lib/gocardless_pro/resources/event.rb
|
125
140
|
- lib/gocardless_pro/resources/mandate.rb
|
126
141
|
- lib/gocardless_pro/resources/mandate_import.rb
|
@@ -138,6 +153,7 @@ files:
|
|
138
153
|
- lib/gocardless_pro/services/creditor_bank_accounts_service.rb
|
139
154
|
- lib/gocardless_pro/services/creditors_service.rb
|
140
155
|
- lib/gocardless_pro/services/customer_bank_accounts_service.rb
|
156
|
+
- lib/gocardless_pro/services/customer_notifications_service.rb
|
141
157
|
- lib/gocardless_pro/services/customers_service.rb
|
142
158
|
- lib/gocardless_pro/services/events_service.rb
|
143
159
|
- lib/gocardless_pro/services/mandate_import_entries_service.rb
|
@@ -161,6 +177,7 @@ files:
|
|
161
177
|
- spec/resources/creditor_bank_account_spec.rb
|
162
178
|
- spec/resources/creditor_spec.rb
|
163
179
|
- spec/resources/customer_bank_account_spec.rb
|
180
|
+
- spec/resources/customer_notification_spec.rb
|
164
181
|
- spec/resources/customer_spec.rb
|
165
182
|
- spec/resources/event_spec.rb
|
166
183
|
- spec/resources/mandate_import_entry_spec.rb
|
@@ -178,6 +195,7 @@ files:
|
|
178
195
|
- spec/services/creditor_bank_accounts_service_spec.rb
|
179
196
|
- spec/services/creditors_service_spec.rb
|
180
197
|
- spec/services/customer_bank_accounts_service_spec.rb
|
198
|
+
- spec/services/customer_notifications_service_spec.rb
|
181
199
|
- spec/services/customers_service_spec.rb
|
182
200
|
- spec/services/events_service_spec.rb
|
183
201
|
- spec/services/mandate_import_entries_service_spec.rb
|
@@ -226,6 +244,7 @@ test_files:
|
|
226
244
|
- spec/resources/creditor_bank_account_spec.rb
|
227
245
|
- spec/resources/creditor_spec.rb
|
228
246
|
- spec/resources/customer_bank_account_spec.rb
|
247
|
+
- spec/resources/customer_notification_spec.rb
|
229
248
|
- spec/resources/customer_spec.rb
|
230
249
|
- spec/resources/event_spec.rb
|
231
250
|
- spec/resources/mandate_import_entry_spec.rb
|
@@ -243,6 +262,7 @@ test_files:
|
|
243
262
|
- spec/services/creditor_bank_accounts_service_spec.rb
|
244
263
|
- spec/services/creditors_service_spec.rb
|
245
264
|
- spec/services/customer_bank_accounts_service_spec.rb
|
265
|
+
- spec/services/customer_notifications_service_spec.rb
|
246
266
|
- spec/services/customers_service_spec.rb
|
247
267
|
- spec/services/events_service_spec.rb
|
248
268
|
- spec/services/mandate_import_entries_service_spec.rb
|
data/circle.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
dependencies:
|
2
|
-
override:
|
3
|
-
- 'rvm-exec 2.2.7 bundle install'
|
4
|
-
- 'rvm-exec 2.3.4 bundle install'
|
5
|
-
- 'rvm-exec 2.4.1 bundle install'
|
6
|
-
|
7
|
-
test:
|
8
|
-
override:
|
9
|
-
- 'rvm-exec 2.2.7 bundle exec rspec'
|
10
|
-
- 'rvm-exec 2.3.4 bundle exec rspec'
|
11
|
-
- 'rvm-exec 2.4.1 bundle exec rspec'
|