iwoca 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/iwoca/application.rb +3 -1
- data/lib/iwoca/customer.rb +3 -1
- data/lib/iwoca/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e794773b5175154fe894788b44192280f09ca2e5099bf4025d04cb174f02b0a
|
4
|
+
data.tar.gz: b5bdaa6ae3e9468cc9db7128037dd210bab12dabb59c153bda687ca466967859
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20337152817c5b9a26fdedf4fa0615e9aff23aa5e229ff3804c13a32706ef22955d3324cdc24feeb5a4f804ce3d4b4cb5f94e95597ff45edad7c97bc2eceed03
|
7
|
+
data.tar.gz: 5392aabef7c29bd74d401e1ecdd1d02cb340ae0370edbb94591b75e8758801e3a23aef1f352b1b65b67bbef5439ae24d6d51525fabdcaf3d107a56fbe497c922
|
data/Gemfile.lock
CHANGED
data/lib/iwoca/application.rb
CHANGED
@@ -32,7 +32,9 @@ module Iwoca
|
|
32
32
|
# introducer_id: customer_id
|
33
33
|
# }
|
34
34
|
|
35
|
-
|
35
|
+
schema = File.join(Iwoca.root, 'lib/iwoca/schemas/requested_product.json')
|
36
|
+
|
37
|
+
JSON::Validator.validate!(schema, requests)
|
36
38
|
|
37
39
|
Iwoca.connection.post("customers/#{customer_id}/applications/", data)
|
38
40
|
end
|
data/lib/iwoca/customer.rb
CHANGED
@@ -11,8 +11,10 @@ module Iwoca
|
|
11
11
|
# Successful request will return a 201 status code and a JSON response containing a customer_id:
|
12
12
|
# Example: { data: { customer_id: "fd48781e-3ad3-4a94-b4a6-60fafeebab0b" } }
|
13
13
|
def self.create(data: {})
|
14
|
+
schema = File.join(Iwoca.root, 'lib/iwoca/schemas/customer_payload.json')
|
15
|
+
|
14
16
|
# Validate the schema first, to avoid making a request with invalid data.
|
15
|
-
JSON::Validator.validate!(
|
17
|
+
JSON::Validator.validate!(schema, data.to_json)
|
16
18
|
|
17
19
|
Iwoca.connection.post('customers/', data)
|
18
20
|
end
|
data/lib/iwoca/version.rb
CHANGED