frame_payments 0.1.1 → 0.1.2

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -28
  3. data/lib/frame/resources/account.rb +63 -0
  4. data/lib/frame/resources/billing.rb +63 -0
  5. data/lib/frame/resources/capability.rb +27 -0
  6. data/lib/frame/resources/charge.rb +19 -0
  7. data/lib/frame/resources/charge_intent.rb +22 -4
  8. data/lib/frame/resources/charge_session.rb +29 -0
  9. data/lib/frame/resources/coupon.rb +33 -0
  10. data/lib/frame/resources/customer.rb +9 -0
  11. data/lib/frame/resources/customer_identity_verification.rb +4 -4
  12. data/lib/frame/resources/discount.rb +23 -0
  13. data/lib/frame/resources/dispute.rb +41 -0
  14. data/lib/frame/resources/geofence.rb +15 -0
  15. data/lib/frame/resources/invoice.rb +4 -40
  16. data/lib/frame/resources/invoice_line_item.rb +10 -11
  17. data/lib/frame/resources/onboarding.rb +31 -0
  18. data/lib/frame/resources/onboarding_session.rb +19 -0
  19. data/lib/frame/resources/payment_link_session.rb +15 -0
  20. data/lib/frame/resources/payment_method.rb +39 -13
  21. data/lib/frame/resources/payout.rb +15 -0
  22. data/lib/frame/resources/phone_verification.rb +19 -0
  23. data/lib/frame/resources/product.rb +9 -0
  24. data/lib/frame/resources/product_phase.rb +19 -11
  25. data/lib/frame/resources/promotion_code.rb +33 -0
  26. data/lib/frame/resources/refund.rb +0 -18
  27. data/lib/frame/resources/sonar_session.rb +29 -0
  28. data/lib/frame/resources/subscription.rb +0 -36
  29. data/lib/frame/resources/subscription_change_log.rb +15 -0
  30. data/lib/frame/resources/subscription_phase.rb +19 -11
  31. data/lib/frame/resources/terms_of_service.rb +19 -0
  32. data/lib/frame/resources/three_ds_intent.rb +27 -0
  33. data/lib/frame/resources/transfer.rb +23 -0
  34. data/lib/frame/resources/transfer_billing_agreement.rb +37 -0
  35. data/lib/frame/resources/transfer_fee_plan.rb +23 -0
  36. data/lib/frame/resources/webhook_endpoint.rb +0 -94
  37. data/lib/frame/resources.rb +34 -0
  38. data/lib/frame/util.rb +9 -0
  39. data/lib/frame/version.rb +1 -1
  40. metadata +24 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6cf55f58c221310a02c1b174cf083dcbd64e0f8a0c686b0415c6fcc526b31d4
4
- data.tar.gz: c3b8e99dceea096c3c97caefc7144df48db0a98e6c12f669aa3b11e62cea0600
3
+ metadata.gz: e94011b5aa8edb5c79e9296f38b08d3e9518595c8971cb8debeb0f27cf8d70d7
4
+ data.tar.gz: 9eeb830eb09c184d5e852b76b06ad52756b84c9b37060987f831c04030517156
5
5
  SHA512:
6
- metadata.gz: ee263639c4fd4a89b092854782406069ab0318b358d2f5fdce5c07c27ddb83a14ce233c4e69c977d6e2f403d1fe25c929d34ec939344e1c350febb8e47397fc0
7
- data.tar.gz: ae42413a4e927da7fd1923470cbc99a92579adb827cd60e924c88f83b31dd11b777676ed60530a621729a869ed460da50a62c302ed5e939caa314dd72ffbe694
6
+ metadata.gz: 671d6d04ddea46ada6f7d35c1ecc4d4e7d878c2e59e552faf646d727d95e26a376a6d62b057dcd8f830d73bab3cc781af37c674935d1156d031e1287fd93fa35
7
+ data.tar.gz: a736ea705d15942a2e4ed6cede295fdbe95a946d02569896e788e065696c803e828519eaa4cca42ee4bc015bbdb5f519353fc8a218c1a919146bf37aac6eb865
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Frame Payments Ruby Library
1
+ # Frame Payments - Ruby SDK
2
2
 
3
3
  A Ruby library for the Frame Payments API.
4
4
 
@@ -133,6 +133,8 @@ charge_intent = Frame::ChargeIntent.create(
133
133
  )
134
134
  ```
135
135
 
136
+ Optional: include `sonar_session_id` (string) when creating a charge intent to link the transaction to a Frame Sonar session for fraud protection (e.g. the value from `frame_charge_session_id` in client storage). See [Frame Sonar documentation](https://docs.framepayments.com/guides/sonar-fraud-protection).
137
+
136
138
  **Retrieve, list, and update:**
137
139
 
138
140
  ```ruby
@@ -147,13 +149,14 @@ intent.description = 'Updated description'
147
149
  intent.save
148
150
  ```
149
151
 
150
- **Authorize, capture, or cancel:**
152
+ **Confirm, capture, or cancel:**
151
153
 
152
154
  ```ruby
153
155
  intent = Frame::ChargeIntent.retrieve('ci_123456789')
154
- intent.authorize # Authorize the payment
156
+ intent.confirm # Confirm the payment
155
157
  intent.capture # Capture the authorized amount
156
158
  intent.cancel # Cancel the intent
159
+ intent.void_remaining # Void any remaining uncaptured amount
157
160
  ```
158
161
 
159
162
  ### Payment Methods
@@ -231,19 +234,11 @@ invoice = Frame::Invoice.create(
231
234
  )
232
235
  ```
233
236
 
234
- **Manage invoice lifecycle:**
237
+ **Issue an invoice:**
235
238
 
236
239
  ```ruby
237
240
  invoice = Frame::Invoice.retrieve('inv_123456789')
238
-
239
- # Finalize (make it payable)
240
- invoice.finalize
241
-
242
- # Mark as paid
243
- invoice.pay(payment_method: 'pm_123456789')
244
-
245
- # Void
246
- invoice.void
241
+ invoice.issue
247
242
  ```
248
243
 
249
244
  **List invoices:**
@@ -257,8 +252,7 @@ invoices = Frame::Invoice.list(customer: 'cus_123456789', status: 'paid')
257
252
  **Create a line item:**
258
253
 
259
254
  ```ruby
260
- line_item = Frame::InvoiceLineItem.create(
261
- invoice: 'inv_123456789',
255
+ line_item = Frame::InvoiceLineItem.create('inv_123456789',
262
256
  description: 'Product or service',
263
257
  quantity: 2,
264
258
  unit_amount: 5000
@@ -285,18 +279,10 @@ subscription = Frame::Subscription.create(
285
279
  )
286
280
  ```
287
281
 
288
- **Manage subscription:**
282
+ **Cancel a subscription:**
289
283
 
290
284
  ```ruby
291
285
  subscription = Frame::Subscription.retrieve('sub_123456789')
292
-
293
- # Pause
294
- subscription.pause
295
-
296
- # Resume
297
- subscription.resume
298
-
299
- # Cancel
300
286
  subscription.cancel
301
287
  ```
302
288
 
@@ -329,8 +315,7 @@ products = Frame::Product.list(active: true)
329
315
  **Create a product phase:**
330
316
 
331
317
  ```ruby
332
- phase = Frame::ProductPhase.create(
333
- product: 'prod_123456789',
318
+ phase = Frame::ProductPhase.create('prod_123456789',
334
319
  price: 10000,
335
320
  currency: 'usd',
336
321
  interval: 'month',
@@ -373,10 +358,10 @@ verification = Frame::CustomerIdentityVerification.create(
373
358
  )
374
359
  ```
375
360
 
376
- **Verify:**
361
+ **Upload documents:**
377
362
 
378
363
  ```ruby
379
- verification.verify
364
+ verification.upload_documents(documents: [...])
380
365
  ```
381
366
 
382
367
  **List verifications:**
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Account < APIResource
5
+ extend Frame::APIOperations::Create
6
+ extend Frame::APIOperations::List
7
+ include Frame::APIOperations::Save
8
+
9
+ OBJECT_NAME = "account"
10
+
11
+ def self.object_name
12
+ OBJECT_NAME
13
+ end
14
+
15
+ def self.create(params = {}, opts = {})
16
+ request_object(:post, "/v1/accounts", params, opts)
17
+ end
18
+
19
+ def self.list(params = {}, opts = {})
20
+ request_object(:get, "/v1/accounts", params, opts)
21
+ end
22
+
23
+ def self.retrieve(id, opts = {})
24
+ request_object(:get, "/v1/accounts/#{CGI.escape(id)}", {}, opts)
25
+ end
26
+
27
+ def self.disable(id, params = {}, opts = {})
28
+ request_object(:delete, "/v1/accounts/#{CGI.escape(id)}", params, opts)
29
+ end
30
+
31
+ def self.search(params = {}, opts = {})
32
+ request_object(:get, "/v1/accounts/search", params, opts)
33
+ end
34
+
35
+ def self.payment_methods(id, opts = {})
36
+ request_object(:get, "/v1/accounts/#{CGI.escape(id)}/payment_methods", {}, opts)
37
+ end
38
+
39
+ def self.plaid_link_token(id, opts = {})
40
+ request_object(:get, "/v1/accounts/#{CGI.escape(id)}/plaid_link_token", {}, opts)
41
+ end
42
+
43
+ def self.restrict(id, opts = {})
44
+ request_object(:post, "/v1/accounts/#{CGI.escape(id)}/restrict", {}, opts)
45
+ end
46
+
47
+ def self.unrestrict(id, opts = {})
48
+ request_object(:post, "/v1/accounts/#{CGI.escape(id)}/unrestrict", {}, opts)
49
+ end
50
+
51
+ def self.geo_compliance(id, opts = {})
52
+ request_object(:get, "/v1/accounts/#{CGI.escape(id)}/geo_compliance", {}, opts)
53
+ end
54
+
55
+ def save(params = {}, opts = {})
56
+ values = serialize_params(self).merge(params)
57
+ return self if values.empty?
58
+ updated = request_object(:patch, "/v1/accounts/#{CGI.escape(self["id"])}", values, opts)
59
+ initialize_from(updated)
60
+ self
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Billing < APIResource
5
+ OBJECT_NAME = "billing"
6
+
7
+ def self.object_name
8
+ OBJECT_NAME
9
+ end
10
+
11
+ def self.create_metering(params = {}, opts = {})
12
+ request_object(:post, "/v1/billing/metering", params, opts)
13
+ end
14
+
15
+ def self.get_metering(id, opts = {})
16
+ request_object(:get, "/v1/billing/metering/#{CGI.escape(id)}", {}, opts)
17
+ end
18
+
19
+ def self.update_metering(id, params = {}, opts = {})
20
+ request_object(:patch, "/v1/billing/metering/#{CGI.escape(id)}", params, opts)
21
+ end
22
+
23
+ def self.create_metering_event(params = {}, opts = {})
24
+ request_object(:post, "/v1/billing/metering_events", params, opts)
25
+ end
26
+
27
+ def self.get_metering_event(id, opts = {})
28
+ request_object(:get, "/v1/billing/metering_events/#{CGI.escape(id)}", {}, opts)
29
+ end
30
+
31
+ def self.update_metering_event(id, params = {}, opts = {})
32
+ request_object(:patch, "/v1/billing/metering_events/#{CGI.escape(id)}", params, opts)
33
+ end
34
+
35
+ def self.create_billing_invoice(params = {}, opts = {})
36
+ request_object(:post, "/v1/billing/billing_invoice", params, opts)
37
+ end
38
+
39
+ def self.create_billing_credit(params = {}, opts = {})
40
+ request_object(:post, "/v1/billing/billing_credit", params, opts)
41
+ end
42
+
43
+ def self.get_billing_credit(id, opts = {})
44
+ request_object(:get, "/v1/billing/billing_credit/#{CGI.escape(id)}", {}, opts)
45
+ end
46
+
47
+ def self.customer_report(params = {}, opts = {})
48
+ request_object(:get, "/v1/billing/report/customer", params, opts)
49
+ end
50
+
51
+ def self.event_report(event_name, params = {}, opts = {})
52
+ request_object(:get, "/v1/billing/report/event/#{CGI.escape(event_name)}", params, opts)
53
+ end
54
+
55
+ def self.events_report(params = {}, opts = {})
56
+ request_object(:get, "/v1/billing/report/events", params, opts)
57
+ end
58
+
59
+ def self.subscription_report(params = {}, opts = {})
60
+ request_object(:get, "/v1/billing/report/subscription", params, opts)
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Capability < APIResource
5
+ OBJECT_NAME = "capability"
6
+
7
+ def self.object_name
8
+ OBJECT_NAME
9
+ end
10
+
11
+ def self.list(account_id, params = {}, opts = {})
12
+ request_object(:get, "/v1/accounts/#{CGI.escape(account_id)}/capabilities", params, opts)
13
+ end
14
+
15
+ def self.request(account_id, params = {}, opts = {})
16
+ request_object(:post, "/v1/accounts/#{CGI.escape(account_id)}/capabilities", params, opts)
17
+ end
18
+
19
+ def self.retrieve(account_id, name, opts = {})
20
+ request_object(:get, "/v1/accounts/#{CGI.escape(account_id)}/capabilities/#{CGI.escape(name)}", {}, opts)
21
+ end
22
+
23
+ def self.disable(account_id, name, params = {}, opts = {})
24
+ request_object(:delete, "/v1/accounts/#{CGI.escape(account_id)}/capabilities/#{CGI.escape(name)}", params, opts)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Charge < APIResource
5
+ OBJECT_NAME = "charge"
6
+
7
+ def self.object_name
8
+ OBJECT_NAME
9
+ end
10
+
11
+ def self.retrieve(id, opts = {})
12
+ request_object(:get, "/v1/charges/#{CGI.escape(id)}", {}, opts)
13
+ end
14
+
15
+ def self.trace(id, opts = {})
16
+ request_object(:get, "/v1/charges/#{CGI.escape(id)}/trace", {}, opts)
17
+ end
18
+ end
19
+ end
@@ -40,19 +40,19 @@ module Frame
40
40
  )
41
41
  end
42
42
 
43
- def authorize(params = {}, opts = {})
43
+ def confirm(params = {}, opts = {})
44
44
  request_object(
45
45
  :post,
46
- "/v1/charge_intents/#{CGI.escape(self["id"])}/authorize",
46
+ "/v1/charge_intents/#{CGI.escape(self["id"])}/confirm",
47
47
  params,
48
48
  opts
49
49
  )
50
50
  end
51
51
 
52
- def self.authorize(id, params = {}, opts = {})
52
+ def self.confirm(id, params = {}, opts = {})
53
53
  request_object(
54
54
  :post,
55
- "/v1/charge_intents/#{CGI.escape(id)}/authorize",
55
+ "/v1/charge_intents/#{CGI.escape(id)}/confirm",
56
56
  params,
57
57
  opts
58
58
  )
@@ -94,6 +94,24 @@ module Frame
94
94
  )
95
95
  end
96
96
 
97
+ def void_remaining(params = {}, opts = {})
98
+ request_object(
99
+ :post,
100
+ "/v1/charge_intents/#{CGI.escape(self["id"])}/void_remaining",
101
+ params,
102
+ opts
103
+ )
104
+ end
105
+
106
+ def self.void_remaining(id, params = {}, opts = {})
107
+ request_object(
108
+ :post,
109
+ "/v1/charge_intents/#{CGI.escape(id)}/void_remaining",
110
+ params,
111
+ opts
112
+ )
113
+ end
114
+
97
115
  def save(params = {}, opts = {})
98
116
  values = serialize_params(self).merge(params)
99
117
 
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class ChargeSession < APIResource
5
+ include Frame::APIOperations::Save
6
+
7
+ OBJECT_NAME = "charge_session"
8
+
9
+ def self.object_name
10
+ OBJECT_NAME
11
+ end
12
+
13
+ def self.create(params = {}, opts = {})
14
+ request_object(:post, "/v1/charge_sessions", params, opts)
15
+ end
16
+
17
+ def self.update(id, params = {}, opts = {})
18
+ request_object(:patch, "/v1/charge_sessions/#{CGI.escape(id)}", params, opts)
19
+ end
20
+
21
+ def save(params = {}, opts = {})
22
+ values = serialize_params(self).merge(params)
23
+ return self if values.empty?
24
+ updated = request_object(:patch, "/v1/charge_sessions/#{CGI.escape(self["id"])}", values, opts)
25
+ initialize_from(updated)
26
+ self
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Coupon < APIResource
5
+ include Frame::APIOperations::Save
6
+
7
+ OBJECT_NAME = "coupon"
8
+
9
+ def self.object_name
10
+ OBJECT_NAME
11
+ end
12
+
13
+ def self.create(params = {}, opts = {})
14
+ request_object(:post, "/v1/coupons", params, opts)
15
+ end
16
+
17
+ def self.list(params = {}, opts = {})
18
+ request_object(:get, "/v1/coupons", params, opts)
19
+ end
20
+
21
+ def self.retrieve(id, opts = {})
22
+ request_object(:get, "/v1/coupons/#{CGI.escape(id)}", {}, opts)
23
+ end
24
+
25
+ def save(params = {}, opts = {})
26
+ values = serialize_params(self).merge(params)
27
+ return self if values.empty?
28
+ updated = request_object(:patch, "/v1/coupons/#{CGI.escape(self["id"])}", values, opts)
29
+ initialize_from(updated)
30
+ self
31
+ end
32
+ end
33
+ end
@@ -95,6 +95,15 @@ module Frame
95
95
  )
96
96
  end
97
97
 
98
+ def self.payment_methods(id, opts = {})
99
+ request_object(
100
+ :get,
101
+ "/v1/customers/#{CGI.escape(id)}/payment_methods",
102
+ {},
103
+ opts
104
+ )
105
+ end
106
+
98
107
  def save(params = {}, opts = {})
99
108
  values = serialize_params(self).merge(params)
100
109
 
@@ -39,19 +39,19 @@ module Frame
39
39
  )
40
40
  end
41
41
 
42
- def verify(params = {}, opts = {})
42
+ def upload_documents(params = {}, opts = {})
43
43
  request_object(
44
44
  :post,
45
- "/v1/customer_identity_verifications/#{CGI.escape(self["id"])}/verify",
45
+ "/v1/customer_identity_verifications/#{CGI.escape(self["id"])}/upload_documents",
46
46
  params,
47
47
  opts
48
48
  )
49
49
  end
50
50
 
51
- def self.verify(id, params = {}, opts = {})
51
+ def self.upload_documents(id, params = {}, opts = {})
52
52
  request_object(
53
53
  :post,
54
- "/v1/customer_identity_verifications/#{CGI.escape(id)}/verify",
54
+ "/v1/customer_identity_verifications/#{CGI.escape(id)}/upload_documents",
55
55
  params,
56
56
  opts
57
57
  )
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Discount < APIResource
5
+ OBJECT_NAME = "discount"
6
+
7
+ def self.object_name
8
+ OBJECT_NAME
9
+ end
10
+
11
+ def self.list(params = {}, opts = {})
12
+ request_object(:get, "/v1/discounts", params, opts)
13
+ end
14
+
15
+ def self.retrieve(id, opts = {})
16
+ request_object(:get, "/v1/discounts/#{CGI.escape(id)}", {}, opts)
17
+ end
18
+
19
+ def self.validate(params = {}, opts = {})
20
+ request_object(:post, "/v1/discounts/validate", params, opts)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Dispute < APIResource
5
+ include Frame::APIOperations::Save
6
+
7
+ OBJECT_NAME = "dispute"
8
+
9
+ def self.object_name
10
+ OBJECT_NAME
11
+ end
12
+
13
+ def self.list(params = {}, opts = {})
14
+ request_object(:get, "/v1/disputes", params, opts)
15
+ end
16
+
17
+ def self.retrieve(id, opts = {})
18
+ request_object(:get, "/v1/disputes/#{CGI.escape(id)}", {}, opts)
19
+ end
20
+
21
+ def self.update(id, params = {}, opts = {})
22
+ request_object(:patch, "/v1/disputes/#{CGI.escape(id)}", params, opts)
23
+ end
24
+
25
+ def save(params = {}, opts = {})
26
+ values = serialize_params(self).merge(params)
27
+ return self if values.empty?
28
+ updated = request_object(:patch, "/v1/disputes/#{CGI.escape(self["id"])}", values, opts)
29
+ initialize_from(updated)
30
+ self
31
+ end
32
+
33
+ def create_document(params = {}, opts = {})
34
+ request_object(:post, "/v1/disputes/#{CGI.escape(self["id"])}/documents", params, opts)
35
+ end
36
+
37
+ def self.create_document(id, params = {}, opts = {})
38
+ request_object(:post, "/v1/disputes/#{CGI.escape(id)}/documents", params, opts)
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Geofence < APIResource
5
+ OBJECT_NAME = "geofence"
6
+
7
+ def self.object_name
8
+ OBJECT_NAME
9
+ end
10
+
11
+ def self.list(params = {}, opts = {})
12
+ request_object(:get, "/v1/geofences", params, opts)
13
+ end
14
+ end
15
+ end
@@ -77,55 +77,19 @@ module Frame
77
77
  )
78
78
  end
79
79
 
80
- def finalize(params = {}, opts = {})
80
+ def issue(params = {}, opts = {})
81
81
  request_object(
82
82
  :post,
83
- "/v1/invoices/#{CGI.escape(self["id"])}/finalize",
83
+ "/v1/invoices/#{CGI.escape(self["id"])}/issue",
84
84
  params,
85
85
  opts
86
86
  )
87
87
  end
88
88
 
89
- def self.finalize(id, params = {}, opts = {})
89
+ def self.issue(id, params = {}, opts = {})
90
90
  request_object(
91
91
  :post,
92
- "/v1/invoices/#{CGI.escape(id)}/finalize",
93
- params,
94
- opts
95
- )
96
- end
97
-
98
- def pay(params = {}, opts = {})
99
- request_object(
100
- :post,
101
- "/v1/invoices/#{CGI.escape(self["id"])}/pay",
102
- params,
103
- opts
104
- )
105
- end
106
-
107
- def self.pay(id, params = {}, opts = {})
108
- request_object(
109
- :post,
110
- "/v1/invoices/#{CGI.escape(id)}/pay",
111
- params,
112
- opts
113
- )
114
- end
115
-
116
- def void(params = {}, opts = {})
117
- request_object(
118
- :post,
119
- "/v1/invoices/#{CGI.escape(self["id"])}/void",
120
- params,
121
- opts
122
- )
123
- end
124
-
125
- def self.void(id, params = {}, opts = {})
126
- request_object(
127
- :post,
128
- "/v1/invoices/#{CGI.escape(id)}/void",
92
+ "/v1/invoices/#{CGI.escape(id)}/issue",
129
93
  params,
130
94
  opts
131
95
  )
@@ -13,38 +13,37 @@ module Frame
13
13
  OBJECT_NAME
14
14
  end
15
15
 
16
- def self.create(params = {}, opts = {})
16
+ def self.create(invoice_id, params = {}, opts = {})
17
17
  request_object(
18
18
  :post,
19
- "/v1/invoice_line_items",
19
+ "/v1/invoices/#{CGI.escape(invoice_id)}/line_items",
20
20
  params,
21
21
  opts
22
22
  )
23
23
  end
24
24
 
25
- def self.list(params = {}, opts = {})
25
+ def self.list(invoice_id, params = {}, opts = {})
26
26
  request_object(
27
27
  :get,
28
- "/v1/invoice_line_items",
28
+ "/v1/invoices/#{CGI.escape(invoice_id)}/line_items",
29
29
  params,
30
30
  opts
31
31
  )
32
32
  end
33
33
 
34
- def self.retrieve(id, opts = {})
35
- id = Util.normalize_id(id)
34
+ def self.retrieve(invoice_id, id, opts = {})
36
35
  request_object(
37
36
  :get,
38
- "/v1/invoice_line_items/#{CGI.escape(id)}",
37
+ "/v1/invoices/#{CGI.escape(invoice_id)}/line_items/#{CGI.escape(id)}",
39
38
  {},
40
39
  opts
41
40
  )
42
41
  end
43
42
 
44
- def self.delete(id, params = {}, opts = {})
43
+ def self.delete(invoice_id, id, params = {}, opts = {})
45
44
  request_object(
46
45
  :delete,
47
- "/v1/invoice_line_items/#{CGI.escape(id)}",
46
+ "/v1/invoices/#{CGI.escape(invoice_id)}/line_items/#{CGI.escape(id)}",
48
47
  params,
49
48
  opts
50
49
  )
@@ -59,7 +58,7 @@ module Frame
59
58
 
60
59
  updated = request_object(
61
60
  :patch,
62
- "/v1/invoice_line_items/#{CGI.escape(self["id"])}",
61
+ "/v1/invoices/#{CGI.escape(self["invoice"])}/line_items/#{CGI.escape(self["id"])}",
63
62
  values,
64
63
  opts
65
64
  )
@@ -71,7 +70,7 @@ module Frame
71
70
  def delete(params = {}, opts = {})
72
71
  request_object(
73
72
  :delete,
74
- "/v1/invoice_line_items/#{CGI.escape(self["id"])}",
73
+ "/v1/invoices/#{CGI.escape(self["invoice"])}/line_items/#{CGI.escape(self["id"])}",
75
74
  params,
76
75
  opts
77
76
  )
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Frame
4
+ class Onboarding < APIResource
5
+ OBJECT_NAME = "onboarding_session"
6
+
7
+ def self.object_name
8
+ OBJECT_NAME
9
+ end
10
+
11
+ def self.list(params = {}, opts = {})
12
+ request_object(:get, "/v1/onboarding/sessions", params, opts)
13
+ end
14
+
15
+ def self.create(params = {}, opts = {})
16
+ request_object(:post, "/v1/onboarding/sessions", params, opts)
17
+ end
18
+
19
+ def self.retrieve(session_id, opts = {})
20
+ request_object(:get, "/v1/onboarding/sessions/#{CGI.escape(session_id)}", {}, opts)
21
+ end
22
+
23
+ def self.update(session_id, params = {}, opts = {})
24
+ request_object(:patch, "/v1/onboarding/sessions/#{CGI.escape(session_id)}", params, opts)
25
+ end
26
+
27
+ def self.payout(session_id, params = {}, opts = {})
28
+ request_object(:post, "/v1/onboarding/sessions/#{CGI.escape(session_id)}/payout", params, opts)
29
+ end
30
+ end
31
+ end