orb-billing 1.60.0 → 1.61.0

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 (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +4 -0
  5. data/lib/orb/models/account/billing_entity.rb +214 -0
  6. data/lib/orb/models/account/billing_entity_archive_by_external_id_params.rb +22 -0
  7. data/lib/orb/models/account/billing_entity_archive_params.rb +22 -0
  8. data/lib/orb/models/account/billing_entity_create_params.rb +117 -0
  9. data/lib/orb/models/account/billing_entity_fetch_by_external_id_params.rb +22 -0
  10. data/lib/orb/models/account/billing_entity_fetch_params.rb +22 -0
  11. data/lib/orb/models/account/billing_entity_list_params.rb +55 -0
  12. data/lib/orb/models/account/billing_entity_unarchive_by_external_id_params.rb +22 -0
  13. data/lib/orb/models/account/billing_entity_unarchive_params.rb +22 -0
  14. data/lib/orb/models/account/billing_entity_update_by_external_id_params.rb +177 -0
  15. data/lib/orb/models/account/billing_entity_update_params.rb +179 -0
  16. data/lib/orb/models/account/payment_gateway_connection.rb +75 -0
  17. data/lib/orb/models/account/payment_gateway_connection_fetch_params.rb +22 -0
  18. data/lib/orb/models/account/payment_gateway_connection_list_params.rb +65 -0
  19. data/lib/orb/models/customers/customer_payment_gateway_connection.rb +89 -0
  20. data/lib/orb/models/customers/payment_gateway_connection_create_by_external_id_params.rb +53 -0
  21. data/lib/orb/models/customers/payment_gateway_connection_create_params.rb +52 -0
  22. data/lib/orb/models/customers/payment_gateway_connection_delete_by_external_id_params.rb +28 -0
  23. data/lib/orb/models/customers/payment_gateway_connection_delete_params.rb +28 -0
  24. data/lib/orb/models/customers/payment_gateway_connection_list_by_external_id_params.rb +39 -0
  25. data/lib/orb/models/customers/payment_gateway_connection_list_by_external_id_response.rb +25 -0
  26. data/lib/orb/models/customers/payment_gateway_connection_list_params.rb +39 -0
  27. data/lib/orb/models/customers/payment_gateway_connection_list_response.rb +25 -0
  28. data/lib/orb/models/customers/payment_gateway_connection_update_by_external_id_params.rb +68 -0
  29. data/lib/orb/models/customers/payment_gateway_connection_update_params.rb +67 -0
  30. data/lib/orb/models.rb +2 -0
  31. data/lib/orb/resources/account/billing_entities.rb +321 -0
  32. data/lib/orb/resources/account/payment_gateway_connections.rb +71 -0
  33. data/lib/orb/resources/account.rb +26 -0
  34. data/lib/orb/resources/customers/payment_gateway_connections.rb +310 -0
  35. data/lib/orb/resources/customers.rb +22 -0
  36. data/lib/orb/version.rb +1 -1
  37. data/lib/orb.rb +29 -0
  38. data/rbi/orb/client.rbi +3 -0
  39. data/rbi/orb/models/account/billing_entity.rbi +342 -0
  40. data/rbi/orb/models/account/billing_entity_archive_by_external_id_params.rbi +43 -0
  41. data/rbi/orb/models/account/billing_entity_archive_params.rbi +40 -0
  42. data/rbi/orb/models/account/billing_entity_create_params.rbi +208 -0
  43. data/rbi/orb/models/account/billing_entity_fetch_by_external_id_params.rbi +43 -0
  44. data/rbi/orb/models/account/billing_entity_fetch_params.rbi +40 -0
  45. data/rbi/orb/models/account/billing_entity_list_params.rbi +108 -0
  46. data/rbi/orb/models/account/billing_entity_unarchive_by_external_id_params.rbi +43 -0
  47. data/rbi/orb/models/account/billing_entity_unarchive_params.rbi +40 -0
  48. data/rbi/orb/models/account/billing_entity_update_by_external_id_params.rbi +335 -0
  49. data/rbi/orb/models/account/billing_entity_update_params.rbi +331 -0
  50. data/rbi/orb/models/account/payment_gateway_connection.rbi +125 -0
  51. data/rbi/orb/models/account/payment_gateway_connection_fetch_params.rbi +43 -0
  52. data/rbi/orb/models/account/payment_gateway_connection_list_params.rbi +124 -0
  53. data/rbi/orb/models/customers/customer_payment_gateway_connection.rbi +139 -0
  54. data/rbi/orb/models/customers/payment_gateway_connection_create_by_external_id_params.rbi +77 -0
  55. data/rbi/orb/models/customers/payment_gateway_connection_create_params.rbi +77 -0
  56. data/rbi/orb/models/customers/payment_gateway_connection_delete_by_external_id_params.rbi +52 -0
  57. data/rbi/orb/models/customers/payment_gateway_connection_delete_params.rbi +52 -0
  58. data/rbi/orb/models/customers/payment_gateway_connection_list_by_external_id_params.rbi +62 -0
  59. data/rbi/orb/models/customers/payment_gateway_connection_list_by_external_id_response.rbi +47 -0
  60. data/rbi/orb/models/customers/payment_gateway_connection_list_params.rbi +62 -0
  61. data/rbi/orb/models/customers/payment_gateway_connection_list_response.rbi +47 -0
  62. data/rbi/orb/models/customers/payment_gateway_connection_update_by_external_id_params.rbi +120 -0
  63. data/rbi/orb/models/customers/payment_gateway_connection_update_params.rbi +120 -0
  64. data/rbi/orb/models.rbi +2 -0
  65. data/rbi/orb/resources/account/billing_entities.rbi +289 -0
  66. data/rbi/orb/resources/account/payment_gateway_connections.rbi +54 -0
  67. data/rbi/orb/resources/account.rbi +22 -0
  68. data/rbi/orb/resources/customers/payment_gateway_connections.rbi +234 -0
  69. data/rbi/orb/resources/customers.rbi +21 -0
  70. data/sig/orb/client.rbs +2 -0
  71. data/sig/orb/models/account/billing_entity.rbs +155 -0
  72. data/sig/orb/models/account/billing_entity_archive_by_external_id_params.rbs +26 -0
  73. data/sig/orb/models/account/billing_entity_archive_params.rbs +25 -0
  74. data/sig/orb/models/account/billing_entity_create_params.rbs +86 -0
  75. data/sig/orb/models/account/billing_entity_fetch_by_external_id_params.rbs +26 -0
  76. data/sig/orb/models/account/billing_entity_fetch_params.rbs +25 -0
  77. data/sig/orb/models/account/billing_entity_list_params.rbs +51 -0
  78. data/sig/orb/models/account/billing_entity_unarchive_by_external_id_params.rbs +26 -0
  79. data/sig/orb/models/account/billing_entity_unarchive_params.rbs +25 -0
  80. data/sig/orb/models/account/billing_entity_update_by_external_id_params.rbs +125 -0
  81. data/sig/orb/models/account/billing_entity_update_params.rbs +125 -0
  82. data/sig/orb/models/account/payment_gateway_connection.rbs +58 -0
  83. data/sig/orb/models/account/payment_gateway_connection_fetch_params.rbs +26 -0
  84. data/sig/orb/models/account/payment_gateway_connection_list_params.rbs +56 -0
  85. data/sig/orb/models/customers/customer_payment_gateway_connection.rbs +65 -0
  86. data/sig/orb/models/customers/payment_gateway_connection_create_by_external_id_params.rbs +45 -0
  87. data/sig/orb/models/customers/payment_gateway_connection_create_params.rbs +45 -0
  88. data/sig/orb/models/customers/payment_gateway_connection_delete_by_external_id_params.rbs +30 -0
  89. data/sig/orb/models/customers/payment_gateway_connection_delete_params.rbs +30 -0
  90. data/sig/orb/models/customers/payment_gateway_connection_list_by_external_id_params.rbs +38 -0
  91. data/sig/orb/models/customers/payment_gateway_connection_list_by_external_id_response.rbs +27 -0
  92. data/sig/orb/models/customers/payment_gateway_connection_list_params.rbs +38 -0
  93. data/sig/orb/models/customers/payment_gateway_connection_list_response.rbs +27 -0
  94. data/sig/orb/models/customers/payment_gateway_connection_update_by_external_id_params.rbs +53 -0
  95. data/sig/orb/models/customers/payment_gateway_connection_update_params.rbs +53 -0
  96. data/sig/orb/models.rbs +2 -0
  97. data/sig/orb/resources/account/billing_entities.rbs +80 -0
  98. data/sig/orb/resources/account/payment_gateway_connections.rbs +22 -0
  99. data/sig/orb/resources/account.rbs +11 -0
  100. data/sig/orb/resources/customers/payment_gateway_connections.rbs +67 -0
  101. data/sig/orb/resources/customers.rbs +2 -0
  102. metadata +88 -1
@@ -0,0 +1,120 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ module Customers
6
+ class PaymentGatewayConnectionUpdateByExternalIDParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Orb::Customers::PaymentGatewayConnectionUpdateByExternalIDParams,
14
+ Orb::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :external_customer_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :payment_gateway_connection_id
23
+
24
+ # Only `true` is accepted: it makes this the customer's default mapping for the
25
+ # connection's billing entity. Omit it to keep the current default. To move the
26
+ # default, set it on another mapping.
27
+ sig do
28
+ returns(
29
+ T.nilable(
30
+ Orb::Customers::PaymentGatewayConnectionUpdateByExternalIDParams::IsDefault::OrBoolean
31
+ )
32
+ )
33
+ end
34
+ attr_accessor :is_default
35
+
36
+ # The ID of the customer in the external payment provider. Omit it to keep the
37
+ # current one; `null` clears it, and Orb creates a Stripe customer at the next
38
+ # payment through this connection.
39
+ sig { returns(T.nilable(String)) }
40
+ attr_accessor :provider_customer_id
41
+
42
+ sig do
43
+ params(
44
+ external_customer_id: String,
45
+ payment_gateway_connection_id: String,
46
+ is_default:
47
+ T.nilable(
48
+ Orb::Customers::PaymentGatewayConnectionUpdateByExternalIDParams::IsDefault::OrBoolean
49
+ ),
50
+ provider_customer_id: T.nilable(String),
51
+ request_options: Orb::RequestOptions::OrHash
52
+ ).returns(T.attached_class)
53
+ end
54
+ def self.new(
55
+ external_customer_id:,
56
+ payment_gateway_connection_id:,
57
+ # Only `true` is accepted: it makes this the customer's default mapping for the
58
+ # connection's billing entity. Omit it to keep the current default. To move the
59
+ # default, set it on another mapping.
60
+ is_default: nil,
61
+ # The ID of the customer in the external payment provider. Omit it to keep the
62
+ # current one; `null` clears it, and Orb creates a Stripe customer at the next
63
+ # payment through this connection.
64
+ provider_customer_id: nil,
65
+ request_options: {}
66
+ )
67
+ end
68
+
69
+ sig do
70
+ override.returns(
71
+ {
72
+ external_customer_id: String,
73
+ payment_gateway_connection_id: String,
74
+ is_default:
75
+ T.nilable(
76
+ Orb::Customers::PaymentGatewayConnectionUpdateByExternalIDParams::IsDefault::OrBoolean
77
+ ),
78
+ provider_customer_id: T.nilable(String),
79
+ request_options: Orb::RequestOptions
80
+ }
81
+ )
82
+ end
83
+ def to_hash
84
+ end
85
+
86
+ # Only `true` is accepted: it makes this the customer's default mapping for the
87
+ # connection's billing entity. Omit it to keep the current default. To move the
88
+ # default, set it on another mapping.
89
+ module IsDefault
90
+ extend Orb::Internal::Type::Enum
91
+
92
+ TaggedBoolean =
93
+ T.type_alias do
94
+ T.all(
95
+ T::Boolean,
96
+ Orb::Customers::PaymentGatewayConnectionUpdateByExternalIDParams::IsDefault
97
+ )
98
+ end
99
+ OrBoolean = T.type_alias { T::Boolean }
100
+
101
+ TRUE =
102
+ T.let(
103
+ true,
104
+ Orb::Customers::PaymentGatewayConnectionUpdateByExternalIDParams::IsDefault::TaggedBoolean
105
+ )
106
+
107
+ sig do
108
+ override.returns(
109
+ T::Array[
110
+ Orb::Customers::PaymentGatewayConnectionUpdateByExternalIDParams::IsDefault::TaggedBoolean
111
+ ]
112
+ )
113
+ end
114
+ def self.values
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,120 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Models
5
+ module Customers
6
+ class PaymentGatewayConnectionUpdateParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Orb::Customers::PaymentGatewayConnectionUpdateParams,
14
+ Orb::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :customer_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :payment_gateway_connection_id
23
+
24
+ # Only `true` is accepted: it makes this the customer's default mapping for the
25
+ # connection's billing entity. Omit it to keep the current default. To move the
26
+ # default, set it on another mapping.
27
+ sig do
28
+ returns(
29
+ T.nilable(
30
+ Orb::Customers::PaymentGatewayConnectionUpdateParams::IsDefault::OrBoolean
31
+ )
32
+ )
33
+ end
34
+ attr_accessor :is_default
35
+
36
+ # The ID of the customer in the external payment provider. Omit it to keep the
37
+ # current one; `null` clears it, and Orb creates a Stripe customer at the next
38
+ # payment through this connection.
39
+ sig { returns(T.nilable(String)) }
40
+ attr_accessor :provider_customer_id
41
+
42
+ sig do
43
+ params(
44
+ customer_id: String,
45
+ payment_gateway_connection_id: String,
46
+ is_default:
47
+ T.nilable(
48
+ Orb::Customers::PaymentGatewayConnectionUpdateParams::IsDefault::OrBoolean
49
+ ),
50
+ provider_customer_id: T.nilable(String),
51
+ request_options: Orb::RequestOptions::OrHash
52
+ ).returns(T.attached_class)
53
+ end
54
+ def self.new(
55
+ customer_id:,
56
+ payment_gateway_connection_id:,
57
+ # Only `true` is accepted: it makes this the customer's default mapping for the
58
+ # connection's billing entity. Omit it to keep the current default. To move the
59
+ # default, set it on another mapping.
60
+ is_default: nil,
61
+ # The ID of the customer in the external payment provider. Omit it to keep the
62
+ # current one; `null` clears it, and Orb creates a Stripe customer at the next
63
+ # payment through this connection.
64
+ provider_customer_id: nil,
65
+ request_options: {}
66
+ )
67
+ end
68
+
69
+ sig do
70
+ override.returns(
71
+ {
72
+ customer_id: String,
73
+ payment_gateway_connection_id: String,
74
+ is_default:
75
+ T.nilable(
76
+ Orb::Customers::PaymentGatewayConnectionUpdateParams::IsDefault::OrBoolean
77
+ ),
78
+ provider_customer_id: T.nilable(String),
79
+ request_options: Orb::RequestOptions
80
+ }
81
+ )
82
+ end
83
+ def to_hash
84
+ end
85
+
86
+ # Only `true` is accepted: it makes this the customer's default mapping for the
87
+ # connection's billing entity. Omit it to keep the current default. To move the
88
+ # default, set it on another mapping.
89
+ module IsDefault
90
+ extend Orb::Internal::Type::Enum
91
+
92
+ TaggedBoolean =
93
+ T.type_alias do
94
+ T.all(
95
+ T::Boolean,
96
+ Orb::Customers::PaymentGatewayConnectionUpdateParams::IsDefault
97
+ )
98
+ end
99
+ OrBoolean = T.type_alias { T::Boolean }
100
+
101
+ TRUE =
102
+ T.let(
103
+ true,
104
+ Orb::Customers::PaymentGatewayConnectionUpdateParams::IsDefault::TaggedBoolean
105
+ )
106
+
107
+ sig do
108
+ override.returns(
109
+ T::Array[
110
+ Orb::Customers::PaymentGatewayConnectionUpdateParams::IsDefault::TaggedBoolean
111
+ ]
112
+ )
113
+ end
114
+ def self.values
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
data/rbi/orb/models.rbi CHANGED
@@ -1,6 +1,8 @@
1
1
  # typed: strong
2
2
 
3
3
  module Orb
4
+ Account = Orb::Models::Account
5
+
4
6
  AccountingProviderConfig = Orb::Models::AccountingProviderConfig
5
7
 
6
8
  Address = Orb::Models::Address
@@ -0,0 +1,289 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Resources
5
+ class Account
6
+ # A billing entity is a legal entity an account invoices from, with its own legal
7
+ # name, address and tax registrations.
8
+ class BillingEntities
9
+ # This endpoint creates a billing entity: a legal entity the account invoices
10
+ # from, with its own legal name, address, tax registrations, and invoice settings.
11
+ # `external_billing_entity_id` cannot be changed after creation. This endpoint
12
+ # requires an admin API key.
13
+ sig do
14
+ params(
15
+ address: Orb::AddressInput::OrHash,
16
+ legal_name: String,
17
+ name: String,
18
+ external_billing_entity_id: T.nilable(String),
19
+ invoice_settings:
20
+ T.nilable(
21
+ Orb::Account::BillingEntityCreateParams::InvoiceSettings::OrHash
22
+ ),
23
+ tax_registrations:
24
+ T::Array[
25
+ Orb::Account::BillingEntityCreateParams::TaxRegistration::OrHash
26
+ ],
27
+ request_options: Orb::RequestOptions::OrHash
28
+ ).returns(Orb::Account::BillingEntity)
29
+ end
30
+ def create(
31
+ # The address printed on invoices.
32
+ address:,
33
+ # The legal name printed on invoices.
34
+ legal_name:,
35
+ # An internal name for the billing entity.
36
+ name:,
37
+ # An optional user-defined ID for this billing entity, unique within the account.
38
+ # This cannot be changed after creation.
39
+ external_billing_entity_id: nil,
40
+ # Settings that override the account's for this billing entity.
41
+ invoice_settings: nil,
42
+ tax_registrations: nil,
43
+ request_options: {}
44
+ )
45
+ end
46
+
47
+ # This endpoint updates a billing entity, including the default one. Omitted
48
+ # fields keep their value. A change to the name, legal name, address, or tax
49
+ # registrations writes a new version of the billing entity; invoices already
50
+ # issued keep the version they were issued with. In `invoice_settings`, a null
51
+ # `memo` clears it so the billing entity uses the account's memo. An archived
52
+ # billing entity cannot be updated until it is unarchived. This endpoint requires
53
+ # an admin API key.
54
+ #
55
+ # `payment_gateway_connections` is the full set of connections the billing entity
56
+ # collects payments through; a connection left out is disconnected from the
57
+ # billing entity. If a payment through a connection left out is still in progress,
58
+ # the whole update is rejected and can be retried once the payment finishes.
59
+ sig do
60
+ params(
61
+ billing_entity_id: String,
62
+ address: T.nilable(Orb::AddressInput::OrHash),
63
+ default_payment_gateway_connection_id: T.nilable(String),
64
+ invoice_settings:
65
+ T.nilable(
66
+ Orb::Account::BillingEntityUpdateParams::InvoiceSettings::OrHash
67
+ ),
68
+ legal_name: T.nilable(String),
69
+ name: T.nilable(String),
70
+ payment_gateway_connections:
71
+ T.nilable(
72
+ T::Array[
73
+ Orb::Account::BillingEntityUpdateParams::PaymentGatewayConnection::OrHash
74
+ ]
75
+ ),
76
+ tax_registrations:
77
+ T.nilable(
78
+ T::Array[
79
+ Orb::Account::BillingEntityUpdateParams::TaxRegistration::OrHash
80
+ ]
81
+ ),
82
+ request_options: Orb::RequestOptions::OrHash
83
+ ).returns(Orb::Account::BillingEntity)
84
+ end
85
+ def update(
86
+ billing_entity_id,
87
+ # Replaces the whole address. Omit it to keep the current one.
88
+ address: nil,
89
+ # The ID of the connection Orb charges when the customer is not mapped to any of
90
+ # the billing entity's connections. Required when `payment_gateway_connections`
91
+ # has more than one entry.
92
+ default_payment_gateway_connection_id: nil,
93
+ # The invoice settings to change. Omitted fields keep their value; null clears a
94
+ # field so it inherits the account's setting.
95
+ invoice_settings: nil,
96
+ # The legal name printed on invoices.
97
+ legal_name: nil,
98
+ # An internal name for the billing entity.
99
+ name: nil,
100
+ # The full set of payment gateway connections the billing entity collects payments
101
+ # through. Omit it to keep the current ones. Naming another billing entity's
102
+ # connection gives this billing entity a connection of its own through the same
103
+ # Stripe account or Adyen merchant account.
104
+ payment_gateway_connections: nil,
105
+ # The full list of registrations. Omit it to keep the current ones.
106
+ tax_registrations: nil,
107
+ request_options: {}
108
+ )
109
+ end
110
+
111
+ # This endpoint returns the account's billing entities, including the default
112
+ # billing entity (`is_default: true`), ordered in descending order by creation
113
+ # time.
114
+ sig do
115
+ params(
116
+ cursor: T.nilable(String),
117
+ limit: Integer,
118
+ status:
119
+ T.nilable(
120
+ Orb::Account::BillingEntityListParams::Status::OrSymbol
121
+ ),
122
+ request_options: Orb::RequestOptions::OrHash
123
+ ).returns(Orb::Internal::Page[Orb::Account::BillingEntity])
124
+ end
125
+ def list(
126
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
127
+ # from the initial request.
128
+ cursor: nil,
129
+ # The number of items to fetch. Defaults to 20.
130
+ limit: nil,
131
+ # Only return billing entities with this status. Omit to return both.
132
+ status: nil,
133
+ request_options: {}
134
+ )
135
+ end
136
+
137
+ # This endpoint archives a billing entity. An archived billing entity cannot be
138
+ # updated; invoices already issued keep it. The default billing entity cannot be
139
+ # archived. Archiving a billing entity that is already archived returns it
140
+ # unchanged. This endpoint requires an admin API key.
141
+ sig do
142
+ params(
143
+ billing_entity_id: String,
144
+ request_options: Orb::RequestOptions::OrHash
145
+ ).returns(Orb::Account::BillingEntity)
146
+ end
147
+ def archive(billing_entity_id, request_options: {})
148
+ end
149
+
150
+ # This endpoint archives a billing entity. An archived billing entity cannot be
151
+ # updated; invoices already issued keep it. The default billing entity cannot be
152
+ # archived. Archiving a billing entity that is already archived returns it
153
+ # unchanged. This endpoint requires an admin API key.
154
+ sig do
155
+ params(
156
+ external_billing_entity_id: String,
157
+ request_options: Orb::RequestOptions::OrHash
158
+ ).returns(Orb::Account::BillingEntity)
159
+ end
160
+ def archive_by_external_id(
161
+ external_billing_entity_id,
162
+ request_options: {}
163
+ )
164
+ end
165
+
166
+ # This endpoint returns a billing entity identified by its ID, or by the
167
+ # `external_billing_entity_id` set when it was created.
168
+ sig do
169
+ params(
170
+ billing_entity_id: String,
171
+ request_options: Orb::RequestOptions::OrHash
172
+ ).returns(Orb::Account::BillingEntity)
173
+ end
174
+ def fetch(billing_entity_id, request_options: {})
175
+ end
176
+
177
+ # This endpoint returns a billing entity identified by its ID, or by the
178
+ # `external_billing_entity_id` set when it was created.
179
+ sig do
180
+ params(
181
+ external_billing_entity_id: String,
182
+ request_options: Orb::RequestOptions::OrHash
183
+ ).returns(Orb::Account::BillingEntity)
184
+ end
185
+ def fetch_by_external_id(
186
+ external_billing_entity_id,
187
+ request_options: {}
188
+ )
189
+ end
190
+
191
+ # This endpoint restores an archived billing entity to active. Unarchiving an
192
+ # active billing entity returns it unchanged. This endpoint requires an admin API
193
+ # key.
194
+ sig do
195
+ params(
196
+ billing_entity_id: String,
197
+ request_options: Orb::RequestOptions::OrHash
198
+ ).returns(Orb::Account::BillingEntity)
199
+ end
200
+ def unarchive(billing_entity_id, request_options: {})
201
+ end
202
+
203
+ # This endpoint restores an archived billing entity to active. Unarchiving an
204
+ # active billing entity returns it unchanged. This endpoint requires an admin API
205
+ # key.
206
+ sig do
207
+ params(
208
+ external_billing_entity_id: String,
209
+ request_options: Orb::RequestOptions::OrHash
210
+ ).returns(Orb::Account::BillingEntity)
211
+ end
212
+ def unarchive_by_external_id(
213
+ external_billing_entity_id,
214
+ request_options: {}
215
+ )
216
+ end
217
+
218
+ # This endpoint updates a billing entity, including the default one. Omitted
219
+ # fields keep their value. A change to the name, legal name, address, or tax
220
+ # registrations writes a new version of the billing entity; invoices already
221
+ # issued keep the version they were issued with. In `invoice_settings`, a null
222
+ # `memo` clears it so the billing entity uses the account's memo. An archived
223
+ # billing entity cannot be updated until it is unarchived. This endpoint requires
224
+ # an admin API key.
225
+ #
226
+ # `payment_gateway_connections` is the full set of connections the billing entity
227
+ # collects payments through; a connection left out is disconnected from the
228
+ # billing entity. If a payment through a connection left out is still in progress,
229
+ # the whole update is rejected and can be retried once the payment finishes.
230
+ sig do
231
+ params(
232
+ external_billing_entity_id: String,
233
+ address: T.nilable(Orb::AddressInput::OrHash),
234
+ default_payment_gateway_connection_id: T.nilable(String),
235
+ invoice_settings:
236
+ T.nilable(
237
+ Orb::Account::BillingEntityUpdateByExternalIDParams::InvoiceSettings::OrHash
238
+ ),
239
+ legal_name: T.nilable(String),
240
+ name: T.nilable(String),
241
+ payment_gateway_connections:
242
+ T.nilable(
243
+ T::Array[
244
+ Orb::Account::BillingEntityUpdateByExternalIDParams::PaymentGatewayConnection::OrHash
245
+ ]
246
+ ),
247
+ tax_registrations:
248
+ T.nilable(
249
+ T::Array[
250
+ Orb::Account::BillingEntityUpdateByExternalIDParams::TaxRegistration::OrHash
251
+ ]
252
+ ),
253
+ request_options: Orb::RequestOptions::OrHash
254
+ ).returns(Orb::Account::BillingEntity)
255
+ end
256
+ def update_by_external_id(
257
+ external_billing_entity_id,
258
+ # Replaces the whole address. Omit it to keep the current one.
259
+ address: nil,
260
+ # The ID of the connection Orb charges when the customer is not mapped to any of
261
+ # the billing entity's connections. Required when `payment_gateway_connections`
262
+ # has more than one entry.
263
+ default_payment_gateway_connection_id: nil,
264
+ # The invoice settings to change. Omitted fields keep their value; null clears a
265
+ # field so it inherits the account's setting.
266
+ invoice_settings: nil,
267
+ # The legal name printed on invoices.
268
+ legal_name: nil,
269
+ # An internal name for the billing entity.
270
+ name: nil,
271
+ # The full set of payment gateway connections the billing entity collects payments
272
+ # through. Omit it to keep the current ones. Naming another billing entity's
273
+ # connection gives this billing entity a connection of its own through the same
274
+ # Stripe account or Adyen merchant account.
275
+ payment_gateway_connections: nil,
276
+ # The full list of registrations. Omit it to keep the current ones.
277
+ tax_registrations: nil,
278
+ request_options: {}
279
+ )
280
+ end
281
+
282
+ # @api private
283
+ sig { params(client: Orb::Client).returns(T.attached_class) }
284
+ def self.new(client:)
285
+ end
286
+ end
287
+ end
288
+ end
289
+ end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Resources
5
+ class Account
6
+ # A payment gateway connection is one Stripe account or one Adyen merchant account
7
+ # that a billing entity collects payments through.
8
+ class PaymentGatewayConnections
9
+ # This endpoint returns the account's payment gateway connections with the billing
10
+ # entity each one collects for, ordered in descending order by creation time.
11
+ sig do
12
+ params(
13
+ billing_entity_id: T.nilable(String),
14
+ cursor: T.nilable(String),
15
+ limit: Integer,
16
+ provider_type:
17
+ T.nilable(
18
+ Orb::Account::PaymentGatewayConnectionListParams::ProviderType::OrSymbol
19
+ ),
20
+ request_options: Orb::RequestOptions::OrHash
21
+ ).returns(Orb::Internal::Page[Orb::Account::PaymentGatewayConnection])
22
+ end
23
+ def list(
24
+ # Only return connections of this billing entity.
25
+ billing_entity_id: nil,
26
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
27
+ # from the initial request.
28
+ cursor: nil,
29
+ # The number of items to fetch. Defaults to 20.
30
+ limit: nil,
31
+ # Only return connections of this payment provider.
32
+ provider_type: nil,
33
+ request_options: {}
34
+ )
35
+ end
36
+
37
+ # This endpoint returns a payment gateway connection identified by its ID.
38
+ sig do
39
+ params(
40
+ payment_gateway_connection_id: String,
41
+ request_options: Orb::RequestOptions::OrHash
42
+ ).returns(Orb::Account::PaymentGatewayConnection)
43
+ end
44
+ def fetch(payment_gateway_connection_id, request_options: {})
45
+ end
46
+
47
+ # @api private
48
+ sig { params(client: Orb::Client).returns(T.attached_class) }
49
+ def self.new(client:)
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,22 @@
1
+ # typed: strong
2
+
3
+ module Orb
4
+ module Resources
5
+ class Account
6
+ # A billing entity is a legal entity an account invoices from, with its own legal
7
+ # name, address and tax registrations.
8
+ sig { returns(Orb::Resources::Account::BillingEntities) }
9
+ attr_reader :billing_entities
10
+
11
+ # A payment gateway connection is one Stripe account or one Adyen merchant account
12
+ # that a billing entity collects payments through.
13
+ sig { returns(Orb::Resources::Account::PaymentGatewayConnections) }
14
+ attr_reader :payment_gateway_connections
15
+
16
+ # @api private
17
+ sig { params(client: Orb::Client).returns(T.attached_class) }
18
+ def self.new(client:)
19
+ end
20
+ end
21
+ end
22
+ end