modulr-api 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 756d629d0ce81b092c226a12364e51addeb7df40d6101fa9a2f195e5da406fac
4
- data.tar.gz: ae23bf413271bf36cd6d256f5cfac0edd588377cb17a6fa2c2eb12163b4b5052
3
+ metadata.gz: 151fec1b59fee97d4c008e8c229acdf65fb948a632443a5bf431fd4ab99db5b2
4
+ data.tar.gz: edb08a27bdc84da31df9c2f3508ca72968546a988924e798ac6a2de0730b70a3
5
5
  SHA512:
6
- metadata.gz: 13b76b1d357a1c7175fc8e2740d77f66aec500fc88172bbba17130a1bdc9afd788f82352a1bb5f963512226c687e9ab80121aa413c41dc8bb176845396041b1a
7
- data.tar.gz: 21f648f6656e2c933c8fc076b543da98b9e063dd28988d1ca48111ddbe579c5f6eafd913b0bff057e4b607c7d5936109d8464524ee9fc2773ae003c0ae4f11fb
6
+ metadata.gz: 8c71349b26005bb7185807f5a3d7d7d474f9a71cf672f8f9b5013e1475f3581a886787a2dadc71e22d6f5f7ffc5c3007aee1a1a51f055d7186a7df4b8ad03c2e
7
+ data.tar.gz: a3519173719b22f64037939faf62c1efabd95fb7768933c37de3034ce74d26224f70ea068b1935f3d66f3cbfa5ea93ec73039043f294e14320a25626237ee3eb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- modulr-api (0.0.17)
4
+ modulr-api (0.0.19)
5
5
  faraday (~> 1.0)
6
6
  faraday_middleware (~> 1.0)
7
7
 
data/README.md CHANGED
@@ -31,6 +31,85 @@ Run `bin/console` for an interactive prompt to experiment with the code.
31
31
  ```rb
32
32
  # Find a customer
33
33
  client.customers.find(id: "C2188C26")
34
+
35
+ # Create a customer
36
+ client.customers.create(
37
+ type: "LLC",
38
+ legal_entity: "GB",
39
+ external_reference: "My new customer",
40
+ name: "string",
41
+ company_reg_number: "2018123987165432",
42
+ registered_address: {
43
+ addressLine1: "string",
44
+ addressLine2: "string",
45
+ postTown: "string",
46
+ postCode: "string",
47
+ country: "GB",
48
+ countrySubDivision: "string"
49
+ },
50
+ trading_address: {
51
+ addressLine1: "string",
52
+ addressLine2: "string",
53
+ postTown: "string",
54
+ postCode: "string",
55
+ country: "GB",
56
+ countrySubDivision: "string"
57
+ },
58
+ industry_code: "string",
59
+ tcs_version: 0,
60
+ expected_monthly_spend: 0,
61
+ associates: [
62
+ {
63
+ type: "DIRECTOR",
64
+ firstName: "string",
65
+ middleName: "string",
66
+ lastName: "string",
67
+ dateOfBirth: "string",
68
+ ownership: 0,
69
+ homeAddress: {
70
+ addressLine1: "string",
71
+ addressLine2: "string",
72
+ postTown: "string",
73
+ postCode: "string",
74
+ country: "GB",
75
+ countrySubDivision: "string"
76
+ },
77
+ applicant: true,
78
+ email: "string",
79
+ phone: "string",
80
+ documentInfo: [
81
+ {
82
+ path: "string",
83
+ fileName: "string",
84
+ uploadedDate: "2017-01-28T01:01:01+0000"
85
+ }
86
+ ],
87
+ additionalIdentifiers: [
88
+ {
89
+ type: "BSN",
90
+ value: "string"
91
+ }
92
+ ],
93
+ complianceData: {
94
+ relationship: "string"
95
+ }
96
+ }
97
+ ],
98
+ document_info: [
99
+ {
100
+ path: "string",
101
+ fileName: "string",
102
+ uploadedDate: "2017-01-28T01:01:01+0000"
103
+ }
104
+ ],
105
+ provisional_customer_id: "string",
106
+ customer_trust: {
107
+ trustNature: "BARE_TRUSTS"
108
+ },
109
+ tax_profile: {
110
+ taxIdentifier: "string"
111
+ }
112
+ )
34
113
  ```
35
114
 
36
115
  ### Accounts
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
4
+
3
5
  module Modulr
4
6
  module API
5
7
  class CustomersService < Service
@@ -7,6 +9,32 @@ module Modulr
7
9
  response = client.get("/customers/#{id}")
8
10
  Resources::Customers::Customer.new(response.env[:raw_body], response.body)
9
11
  end
12
+
13
+ def create(type:, legal_entity:, **opts)
14
+ payload = {
15
+ type: type,
16
+ legalEntity: legal_entity,
17
+ }
18
+
19
+ payload[:externalReference] = opts[:external_reference] if opts[:external_reference]
20
+ payload[:name] = opts[:name] if opts[:name]
21
+ payload[:companyRegNumber] = opts[:company_reg_number] if opts[:company_reg_number]
22
+ payload[:registeredAddress] = opts[:registered_address] if opts[:registered_address]
23
+ payload[:tradingAddress] = opts[:trading_address] if opts[:trading_address]
24
+ payload[:industryCode] = opts[:industry_code] if opts[:industry_code]
25
+ payload[:tcsVersion] = opts[:tcs_version] if opts[:tcs_version]
26
+ payload[:expectedMonthlySpend] = opts[:expected_monthly_spend] if opts[:expected_monthly_spend]
27
+ payload[:associates] = opts[:associates] if opts[:associates]
28
+ payload[:documentInfo] = opts[:document_info] if opts[:document_info]
29
+ payload[:provisionalCustomerId] = opts[:provisional_customer_id] if opts[:provisional_customer_id]
30
+ payload[:customerTrust] = opts[:customer_trust] if opts[:customer_trust]
31
+ payload[:taxProfile] = opts[:tax_profile] if opts[:tax_profile]
32
+
33
+ response = client.post("/customers", payload)
34
+ Resources::Customers::Customer.new(response.env[:raw_body], response.body)
35
+ end
10
36
  end
11
37
  end
12
38
  end
39
+
40
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Modulr
4
- VERSION = "0.0.17"
4
+ VERSION = "0.0.19"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modulr-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aitor García Rey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-23 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.4.6
259
+ rubygems_version: 3.4.10
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: Ruby client for Modulr Finance API.