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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +79 -0
- data/lib/modulr/api/customers_service.rb +28 -0
- data/lib/modulr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 151fec1b59fee97d4c008e8c229acdf65fb948a632443a5bf431fd4ab99db5b2
|
4
|
+
data.tar.gz: edb08a27bdc84da31df9c2f3508ca72968546a988924e798ac6a2de0730b70a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c71349b26005bb7185807f5a3d7d7d474f9a71cf672f8f9b5013e1475f3581a886787a2dadc71e22d6f5f7ffc5c3007aee1a1a51f055d7186a7df4b8ad03c2e
|
7
|
+
data.tar.gz: a3519173719b22f64037939faf62c1efabd95fb7768933c37de3034ce74d26224f70ea068b1935f3d66f3cbfa5ea93ec73039043f294e14320a25626237ee3eb
|
data/Gemfile.lock
CHANGED
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
|
data/lib/modulr/version.rb
CHANGED
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.
|
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-
|
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.
|
259
|
+
rubygems_version: 3.4.10
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Ruby client for Modulr Finance API.
|