jortt 4.2.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -3
  4. data/README.md +45 -151
  5. data/Rakefile +0 -1
  6. data/jortt.gemspec +6 -6
  7. data/lib/jortt.rb +0 -1
  8. data/lib/jortt/client.rb +65 -16
  9. data/lib/jortt/client/customers.rb +56 -49
  10. data/lib/jortt/client/error.rb +33 -0
  11. data/lib/jortt/client/invoices.rb +41 -38
  12. data/lib/jortt/client/ledger_accounts.rb +27 -0
  13. data/lib/jortt/client/version.rb +1 -2
  14. data/spec/fixtures/vcr_cassettes/Jortt/_client/1_1_1.yml +64 -0
  15. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_customers/1_1_1_1.yml +64 -0
  16. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_invoices/1_1_2_1.yml +64 -0
  17. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_ledger_accounts/1_1_3_1.yml +64 -0
  18. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_create/faulty_payload/shows_a_nice_error.yml +413 -0
  19. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_create/valid_payload/creates_the_customer.yml +505 -0
  20. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_delete/deletes_the_customer.yml +505 -0
  21. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_direct_debit_mandate/sends_direct_debit_mandate_to_the_customer_or_responds_with_an_error_when_not_possible.yml +470 -0
  22. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_index/query/returns_the_queried_customers.yml +464 -0
  23. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_index/without_params/returns_customers.yml +415 -0
  24. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_show/returns_the_customer.yml +464 -0
  25. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_update/updates_the_customer.yml +603 -0
  26. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_create/creates_the_invoice.yml +170 -0
  27. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_download/returns_the_invoice_download_link.yml +168 -0
  28. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_index/invoice_status/returns_those_invoices.yml +776 -0
  29. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_index/query/returns_the_queried_invoices.yml +315 -0
  30. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_show/returns_the_invoice.yml +421 -0
  31. data/spec/fixtures/vcr_cassettes/Jortt_Client_LedgerAccounts/_index/returns_invoices.yml +118 -0
  32. data/spec/jortt/client/customers_spec.rb +82 -37
  33. data/spec/jortt/client/invoices_spec.rb +105 -26
  34. data/spec/jortt/client/ledger_accounts_spec.rb +19 -0
  35. data/spec/jortt/client_spec.rb +5 -27
  36. data/spec/jortt_spec.rb +2 -3
  37. data/spec/spec_helper.rb +18 -4
  38. metadata +72 -37
  39. data/.rubocop.yml +0 -26
  40. data/lib/jortt/client/invoice.rb +0 -50
  41. data/spec/jortt/client/invoice_spec.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0888e091fcb1156dc527b9cd815d0629b60e411e
4
- data.tar.gz: e254535aeb502a1c3358df8b0af23eb782b0691e
2
+ SHA256:
3
+ metadata.gz: 4034de85abfce8b8e5116576441272434c1435d4d51c7f86a2c01d7f87da5506
4
+ data.tar.gz: 764eba179889e670fc8f0c1a7620dfcefdba8735612ef002c67c7ce4817eea66
5
5
  SHA512:
6
- metadata.gz: 11c08eb54b2d3b3f844e17df78c2e580bdb2b036a0d6322624ff352e8f5baf8e8c58cfd6db1340c209872e8513f21ae881216aeb65b6ef69d34aeeaa1220f667
7
- data.tar.gz: 968c299166179d4d3c43ac37ef500a547c3f9ceea81db998e291dd6bf63593bda65fda12a2252bdbf75dd24bc0cd566cf2f4c93d5c6f3417a87de0f33fec7aaa
6
+ metadata.gz: aaa6c20cfeedfdf18f2eeafa90e46ae7c8e0402bad48ad6b3849d10ca1caaa919697b7e7881e9333b41426cecd235f9f78206737c535f8f4e6ccafca92e7c96c
7
+ data.tar.gz: 022c967a77e8d5ac6db87ed7ba8eb4613de35d0ac62f09762476f2423e5a97333bcb5c7b4c28ac780595d0d9945e52a2e8fa401e1fe24c77cd941eafdf1ca596
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.7.1
@@ -1,7 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.4
4
- - 2.3.0
3
+ - 2.4.3
5
4
  script:
6
5
  - bundle exec rspec
7
- - bundle exec rubocop
data/README.md CHANGED
@@ -15,74 +15,36 @@ http://img.shields.io/travis/jorttbv/jortt-ruby.svg?style=flat
15
15
 
16
16
  A Ruby interface to the [Jortt](https://www.jortt.nl/) REST API.
17
17
 
18
- ## Usage
18
+ Check https://developer.jortt.nl/ for more info.
19
+
20
+ > THIS VERSION IS FOR THE NEW OAUTH API. STILL ON THE LEGACY API? USE VERSION 4.x OF THIS GEM: [CLICK HERE](https://github.com/jorttbv/jortt-ruby/tree/v4.2.0)
21
+
22
+ ## Usage examples
19
23
 
20
24
  To create a jortt client:
21
25
  ```ruby
22
- jortt = Jortt.client(
23
- app_name: "application-name-as-chosen-on-jortt.nl",
24
- api_key: "api-key-as-provided-by-jortt.nl"
25
- )
26
+ jortt = Jortt.client('<your-client-id>', '<your-client-secret>')
26
27
  ```
27
28
 
28
29
  ### Customers
29
30
 
30
- All customers (`jortt.customers.all(page: 2, per_page: 25)`) returns:
31
- ```ruby
32
- [{
33
- company_name: 'Jortt',
34
- address: {
35
- street: "Transistorstraat 71C",
36
- postal_code: "1322 CK",
37
- city: "Almere",
38
- country_code: "NL"
39
- }
40
- },
41
- {
42
- company_name: 'Zilverline',
43
- address: {
44
- street: "Cruquiusweg",
45
- ...
46
- }
47
- },
48
- ...
49
- page: 2,
50
- per_page: 25
51
- ]
52
- ```
53
-
54
- Searching customers (`jortt.customers.search('Jortt')`) returns:
31
+ All customers (`jortt.customers.index(page: 2)`) returns:
55
32
  ```ruby
56
33
  [{
57
- company_name: 'Jortt',
58
- address: {
59
- street: "Transistorstraat 71C",
60
- postal_code: "1322 CK",
61
- city: "Almere",
62
- country_code: "NL"
63
- }
64
- },
65
- {
66
- company_name: 'ttroj',
67
- address: {
68
- street: "Jorttweg",
69
- ...
70
- }
34
+ "id": "f8fd3e4e-da1c-43a7-892f-1410ac13e38a",
35
+ "is_private": true,
36
+ "customer_name": "Jortt",
37
+ "address_street": "Rozengracht 75a",
38
+ ...
71
39
  }]
72
40
  ```
73
41
 
74
42
  Adding customers:
75
43
  ```ruby
76
44
  jortt.customers.create(
77
- company_name: "Jortt B.V.",
78
- attn: "Vibiemme", # Optional
79
- extra_information: "The best cofee maker!", # Optional
80
- address: {
81
- street: "Transistorstraat 71C",
82
- postal_code: "1322 CK",
83
- city: "Almere",
84
- country_code: "NL"
85
- }
45
+ "is_private": true,
46
+ "customer_name": "Jortt",
47
+ ...
86
48
  )
87
49
  ```
88
50
 
@@ -113,80 +75,16 @@ Get invoices by ID (`jortt.invoices.get('934d59dd-76f6-4716-9e0f-82a618e1be21')`
113
75
  ```
114
76
 
115
77
 
116
- Searching invoices (`jortt.invoices.search('201606-012')`) returns:
78
+ Searching invoices (`jortt.invoices.index(query: '202001-002')`) returns:
117
79
  ```ruby
118
- [
119
- {
120
- "invoice_id": "934d59dd-76f6-4716-9e0f-82a618e1be21",
121
- "recipient": {
122
- "company_name": "Zilverline B.V.",
123
- "attn": null,
124
- "address": {
125
- "street": "Cruquisweg 109F",
126
- "city": "Amsterdam",
127
- "postal_code": "1111SX",
128
- "country": {
129
- "code": "NL",
130
- "name": "Nederland"
131
- }
132
- },
133
- "email": "ben@jortt.nl",
134
- "customer_id": "e1c5e15b-e34e-423e-a291-4ed43226a190",
135
- "extra_information": null,
136
- "shift_vat": null,
137
- "vat_number": null,
138
- "payment_term": 30
139
- },
140
- "recipient_in_eu": true,
141
- "organization": {
142
- "company_name": "Jortt BV",
143
- "company_name_line_2": null,
144
- "address": {
145
- "street": "Straat 1",
146
- "city": "Amsterdam",
147
- "postal_code": "1000 AA",
148
- "country": {
149
- "code": "NL",
150
- "name": "Nederland"
151
- }
152
- },
153
- "phonenumber": null,
154
- "bank_information": {
155
- "bic": "RABONL2U",
156
- "iban": "NL50RABO0150000001",
157
- "in_the_name_of": "Jortt B.V.",
158
- "description": null
159
- },
160
- "coc_number": "unique number",
161
- "vat_number": "NL821898279B01",
162
- "profession": null,
163
- "healthcare_data": null,
164
- "free_of_vat": false,
165
- "finance_email": "Jortt BV <compleet@jortt.nl>"
166
- },
167
- "line_items": [
168
- {
169
- "description": "Scrum",
170
- "vat": "0.21",
171
- "amount": "-100.0",
172
- "total_amount_ex_vat": "-100.0",
173
- "currency": "EUR",
174
- "quantity": "1.0"
175
- }
176
- ],
177
- "invoice_currency": null,
178
- "invoice_total": "-100.0",
179
- "invoice_total_incl_vat": "-121.0",
180
- "invoice_number": "201607-011",
181
- "invoice_status": "paid",
182
- "invoice_due_date": "2016-08-06",
183
- "invoice_date": "2016-07-07",
184
- "invoice_delivery_period": "2016-07-01",
185
- "invoice_remarks": null,
186
- "invoice_language": "nl",
187
- "invoice_reference": null
188
- }
189
- ]
80
+ [{
81
+ "id": "f8fd3e4e-da1c-43a7-892f-1410ac13e38a",
82
+ "invoice_status": "draft",
83
+ "customer_id": "f8fd3e4e-da1c-43a7-892f-1410ac13e38a",
84
+ "invoice_number": "202001-002",
85
+ "invoice_date": "2020-02-23",
86
+ ...
87
+ }]
190
88
 
191
89
  ```
192
90
 
@@ -194,35 +92,31 @@ Searching invoices (`jortt.invoices.search('201606-012')`) returns:
194
92
  Adding invoices:
195
93
  ```ruby
196
94
  jortt.invoices.create(
197
- customer_id: "123456789", # Optional
198
- delivery_period: "31-12-1234", # Optional
199
- reference: "my-reference", # Optional
95
+ customer_id: "f8fd3e4e-da1c-43a7-892f-1410ac13e38a",
96
+ invoice_date: "2020-02-23",
97
+ delivery_period: "2020-02-01",
98
+ payment_term: 14,
99
+ net_amounts: true,
100
+ send_method: "email",
101
+ introduction: "example",
102
+ remarks: "example",
103
+ payment_method: "pay_later",
200
104
  line_items: [
201
- {vat: 21, amount: 1359.50, quantity: 1, description: "Scrum Training"}
202
- ]
203
- )
204
- ```
205
-
206
- Sending invoices:
207
- ```ruby
208
- jortt.invoice(:invoice_id).send_invoice(
209
- mail_data: {
210
- to: 'ben@jortt.nl', # optional
211
- subject: 'Thank you for your assignment', # optional
212
- body: 'I hereby send you the invoice', # optional
213
- },
214
- invoice_date: Date.today, # optional
215
- payment_term: 7, # optional
216
- language: 'nl', # optional
217
- send_method: 'email', # optional
105
+ {
106
+ description: "this is a description example",
107
+ units: 3.14,
108
+ amount_per_unit: {
109
+ value: "365.00",
110
+ currency: "EUR"
111
+ },
112
+ vat: 21,
113
+ ledger_account_id: "f8fd3e4e-da1c-43a7-892f-1410ac13e38a"
114
+ }
115
+ ],
116
+ reference: "123"
218
117
  )
219
118
  ```
220
119
 
221
-
222
- ## Documentation
223
-
224
- Check https://app.jortt.nl/api-documentatie for more info.
225
-
226
120
  ## Development
227
121
 
228
122
  ### Running tests
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  require 'bundler/gem_tasks'
3
2
  require 'rspec/core/rake_task'
4
3
 
@@ -28,13 +28,13 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_runtime_dependency 'rest-client', '~> 2.0'
31
+ spec.add_runtime_dependency 'oauth2', '~> 1.4.4'
31
32
 
32
- spec.add_development_dependency 'bundler', '~> 1.0'
33
+ spec.add_development_dependency 'bundler', '~> 2.0'
33
34
  spec.add_development_dependency 'codecov', '~> 0.1'
34
- spec.add_development_dependency 'rake', '~> 10.0'
35
- spec.add_development_dependency 'rspec', '~> 3.4'
35
+ spec.add_development_dependency 'rake', '~> 13.0'
36
+ spec.add_development_dependency 'rspec', '~> 3.7'
36
37
  spec.add_development_dependency 'rspec-its', '~> 1.2'
37
- spec.add_development_dependency 'webmock', '~> 1.17'
38
- spec.add_development_dependency 'rubocop', '~> 0.24.1'
39
- spec.add_development_dependency 'rubocop-rspec', '~> 1.1'
38
+ spec.add_development_dependency 'webmock', '~> 3.3'
39
+ spec.add_development_dependency 'vcr', '~> 6.0'
40
40
  end
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  require 'jortt/client'
3
2
  require 'jortt/client/version'
4
3
 
@@ -1,23 +1,26 @@
1
- # encoding: UTF-8
1
+ require 'oauth2'
2
+
3
+ require 'jortt/client/error'
2
4
  require 'jortt/client/customers'
3
5
  require 'jortt/client/invoices'
4
- require 'jortt/client/invoice'
6
+ require 'jortt/client/ledger_accounts'
5
7
 
6
8
  module Jortt
7
9
  ##
8
10
  # This class is the main interface used to communicate with the Jortt API.
9
11
  # It is by the {Jortt} module to create configured instances.
10
12
  class Client
11
- BASE_URL = 'https://app.jortt.nl/api'
13
+ SITE = 'https://api.jortt.nl'
14
+ OAUTH_PROVIDER_URL = 'https://app.jortt.nl/oauth-provider/oauth'
12
15
 
13
- attr_accessor :base_url, :app_name, :api_key
16
+ attr_accessor :token
14
17
 
15
18
  # Initialize a Jortt client.
16
19
  #
17
20
  # @example
18
21
  # Jortt::Client.new(
19
- # app_name: <application-name, chosen in jortt.nl>
20
- # api_key: <api-key, as provided by jortt.nl>
22
+ # "my-client-id",
23
+ # "my-client-secret"
21
24
  # )
22
25
  #
23
26
  # @params [ Hash ] opts Options for the client,
@@ -26,10 +29,17 @@ module Jortt
26
29
  # @return [ Jortt::Client ]
27
30
  #
28
31
  # @since 1.0.0
29
- def initialize(opts)
30
- self.base_url = opts.fetch(:base_url, BASE_URL)
31
- self.app_name = opts.fetch(:app_name)
32
- self.api_key = opts.fetch(:api_key)
32
+ def initialize(id, secret, opts = {})
33
+ oauth_provider_url = opts[:oauth_provider_url] || OAUTH_PROVIDER_URL
34
+
35
+ client = OAuth2::Client.new(id, secret,
36
+ site: opts[:site] || SITE,
37
+ token_url: "#{oauth_provider_url}/token",
38
+ authorize_url: "#{oauth_provider_url}/authorize",
39
+ auth_scheme: :basic_auth
40
+ )
41
+
42
+ @token = client.client_credentials.get_token(scope: "invoices:read invoices:write customers:read customers:write")
33
43
  end
34
44
 
35
45
  # Access the customer resource to perform operations.
@@ -56,16 +66,55 @@ module Jortt
56
66
  @invoices ||= Jortt::Client::Invoices.new(self)
57
67
  end
58
68
 
59
- # Access a single invoice resource to perform operations.
69
+ # Access the ledger_accounts resource.
60
70
  #
61
71
  # @example
62
- # client.invoice('abc')
72
+ # client.ledger_accounts
63
73
  #
64
- # @params [ String ] invoice_id The id of an invoice.
74
+ # @return [ Jortt::Client::LedgerAccounts ] entry to the leger_accounts resource.
65
75
  #
66
- # @return [ Jortt::Client::Invoice ] entry to the invoice resource.
67
- def invoice(invoice_id)
68
- Jortt::Client::Invoice.new(self, invoice_id)
76
+ # @since 5.0.0
77
+ def ledger_accounts
78
+ Jortt::Client::LedgerAccounts.new(self)
79
+ end
80
+
81
+ def get(path, params = {})
82
+ handle_response { token.get(path, params: params) }
83
+ end
84
+
85
+ def post(path, params = {})
86
+ handle_response { token.post(path, params: params) }
87
+ end
88
+
89
+ def put(path, params = {})
90
+ handle_response { token.put(path, params: params) }
91
+ end
92
+
93
+ def delete(path)
94
+ handle_response { token.delete(path) }
95
+ end
96
+
97
+ def handle_response(&block)
98
+ response = yield
99
+ return true if response.status == 204
100
+ response.parsed.fetch('data')
101
+ rescue OAuth2::Error => e
102
+ raise Error.from_response(e.response)
103
+ end
104
+
105
+ def paginated(path, params = {})
106
+ page = 1
107
+
108
+ Enumerator.new do |yielder|
109
+ loop do
110
+ response = token.get(path, params: params.merge(page: page)).parsed
111
+ response['data'].each { |item| yielder << item }
112
+ break if response['_links']['next'].nil?
113
+ page += 1
114
+ end
115
+ end
116
+ rescue OAuth2::Error => e
117
+ raise Error.from_response(e.response)
69
118
  end
70
119
 
71
120
  end
@@ -1,84 +1,91 @@
1
- # encoding: UTF-8
2
- require 'rest-client'
3
-
4
1
  module Jortt # :nodoc:
5
2
  class Client # :nodoc:
6
-
7
3
  ##
8
4
  # Exposes the operations available for a collection of customers.
9
5
  #
10
6
  # @see { Jortt::Client.customers }
11
7
  class Customers
8
+ attr_accessor :client
9
+
10
+ def initialize(client)
11
+ @client = client
12
+ end
12
13
 
13
- def initialize(config)
14
- @resource = RestClient::Resource.new(
15
- "#{config.base_url}/customers",
16
- user: config.app_name,
17
- password: config.api_key,
18
- )
14
+ ##
15
+ # Returns all customers using the GET /customers endpoint.
16
+ # https://developer.jortt.nl/#list-customers
17
+ #
18
+ # @example
19
+ # client.customers.index(query: 'Jane')
20
+ #
21
+ def index(query: nil)
22
+ client.paginated('/customers', query: query)
19
23
  end
20
24
 
21
25
  ##
22
- # Returns all customers using the GET /customers/all endpoint.
26
+ # Returns a customer using the GET /customers/{customer_id} endpoint.
27
+ # https://developer.jortt.nl/#get-customer-by-id
23
28
  #
24
29
  # @example
25
- # Jortt::Client.customers.all(page: 3, per_page: 10)
30
+ # client.customers.show("9afcd96e-caf8-40a1-96c9-1af16d0bc804")
26
31
  #
27
- def all(page: 1, per_page: 50)
28
- resource['all'].get(params: {page: page, per_page: per_page}) do |res|
29
- JSON.parse(res.body)
30
- end
32
+ def show(id)
33
+ client.get("/customers/#{id}")
31
34
  end
32
35
 
33
36
  ##
34
37
  # Creates a Customer using the POST /customers endpoint.
35
- # See https://app.jortt.nl/api-documentatie#klant-aanmaken
38
+ # https://developer.jortt.nl/#create-customer
36
39
  #
37
40
  # @example
38
- # Jortt::Client.customers.create(
39
- # company_name: "Jortt B.V.", # mandatory
40
- # attn: "Finance department", # optional
41
- # email: "support@jortt.nl", # optional
42
- # extra_information: "Our valued customer", # optional
43
- # address: {
44
- # street: "Street 100", # mandatory
45
- # postal_code: "1000 AA", # mandatory
46
- # city: "Amsterdam", # mandatory
47
- # country_code: "NL" # mandatory
48
- # }
41
+ # client.customers.create(
42
+ # is_private: false,
43
+ # customer_name: 'Nuka-Cola Corporation',
44
+ # address_street: 'Vault 11',
45
+ # address_postal_code: '1111AA',
46
+ # address_city: 'Mojave Wasteland'
49
47
  # )
48
+ #
50
49
  def create(payload)
51
- resource.post(JSON.generate('customer' => payload)) do |response|
52
- JSON.parse(response.body)
53
- end
50
+ client.post('/customers', payload)
54
51
  end
55
52
 
56
- # Performs a search on this resource, given a query.
57
- #
58
- # @example
59
- # customers.search('Zilverline')
53
+ ##
54
+ # Updates a Customer using the PUT /customers/{customer_id} endpoint.
55
+ # https://developer.jortt.nl/#update-customer
60
56
  #
61
57
  # @example
62
- # customers.search('Zilverline') do |response|
63
- # # Roll your own response handler
64
- # end
58
+ # client.customers.update(
59
+ # "9afcd96e-caf8-40a1-96c9-1af16d0bc804",
60
+ # { address_extra_information: 'foobar' }
61
+ # )
65
62
  #
66
- # @param [ Hash ] query A hash containing the fields to search for.
67
- # @param [ Proc ] block A custom response handler.
63
+ def update(id, payload)
64
+ client.put("/customers/#{id}", payload)
65
+ end
66
+
67
+ ##
68
+ # Deletes a Customer using the DELETE /customers/{customer_id} endpoint.
69
+ # https://developer.jortt.nl/#delete-a-customer
68
70
  #
69
- # @return [ Array<Hash> ] By default, a JSON parsed response body.
71
+ # @example
72
+ # client.customers.delete("9afcd96e-caf8-40a1-96c9-1af16d0bc804")
70
73
  #
71
- # @since 1.0.0
72
- def search(query)
73
- resource.get(params: {query: query}) do |response|
74
- JSON.parse(response.body)
75
- end
74
+ def delete(id)
75
+ client.delete("/customers/#{id}")
76
76
  end
77
77
 
78
- private
79
-
80
- attr_reader :resource
78
+ ##
79
+ # Send direct debit authorization to a Customer using POST /customers/{customer_id}/direct_debit_mandate.
80
+ # https://developer.jortt.nl/#send-direct-debit-authorization-to-a-customer
81
+ #
82
+ # @example
83
+ # client.customers.direct_debit_mandate("9afcd96e-caf8-40a1-96c9-1af16d0bc804")
84
+ #
81
85
 
86
+ def direct_debit_mandate(id)
87
+ client.post("/customers/#{id}/direct_debit_mandate")
88
+ end
82
89
  end
83
90
  end
84
91
  end