frame_payments 0.1.2 → 0.1.5
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/Rakefile +7 -0
- data/lib/frame/resources/account.rb +15 -0
- data/lib/frame/resources/bank_account.rb +17 -0
- data/lib/frame/resources/beneficial_owner.rb +39 -0
- data/lib/frame/resources/billing.rb +26 -0
- data/lib/frame/resources/charge_intent.rb +14 -0
- data/lib/frame/resources/coupon.rb +4 -0
- data/lib/frame/resources/customer.rb +12 -0
- data/lib/frame/resources/customer_identity_verification.rb +23 -0
- data/lib/frame/resources/invoice.rb +9 -0
- data/lib/frame/resources/invoice_line_item.rb +9 -0
- data/lib/frame/resources/merchant_balance.rb +17 -0
- data/lib/frame/resources/onboarding_session.rb +8 -0
- data/lib/frame/resources/payment_method.rb +45 -0
- data/lib/frame/resources/payout.rb +5 -0
- data/lib/frame/resources/phone_verification.rb +6 -0
- data/lib/frame/resources/product.rb +9 -0
- data/lib/frame/resources/product_phase.rb +9 -0
- data/lib/frame/resources/promotion_code.rb +4 -0
- data/lib/frame/resources/subscription.rb +43 -8
- data/lib/frame/resources/subscription_phase.rb +9 -0
- data/lib/frame/resources/transfer.rb +9 -0
- data/lib/frame/resources/webhook_endpoint.rb +45 -6
- data/lib/frame/resources.rb +5 -0
- data/lib/frame/util.rb +1 -0
- data/lib/frame/version.rb +1 -1
- data/surface-manifest.json +999 -0
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 627ffb510c44034cb3444cf84429907ac50f9a03dcba464e0a1253fac805fa78
|
|
4
|
+
data.tar.gz: 74846ed872e992c4c445201b0b3d4b5d805752aeec2949ec2d098abae868e1a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be5a1d3fa63d8be4c21c70b4891e69cd1fd3f584e541e94b4a55892a10b4ca556b852ffa180c7c21282052fd16e5ed407446dc099ad9261227fb29c6c67802b1
|
|
7
|
+
data.tar.gz: d3a5dd3a84b29feda5538123ea9633b863349ab7712c3018c7b36e139800db589db2c45deb82fe3350ce53d47d78c885bbbdbb089c650ee991bf700815140dcc
|
data/Rakefile
CHANGED
|
@@ -8,3 +8,10 @@ Minitest::TestTask.create
|
|
|
8
8
|
require "standard/rake"
|
|
9
9
|
|
|
10
10
|
task default: %i[test standard]
|
|
11
|
+
|
|
12
|
+
# Regenerate the SDK surface manifest consumed by the cross-SDK conformance
|
|
13
|
+
# audit (FRA-4516 producer / FRA-4457 consumer).
|
|
14
|
+
desc "Generate the surface manifest (surface-manifest.json)"
|
|
15
|
+
task :surface_manifest do
|
|
16
|
+
sh File.expand_path("bin/generate-surface-manifest", __dir__)
|
|
17
|
+
end
|
|
@@ -12,6 +12,8 @@ module Frame
|
|
|
12
12
|
OBJECT_NAME
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
DEPRECATED_METHODS = %i[geo_compliance].freeze
|
|
16
|
+
|
|
15
17
|
def self.create(params = {}, opts = {})
|
|
16
18
|
request_object(:post, "/v1/accounts", params, opts)
|
|
17
19
|
end
|
|
@@ -24,6 +26,10 @@ module Frame
|
|
|
24
26
|
request_object(:get, "/v1/accounts/#{CGI.escape(id)}", {}, opts)
|
|
25
27
|
end
|
|
26
28
|
|
|
29
|
+
def self.update(id, params = {}, opts = {})
|
|
30
|
+
request_object(:patch, "/v1/accounts/#{CGI.escape(id)}", params, opts)
|
|
31
|
+
end
|
|
32
|
+
|
|
27
33
|
def self.disable(id, params = {}, opts = {})
|
|
28
34
|
request_object(:delete, "/v1/accounts/#{CGI.escape(id)}", params, opts)
|
|
29
35
|
end
|
|
@@ -48,6 +54,15 @@ module Frame
|
|
|
48
54
|
request_object(:post, "/v1/accounts/#{CGI.escape(id)}/unrestrict", {}, opts)
|
|
49
55
|
end
|
|
50
56
|
|
|
57
|
+
def self.get_geo_compliance(id, opts = {})
|
|
58
|
+
request_object(:get, "/v1/accounts/#{CGI.escape(id)}/geo_compliance", {}, opts)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def self.confirm_kyc_prefill(id, opts = {})
|
|
62
|
+
request_object(:post, "/v1/accounts/#{CGI.escape(id)}/kyc_prefill/confirm", {}, opts)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# @deprecated Use `get_geo_compliance` instead. Removed at v2.
|
|
51
66
|
def self.geo_compliance(id, opts = {})
|
|
52
67
|
request_object(:get, "/v1/accounts/#{CGI.escape(id)}/geo_compliance", {}, opts)
|
|
53
68
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Frame
|
|
4
|
+
class BankAccount < APIResource
|
|
5
|
+
extend Frame::APIOperations::Create
|
|
6
|
+
|
|
7
|
+
OBJECT_NAME = "bank_account"
|
|
8
|
+
|
|
9
|
+
def self.object_name
|
|
10
|
+
OBJECT_NAME
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.create(params = {}, opts = {})
|
|
14
|
+
request_object(:post, "/v1/bank_accounts", params, opts)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Frame
|
|
4
|
+
class BeneficialOwner < APIResource
|
|
5
|
+
OBJECT_NAME = "beneficial_owner"
|
|
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)}/beneficial_owners", params, opts)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.create(account_id, params = {}, opts = {})
|
|
16
|
+
request_object(:post, "/v1/accounts/#{CGI.escape(account_id)}/beneficial_owners", params, opts)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.retrieve(account_id, id, opts = {})
|
|
20
|
+
request_object(:get, "/v1/accounts/#{CGI.escape(account_id)}/beneficial_owners/#{CGI.escape(id)}", {}, opts)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.update(account_id, id, params = {}, opts = {})
|
|
24
|
+
request_object(:patch, "/v1/accounts/#{CGI.escape(account_id)}/beneficial_owners/#{CGI.escape(id)}", params, opts)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.delete(account_id, id, params = {}, opts = {})
|
|
28
|
+
request_object(:delete, "/v1/accounts/#{CGI.escape(account_id)}/beneficial_owners/#{CGI.escape(id)}", params, opts)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.confirm_roster(account_id, params = {}, opts = {})
|
|
32
|
+
request_object(:post, "/v1/accounts/#{CGI.escape(account_id)}/beneficial_owners/confirm", params, opts)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.resend_invite(account_id, id, params = {}, opts = {})
|
|
36
|
+
request_object(:post, "/v1/accounts/#{CGI.escape(account_id)}/beneficial_owners/#{CGI.escape(id)}/resend_invite", params, opts)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -8,6 +8,8 @@ module Frame
|
|
|
8
8
|
OBJECT_NAME
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
DEPRECATED_METHODS = %i[customer_report event_report events_report subscription_report].freeze
|
|
12
|
+
|
|
11
13
|
def self.create_metering(params = {}, opts = {})
|
|
12
14
|
request_object(:post, "/v1/billing/metering", params, opts)
|
|
13
15
|
end
|
|
@@ -44,20 +46,44 @@ module Frame
|
|
|
44
46
|
request_object(:get, "/v1/billing/billing_credit/#{CGI.escape(id)}", {}, opts)
|
|
45
47
|
end
|
|
46
48
|
|
|
49
|
+
def self.get_customer_report(params = {}, opts = {})
|
|
50
|
+
request_object(:get, "/v1/billing/report/customer", params, opts)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# @deprecated Use `get_customer_report` instead. Removed at v2.
|
|
47
54
|
def self.customer_report(params = {}, opts = {})
|
|
48
55
|
request_object(:get, "/v1/billing/report/customer", params, opts)
|
|
49
56
|
end
|
|
50
57
|
|
|
58
|
+
def self.get_event_report(event_name, params = {}, opts = {})
|
|
59
|
+
request_object(:get, "/v1/billing/report/event/#{CGI.escape(event_name)}", params, opts)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# @deprecated Use `get_event_report` instead. Removed at v2.
|
|
51
63
|
def self.event_report(event_name, params = {}, opts = {})
|
|
52
64
|
request_object(:get, "/v1/billing/report/event/#{CGI.escape(event_name)}", params, opts)
|
|
53
65
|
end
|
|
54
66
|
|
|
67
|
+
def self.get_events_report(params = {}, opts = {})
|
|
68
|
+
request_object(:get, "/v1/billing/report/events", params, opts)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# @deprecated Use `get_events_report` instead. Removed at v2.
|
|
55
72
|
def self.events_report(params = {}, opts = {})
|
|
56
73
|
request_object(:get, "/v1/billing/report/events", params, opts)
|
|
57
74
|
end
|
|
58
75
|
|
|
76
|
+
def self.get_subscription_report(params = {}, opts = {})
|
|
77
|
+
request_object(:get, "/v1/billing/report/subscription", params, opts)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @deprecated Use `get_subscription_report` instead. Removed at v2.
|
|
59
81
|
def self.subscription_report(params = {}, opts = {})
|
|
60
82
|
request_object(:get, "/v1/billing/report/subscription", params, opts)
|
|
61
83
|
end
|
|
84
|
+
|
|
85
|
+
def self.threshold_progress_report(params = {}, opts = {})
|
|
86
|
+
request_object(:get, "/v1/billing/report/threshold_progress", params, opts)
|
|
87
|
+
end
|
|
62
88
|
end
|
|
63
89
|
end
|
|
@@ -12,6 +12,9 @@ module Frame
|
|
|
12
12
|
OBJECT_NAME
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
DEPRECATED_METHODS = %i[create retrieve list confirm capture cancel void_remaining save].freeze
|
|
16
|
+
|
|
17
|
+
# @deprecated Use Frame::Transfer.create instead. Removed at v2.
|
|
15
18
|
def self.create(params = {}, opts = {})
|
|
16
19
|
request_object(
|
|
17
20
|
:post,
|
|
@@ -21,6 +24,7 @@ module Frame
|
|
|
21
24
|
)
|
|
22
25
|
end
|
|
23
26
|
|
|
27
|
+
# @deprecated Use Frame::Transfer.list instead. Removed at v2.
|
|
24
28
|
def self.list(params = {}, opts = {})
|
|
25
29
|
request_object(
|
|
26
30
|
:get,
|
|
@@ -30,6 +34,7 @@ module Frame
|
|
|
30
34
|
)
|
|
31
35
|
end
|
|
32
36
|
|
|
37
|
+
# @deprecated Use Frame::Transfer.retrieve instead. Removed at v2.
|
|
33
38
|
def self.retrieve(id, opts = {})
|
|
34
39
|
id = Util.normalize_id(id)
|
|
35
40
|
request_object(
|
|
@@ -40,6 +45,7 @@ module Frame
|
|
|
40
45
|
)
|
|
41
46
|
end
|
|
42
47
|
|
|
48
|
+
# @deprecated Use Frame::Transfer.confirm instead. Removed at v2.
|
|
43
49
|
def confirm(params = {}, opts = {})
|
|
44
50
|
request_object(
|
|
45
51
|
:post,
|
|
@@ -49,6 +55,7 @@ module Frame
|
|
|
49
55
|
)
|
|
50
56
|
end
|
|
51
57
|
|
|
58
|
+
# @deprecated Use Frame::Transfer.confirm instead. Removed at v2.
|
|
52
59
|
def self.confirm(id, params = {}, opts = {})
|
|
53
60
|
request_object(
|
|
54
61
|
:post,
|
|
@@ -58,6 +65,7 @@ module Frame
|
|
|
58
65
|
)
|
|
59
66
|
end
|
|
60
67
|
|
|
68
|
+
# @deprecated Removed at v2. No canonical transfer equivalent yet (FRA-4463).
|
|
61
69
|
def capture(params = {}, opts = {})
|
|
62
70
|
request_object(
|
|
63
71
|
:post,
|
|
@@ -67,6 +75,7 @@ module Frame
|
|
|
67
75
|
)
|
|
68
76
|
end
|
|
69
77
|
|
|
78
|
+
# @deprecated Removed at v2. No canonical transfer equivalent yet (FRA-4463).
|
|
70
79
|
def self.capture(id, params = {}, opts = {})
|
|
71
80
|
request_object(
|
|
72
81
|
:post,
|
|
@@ -76,6 +85,7 @@ module Frame
|
|
|
76
85
|
)
|
|
77
86
|
end
|
|
78
87
|
|
|
88
|
+
# @deprecated Removed at v2. No canonical transfer equivalent yet (FRA-4463).
|
|
79
89
|
def cancel(params = {}, opts = {})
|
|
80
90
|
request_object(
|
|
81
91
|
:post,
|
|
@@ -85,6 +95,7 @@ module Frame
|
|
|
85
95
|
)
|
|
86
96
|
end
|
|
87
97
|
|
|
98
|
+
# @deprecated Removed at v2. No canonical transfer equivalent yet (FRA-4463).
|
|
88
99
|
def self.cancel(id, params = {}, opts = {})
|
|
89
100
|
request_object(
|
|
90
101
|
:post,
|
|
@@ -94,6 +105,7 @@ module Frame
|
|
|
94
105
|
)
|
|
95
106
|
end
|
|
96
107
|
|
|
108
|
+
# @deprecated Removed at v2. No canonical transfer equivalent yet (FRA-4463).
|
|
97
109
|
def void_remaining(params = {}, opts = {})
|
|
98
110
|
request_object(
|
|
99
111
|
:post,
|
|
@@ -103,6 +115,7 @@ module Frame
|
|
|
103
115
|
)
|
|
104
116
|
end
|
|
105
117
|
|
|
118
|
+
# @deprecated Removed at v2. No canonical transfer equivalent yet (FRA-4463).
|
|
106
119
|
def self.void_remaining(id, params = {}, opts = {})
|
|
107
120
|
request_object(
|
|
108
121
|
:post,
|
|
@@ -112,6 +125,7 @@ module Frame
|
|
|
112
125
|
)
|
|
113
126
|
end
|
|
114
127
|
|
|
128
|
+
# @deprecated Removed at v2. No canonical transfer equivalent yet (FRA-4463).
|
|
115
129
|
def save(params = {}, opts = {})
|
|
116
130
|
values = serialize_params(self).merge(params)
|
|
117
131
|
|
|
@@ -22,6 +22,10 @@ module Frame
|
|
|
22
22
|
request_object(:get, "/v1/coupons/#{CGI.escape(id)}", {}, opts)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
def self.update(id, params = {}, opts = {})
|
|
26
|
+
request_object(:patch, "/v1/coupons/#{CGI.escape(id)}", params, opts)
|
|
27
|
+
end
|
|
28
|
+
|
|
25
29
|
def save(params = {}, opts = {})
|
|
26
30
|
values = serialize_params(self).merge(params)
|
|
27
31
|
return self if values.empty?
|
|
@@ -13,6 +13,11 @@ module Frame
|
|
|
13
13
|
OBJECT_NAME
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
# Customers are deprecated in favor of Accounts (M2 demotion). Only methods
|
|
17
|
+
# with a clear cross-resource target are demoted; create/retrieve/list/
|
|
18
|
+
# search/save stay non-deprecated pending an unambiguous mapping.
|
|
19
|
+
DEPRECATED_METHODS = %i[delete block unblock payment_methods].freeze
|
|
20
|
+
|
|
16
21
|
def self.create(params = {}, opts = {})
|
|
17
22
|
request_object(
|
|
18
23
|
:post,
|
|
@@ -50,6 +55,7 @@ module Frame
|
|
|
50
55
|
)
|
|
51
56
|
end
|
|
52
57
|
|
|
58
|
+
# @deprecated Use `Account.disable` instead. Removed at v2.
|
|
53
59
|
def self.delete(id, params = {}, opts = {})
|
|
54
60
|
request_object(
|
|
55
61
|
:delete,
|
|
@@ -59,6 +65,7 @@ module Frame
|
|
|
59
65
|
)
|
|
60
66
|
end
|
|
61
67
|
|
|
68
|
+
# @deprecated Account.block pending a monolith route; no re-route yet. Removed at v2.
|
|
62
69
|
def block(params = {}, opts = {})
|
|
63
70
|
request_object(
|
|
64
71
|
:post,
|
|
@@ -68,6 +75,7 @@ module Frame
|
|
|
68
75
|
)
|
|
69
76
|
end
|
|
70
77
|
|
|
78
|
+
# @deprecated Account.block pending a monolith route; no re-route yet. Removed at v2.
|
|
71
79
|
def self.block(id, params = {}, opts = {})
|
|
72
80
|
request_object(
|
|
73
81
|
:post,
|
|
@@ -77,6 +85,7 @@ module Frame
|
|
|
77
85
|
)
|
|
78
86
|
end
|
|
79
87
|
|
|
88
|
+
# @deprecated Account.unblock pending a monolith route; no re-route yet. Removed at v2.
|
|
80
89
|
def unblock(params = {}, opts = {})
|
|
81
90
|
request_object(
|
|
82
91
|
:post,
|
|
@@ -86,6 +95,7 @@ module Frame
|
|
|
86
95
|
)
|
|
87
96
|
end
|
|
88
97
|
|
|
98
|
+
# @deprecated Account.unblock pending a monolith route; no re-route yet. Removed at v2.
|
|
89
99
|
def self.unblock(id, params = {}, opts = {})
|
|
90
100
|
request_object(
|
|
91
101
|
:post,
|
|
@@ -95,6 +105,7 @@ module Frame
|
|
|
95
105
|
)
|
|
96
106
|
end
|
|
97
107
|
|
|
108
|
+
# @deprecated Use `PaymentMethod.list(account_id:)` instead (FRA-4461). Removed at v2.
|
|
98
109
|
def self.payment_methods(id, opts = {})
|
|
99
110
|
request_object(
|
|
100
111
|
:get,
|
|
@@ -122,6 +133,7 @@ module Frame
|
|
|
122
133
|
self
|
|
123
134
|
end
|
|
124
135
|
|
|
136
|
+
# @deprecated Use `Account.disable` instead. Removed at v2.
|
|
125
137
|
def delete(params = {}, opts = {})
|
|
126
138
|
request_object(
|
|
127
139
|
:delete,
|
|
@@ -11,6 +11,12 @@ module Frame
|
|
|
11
11
|
OBJECT_NAME
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Methods deprecated for removal at v2. `list` has no backing route (the
|
|
15
|
+
# monolith exposes customer_identity_verifications only as [:create, :show];
|
|
16
|
+
# there is no index action / public list endpoint), so it is a no-op that
|
|
17
|
+
# 404s — kept only so existing callers don't NoMethodError before v2.
|
|
18
|
+
DEPRECATED_METHODS = %i[list].freeze
|
|
19
|
+
|
|
14
20
|
def self.create(params = {}, opts = {})
|
|
15
21
|
request_object(
|
|
16
22
|
:post,
|
|
@@ -20,6 +26,23 @@ module Frame
|
|
|
20
26
|
)
|
|
21
27
|
end
|
|
22
28
|
|
|
29
|
+
# Create an identity verification for an existing customer.
|
|
30
|
+
# POST /v1/customer_identity_verifications/{customer_id}
|
|
31
|
+
# (monolith customer_identity_verifications#create_from_customer).
|
|
32
|
+
# The documented route takes only the customer_id path param — no request
|
|
33
|
+
# body — so no params argument is exposed.
|
|
34
|
+
def self.create_for_customer(customer_id, opts = {})
|
|
35
|
+
customer_id = Util.normalize_id(customer_id)
|
|
36
|
+
request_object(
|
|
37
|
+
:post,
|
|
38
|
+
"/v1/customer_identity_verifications/#{CGI.escape(customer_id)}",
|
|
39
|
+
{},
|
|
40
|
+
opts
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# @deprecated No public list endpoint exists for this resource; this 404s.
|
|
45
|
+
# Removed at v2. See DEPRECATED_METHODS.
|
|
23
46
|
def self.list(params = {}, opts = {})
|
|
24
47
|
request_object(
|
|
25
48
|
:get,
|
|
@@ -41,6 +41,15 @@ module Frame
|
|
|
41
41
|
)
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
+
def self.update(id, params = {}, opts = {})
|
|
45
|
+
request_object(
|
|
46
|
+
:patch,
|
|
47
|
+
"/v1/invoices/#{CGI.escape(id)}",
|
|
48
|
+
params,
|
|
49
|
+
opts
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
44
53
|
def self.delete(id, params = {}, opts = {})
|
|
45
54
|
request_object(
|
|
46
55
|
:delete,
|
|
@@ -40,6 +40,15 @@ module Frame
|
|
|
40
40
|
)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
def self.update(invoice_id, id, params = {}, opts = {})
|
|
44
|
+
request_object(
|
|
45
|
+
:patch,
|
|
46
|
+
"/v1/invoices/#{CGI.escape(invoice_id)}/line_items/#{CGI.escape(id)}",
|
|
47
|
+
params,
|
|
48
|
+
opts
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
43
52
|
def self.delete(invoice_id, id, params = {}, opts = {})
|
|
44
53
|
request_object(
|
|
45
54
|
:delete,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Frame
|
|
4
|
+
# Top-level singleton: the authenticated merchant's balance (available funds,
|
|
5
|
+
# reserved amounts, pending payouts). GET /v1/merchant_balance — no id.
|
|
6
|
+
class MerchantBalance < APIResource
|
|
7
|
+
OBJECT_NAME = "merchant_balance"
|
|
8
|
+
|
|
9
|
+
def self.object_name
|
|
10
|
+
OBJECT_NAME
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.retrieve(opts = {})
|
|
14
|
+
request_object(:get, "/v1/merchant_balance", {}, opts)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -15,5 +15,13 @@ module Frame
|
|
|
15
15
|
def self.list(params = {}, opts = {})
|
|
16
16
|
request_object(:get, "/v1/onboarding_sessions", params, opts)
|
|
17
17
|
end
|
|
18
|
+
|
|
19
|
+
# Bootstrap the embedded onboarding Web Component from a client_secret.
|
|
20
|
+
# GET /v1/onboarding_sessions/bootstrap — authenticate with the onb_sess_*
|
|
21
|
+
# token (pass via opts). Returns session metadata, the ordered step list,
|
|
22
|
+
# and full account context in one call.
|
|
23
|
+
def self.bootstrap(opts = {})
|
|
24
|
+
request_object(:get, "/v1/onboarding_sessions/bootstrap", {}, opts)
|
|
25
|
+
end
|
|
18
26
|
end
|
|
19
27
|
end
|
|
@@ -21,6 +21,42 @@ module Frame
|
|
|
21
21
|
)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
def self.create_card(params = {}, opts = {})
|
|
25
|
+
request_object(
|
|
26
|
+
:post,
|
|
27
|
+
"/v1/payment_methods",
|
|
28
|
+
params,
|
|
29
|
+
opts
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.create_bank_account(params = {}, opts = {})
|
|
34
|
+
request_object(
|
|
35
|
+
:post,
|
|
36
|
+
"/v1/payment_methods",
|
|
37
|
+
params,
|
|
38
|
+
opts
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.create_apple_pay(params = {}, opts = {})
|
|
43
|
+
request_object(
|
|
44
|
+
:post,
|
|
45
|
+
"/v1/payment_methods",
|
|
46
|
+
params,
|
|
47
|
+
opts
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def self.create_google_pay(params = {}, opts = {})
|
|
52
|
+
request_object(
|
|
53
|
+
:post,
|
|
54
|
+
"/v1/payment_methods",
|
|
55
|
+
params,
|
|
56
|
+
opts
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
24
60
|
def self.list(params = {}, opts = {})
|
|
25
61
|
request_object(
|
|
26
62
|
:get,
|
|
@@ -40,6 +76,15 @@ module Frame
|
|
|
40
76
|
)
|
|
41
77
|
end
|
|
42
78
|
|
|
79
|
+
def self.update(id, params = {}, opts = {})
|
|
80
|
+
request_object(
|
|
81
|
+
:patch,
|
|
82
|
+
"/v1/payment_methods/#{CGI.escape(id)}",
|
|
83
|
+
params,
|
|
84
|
+
opts
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
|
|
43
88
|
def self.connect_plaid(params = {}, opts = {})
|
|
44
89
|
request_object(
|
|
45
90
|
:post,
|
|
@@ -8,6 +8,11 @@ module Frame
|
|
|
8
8
|
OBJECT_NAME
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# `retrieve` is inherited from APIResource but the payout vocabulary is
|
|
12
|
+
# `create` only — the API exposes no `GET /v1/payouts/{id}` endpoint.
|
|
13
|
+
# Flag it deprecated so it stays out of the parity denominator; removed at v2.
|
|
14
|
+
DEPRECATED_METHODS = %i[retrieve].freeze
|
|
15
|
+
|
|
11
16
|
def self.create(params = {}, opts = {})
|
|
12
17
|
request_object(:post, "/v1/payouts", params, opts)
|
|
13
18
|
end
|
|
@@ -8,6 +8,12 @@ module Frame
|
|
|
8
8
|
OBJECT_NAME
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# `retrieve` is inherited from APIResource but the API exposes no
|
|
12
|
+
# `GET /phone_verifications/{id}` endpoint — the canonical surface is
|
|
13
|
+
# create + confirm only. Flag it deprecated so it stays out of the parity
|
|
14
|
+
# denominator; removed at v2.
|
|
15
|
+
DEPRECATED_METHODS = %i[retrieve].freeze
|
|
16
|
+
|
|
11
17
|
def self.create(account_id, params = {}, opts = {})
|
|
12
18
|
request_object(:post, "/v1/accounts/#{CGI.escape(account_id)}/phone_verifications", params, opts)
|
|
13
19
|
end
|
|
@@ -50,6 +50,15 @@ module Frame
|
|
|
50
50
|
)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
def self.update(id, params = {}, opts = {})
|
|
54
|
+
request_object(
|
|
55
|
+
:patch,
|
|
56
|
+
"/v1/products/#{CGI.escape(id)}",
|
|
57
|
+
params,
|
|
58
|
+
opts
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
53
62
|
def self.delete(id, params = {}, opts = {})
|
|
54
63
|
request_object(
|
|
55
64
|
:delete,
|
|
@@ -40,6 +40,15 @@ module Frame
|
|
|
40
40
|
)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
def self.update(product_id, id, params = {}, opts = {})
|
|
44
|
+
request_object(
|
|
45
|
+
:patch,
|
|
46
|
+
"/v1/products/#{CGI.escape(product_id)}/phases/#{CGI.escape(id)}",
|
|
47
|
+
params,
|
|
48
|
+
opts
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
43
52
|
def self.bulk_update(product_id, phases, opts = {})
|
|
44
53
|
request_object(
|
|
45
54
|
:patch,
|
|
@@ -22,6 +22,10 @@ module Frame
|
|
|
22
22
|
request_object(:get, "/v1/promotion_codes/#{CGI.escape(id)}", {}, opts)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
def self.update(id, params = {}, opts = {})
|
|
26
|
+
request_object(:patch, "/v1/promotion_codes/#{CGI.escape(id)}", params, opts)
|
|
27
|
+
end
|
|
28
|
+
|
|
25
29
|
def save(params = {}, opts = {})
|
|
26
30
|
values = serialize_params(self).merge(params)
|
|
27
31
|
return self if values.empty?
|
|
@@ -4,7 +4,6 @@ module Frame
|
|
|
4
4
|
class Subscription < APIResource
|
|
5
5
|
extend Frame::APIOperations::Create
|
|
6
6
|
extend Frame::APIOperations::List
|
|
7
|
-
include Frame::APIOperations::Delete
|
|
8
7
|
include Frame::APIOperations::Save
|
|
9
8
|
|
|
10
9
|
OBJECT_NAME = "subscription"
|
|
@@ -41,15 +40,24 @@ module Frame
|
|
|
41
40
|
)
|
|
42
41
|
end
|
|
43
42
|
|
|
44
|
-
def self.
|
|
43
|
+
def self.update(id, params = {}, opts = {})
|
|
45
44
|
request_object(
|
|
46
|
-
:
|
|
45
|
+
:patch,
|
|
47
46
|
"/v1/subscriptions/#{CGI.escape(id)}",
|
|
48
47
|
params,
|
|
49
48
|
opts
|
|
50
49
|
)
|
|
51
50
|
end
|
|
52
51
|
|
|
52
|
+
def self.search(params = {}, opts = {})
|
|
53
|
+
request_object(
|
|
54
|
+
:get,
|
|
55
|
+
"/v1/subscriptions/search",
|
|
56
|
+
params,
|
|
57
|
+
opts
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
53
61
|
def save(params = {}, opts = {})
|
|
54
62
|
values = serialize_params(self).merge(params)
|
|
55
63
|
|
|
@@ -68,19 +76,28 @@ module Frame
|
|
|
68
76
|
self
|
|
69
77
|
end
|
|
70
78
|
|
|
71
|
-
def
|
|
79
|
+
def cancel(params = {}, opts = {})
|
|
72
80
|
request_object(
|
|
73
|
-
:
|
|
74
|
-
"/v1/subscriptions/#{CGI.escape(self["id"])}",
|
|
81
|
+
:post,
|
|
82
|
+
"/v1/subscriptions/#{CGI.escape(self["id"])}/cancel",
|
|
75
83
|
params,
|
|
76
84
|
opts
|
|
77
85
|
)
|
|
78
86
|
end
|
|
79
87
|
|
|
80
|
-
def
|
|
88
|
+
def pause(params = {}, opts = {})
|
|
81
89
|
request_object(
|
|
82
90
|
:post,
|
|
83
|
-
"/v1/subscriptions/#{CGI.escape(self["id"])}/
|
|
91
|
+
"/v1/subscriptions/#{CGI.escape(self["id"])}/pause",
|
|
92
|
+
params,
|
|
93
|
+
opts
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def resume(params = {}, opts = {})
|
|
98
|
+
request_object(
|
|
99
|
+
:post,
|
|
100
|
+
"/v1/subscriptions/#{CGI.escape(self["id"])}/resume",
|
|
84
101
|
params,
|
|
85
102
|
opts
|
|
86
103
|
)
|
|
@@ -94,5 +111,23 @@ module Frame
|
|
|
94
111
|
opts
|
|
95
112
|
)
|
|
96
113
|
end
|
|
114
|
+
|
|
115
|
+
def self.pause(id, params = {}, opts = {})
|
|
116
|
+
request_object(
|
|
117
|
+
:post,
|
|
118
|
+
"/v1/subscriptions/#{CGI.escape(id)}/pause",
|
|
119
|
+
params,
|
|
120
|
+
opts
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def self.resume(id, params = {}, opts = {})
|
|
125
|
+
request_object(
|
|
126
|
+
:post,
|
|
127
|
+
"/v1/subscriptions/#{CGI.escape(id)}/resume",
|
|
128
|
+
params,
|
|
129
|
+
opts
|
|
130
|
+
)
|
|
131
|
+
end
|
|
97
132
|
end
|
|
98
133
|
end
|
|
@@ -40,6 +40,15 @@ module Frame
|
|
|
40
40
|
)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
def self.update(subscription_id, id, params = {}, opts = {})
|
|
44
|
+
request_object(
|
|
45
|
+
:patch,
|
|
46
|
+
"/v1/subscriptions/#{CGI.escape(subscription_id)}/phases/#{CGI.escape(id)}",
|
|
47
|
+
params,
|
|
48
|
+
opts
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
43
52
|
def self.bulk_update(subscription_id, phases, opts = {})
|
|
44
53
|
request_object(
|
|
45
54
|
:patch,
|