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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10e7e70e4bc86bf5cbe397ce2ebd5418bd8dfbc7655c2e15dbd18037ad75467c
4
- data.tar.gz: e03e669cceee0cd7a6f5246250c3cbea119f5e7d1e0ba40ed0490f16ac5e0b57
3
+ metadata.gz: 1e794773b5175154fe894788b44192280f09ca2e5099bf4025d04cb174f02b0a
4
+ data.tar.gz: b5bdaa6ae3e9468cc9db7128037dd210bab12dabb59c153bda687ca466967859
5
5
  SHA512:
6
- metadata.gz: 7080ed4cd71220278cea6f700d029a45813dade65e47dd6bc7a54fb8e2231d3eb00edbcadeb4c87e8af45a5c5c1cd08aed853af393949ded48d112884b930e06
7
- data.tar.gz: 99278443edb7c5f13c8c2f9f4d5e5f53c068157c70f0900a7927046d009272c06206ff0848d77e0ffb9089b7dc9d7c308769798c3924bd9cc937067992a7d8cf
6
+ metadata.gz: 20337152817c5b9a26fdedf4fa0615e9aff23aa5e229ff3804c13a32706ef22955d3324cdc24feeb5a4f804ce3d4b4cb5f94e95597ff45edad7c97bc2eceed03
7
+ data.tar.gz: 5392aabef7c29bd74d401e1ecdd1d02cb340ae0370edbb94591b75e8758801e3a23aef1f352b1b65b67bbef5439ae24d6d51525fabdcaf3d107a56fbe497c922
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- iwoca (1.1.2)
4
+ iwoca (1.1.3)
5
5
  addressable
6
6
  faraday (~> 2.7)
7
7
  json-schema
@@ -32,7 +32,9 @@ module Iwoca
32
32
  # introducer_id: customer_id
33
33
  # }
34
34
 
35
- JSON::Validator.validate!('lib/iwoca/schemas/requested_product.json', requests)
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
@@ -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!('lib/iwoca/schemas/customer_payload.json', data.to_json)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Iwoca
4
- VERSION = '1.1.2'
4
+ VERSION = '1.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iwoca
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - rikas