From ac7e4451aaaaf19cd95dfe07bcdfab2e3ca41208 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 01:24:16 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- customer.go | 206 ++++++++++++++++++++++++++++++++++++++++++++++- customer_test.go | 22 ++++- 3 files changed, 227 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index b9f26ca..8fee554 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-033643979990e894363554df06218fabe4493feaa569a013dbdf9a72aa21c45f.yml -openapi_spec_hash: dd9d320ad178bafa06f1eac2977e2ca7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-7936e3f73bbe1d59d27fd7a8a226985927b38fdec1c936c77577381699fb6140.yml +openapi_spec_hash: 1d3f9ed5fbdb0e40d56d6acd9d1736e2 config_hash: e6db17547fe854b1c240407cf4c6dc9e diff --git a/customer.go b/customer.go index 2fc586a..d2e9918 100644 --- a/customer.go +++ b/customer.go @@ -454,7 +454,10 @@ type Customer struct { AccountingSyncConfiguration CustomerAccountingSyncConfiguration `json:"accounting_sync_configuration,nullable"` // Whether automatic tax calculation is enabled for this customer. This field is // nullable for backwards compatibility but will always return a boolean value. - AutomaticTaxEnabled bool `json:"automatic_tax_enabled,nullable"` + AutomaticTaxEnabled bool `json:"automatic_tax_enabled,nullable"` + // Payment configuration for the customer, applicable when using Orb Invoicing with + // a supported payment provider such as Stripe. + PaymentConfiguration CustomerPaymentConfiguration `json:"payment_configuration,nullable"` ReportingConfiguration CustomerReportingConfiguration `json:"reporting_configuration,nullable"` JSON customerJSON `json:"-"` } @@ -484,6 +487,7 @@ type customerJSON struct { Timezone apijson.Field AccountingSyncConfiguration apijson.Field AutomaticTaxEnabled apijson.Field + PaymentConfiguration apijson.Field ReportingConfiguration apijson.Field raw string ExtraFields map[string]apijson.Field @@ -603,6 +607,74 @@ func (r CustomerAccountingSyncConfigurationAccountingProvidersProviderType) IsKn return false } +// Payment configuration for the customer, applicable when using Orb Invoicing with +// a supported payment provider such as Stripe. +type CustomerPaymentConfiguration struct { + // Provider-specific payment configuration. + PaymentProviders []CustomerPaymentConfigurationPaymentProvider `json:"payment_providers"` + JSON customerPaymentConfigurationJSON `json:"-"` +} + +// customerPaymentConfigurationJSON contains the JSON metadata for the struct +// [CustomerPaymentConfiguration] +type customerPaymentConfigurationJSON struct { + PaymentProviders apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomerPaymentConfiguration) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r customerPaymentConfigurationJSON) RawJSON() string { + return r.raw +} + +type CustomerPaymentConfigurationPaymentProvider struct { + // The payment provider to configure. + ProviderType CustomerPaymentConfigurationPaymentProvidersProviderType `json:"provider_type,required"` + // List of Stripe payment method types to exclude for this customer. Excluded + // payment methods will not be available for the customer to select during payment, + // and will not be used for auto-collection. If a customer's default payment method + // becomes excluded, Orb will attempt to use the next available compatible payment + // method for auto-collection. + ExcludedPaymentMethodTypes []string `json:"excluded_payment_method_types"` + JSON customerPaymentConfigurationPaymentProviderJSON `json:"-"` +} + +// customerPaymentConfigurationPaymentProviderJSON contains the JSON metadata for +// the struct [CustomerPaymentConfigurationPaymentProvider] +type customerPaymentConfigurationPaymentProviderJSON struct { + ProviderType apijson.Field + ExcludedPaymentMethodTypes apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *CustomerPaymentConfigurationPaymentProvider) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +func (r customerPaymentConfigurationPaymentProviderJSON) RawJSON() string { + return r.raw +} + +// The payment provider to configure. +type CustomerPaymentConfigurationPaymentProvidersProviderType string + +const ( + CustomerPaymentConfigurationPaymentProvidersProviderTypeStripe CustomerPaymentConfigurationPaymentProvidersProviderType = "stripe" +) + +func (r CustomerPaymentConfigurationPaymentProvidersProviderType) IsKnown() bool { + switch r { + case CustomerPaymentConfigurationPaymentProvidersProviderTypeStripe: + return true + } + return false +} + type CustomerReportingConfiguration struct { Exempt bool `json:"exempt,required"` JSON customerReportingConfigurationJSON `json:"-"` @@ -790,6 +862,9 @@ type CustomerNewParams struct { // by setting the value to `null`, and the entire metadata mapping can be cleared // by setting `metadata` to `null`. Metadata param.Field[map[string]string] `json:"metadata"` + // Payment configuration for the customer, applicable when using Orb Invoicing with + // a supported payment provider such as Stripe. + PaymentConfiguration param.Field[CustomerNewParamsPaymentConfiguration] `json:"payment_configuration"` // This is used for creating charges or invoices in an external system via Orb. // When not in test mode, the connection must first be configured in the Orb // webapp. @@ -955,6 +1030,47 @@ func (r CustomerNewParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } +// Payment configuration for the customer, applicable when using Orb Invoicing with +// a supported payment provider such as Stripe. +type CustomerNewParamsPaymentConfiguration struct { + // Provider-specific payment configuration. + PaymentProviders param.Field[[]CustomerNewParamsPaymentConfigurationPaymentProvider] `json:"payment_providers"` +} + +func (r CustomerNewParamsPaymentConfiguration) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type CustomerNewParamsPaymentConfigurationPaymentProvider struct { + // The payment provider to configure. + ProviderType param.Field[CustomerNewParamsPaymentConfigurationPaymentProvidersProviderType] `json:"provider_type,required"` + // List of Stripe payment method types to exclude for this customer. Excluded + // payment methods will not be available for the customer to select during payment, + // and will not be used for auto-collection. If a customer's default payment method + // becomes excluded, Orb will attempt to use the next available compatible payment + // method for auto-collection. + ExcludedPaymentMethodTypes param.Field[[]string] `json:"excluded_payment_method_types"` +} + +func (r CustomerNewParamsPaymentConfigurationPaymentProvider) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The payment provider to configure. +type CustomerNewParamsPaymentConfigurationPaymentProvidersProviderType string + +const ( + CustomerNewParamsPaymentConfigurationPaymentProvidersProviderTypeStripe CustomerNewParamsPaymentConfigurationPaymentProvidersProviderType = "stripe" +) + +func (r CustomerNewParamsPaymentConfigurationPaymentProvidersProviderType) IsKnown() bool { + switch r { + case CustomerNewParamsPaymentConfigurationPaymentProvidersProviderTypeStripe: + return true + } + return false +} + // This is used for creating charges or invoices in an external system via Orb. // When not in test mode, the connection must first be configured in the Orb // webapp. @@ -1143,6 +1259,9 @@ type CustomerUpdateParams struct { Metadata param.Field[map[string]string] `json:"metadata"` // The full name of the customer Name param.Field[string] `json:"name"` + // Payment configuration for the customer, applicable when using Orb Invoicing with + // a supported payment provider such as Stripe. + PaymentConfiguration param.Field[CustomerUpdateParamsPaymentConfiguration] `json:"payment_configuration"` // This is used for creating charges or invoices in an external system via Orb. // When not in test mode: // @@ -1308,6 +1427,47 @@ func (r CustomerUpdateParams) MarshalJSON() (data []byte, err error) { return apijson.MarshalRoot(r) } +// Payment configuration for the customer, applicable when using Orb Invoicing with +// a supported payment provider such as Stripe. +type CustomerUpdateParamsPaymentConfiguration struct { + // Provider-specific payment configuration. + PaymentProviders param.Field[[]CustomerUpdateParamsPaymentConfigurationPaymentProvider] `json:"payment_providers"` +} + +func (r CustomerUpdateParamsPaymentConfiguration) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type CustomerUpdateParamsPaymentConfigurationPaymentProvider struct { + // The payment provider to configure. + ProviderType param.Field[CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderType] `json:"provider_type,required"` + // List of Stripe payment method types to exclude for this customer. Excluded + // payment methods will not be available for the customer to select during payment, + // and will not be used for auto-collection. If a customer's default payment method + // becomes excluded, Orb will attempt to use the next available compatible payment + // method for auto-collection. + ExcludedPaymentMethodTypes param.Field[[]string] `json:"excluded_payment_method_types"` +} + +func (r CustomerUpdateParamsPaymentConfigurationPaymentProvider) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The payment provider to configure. +type CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderType string + +const ( + CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderTypeStripe CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderType = "stripe" +) + +func (r CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderType) IsKnown() bool { + switch r { + case CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderTypeStripe: + return true + } + return false +} + // This is used for creating charges or invoices in an external system via Orb. // When not in test mode: // @@ -1520,6 +1680,9 @@ type CustomerUpdateByExternalIDParams struct { Metadata param.Field[map[string]string] `json:"metadata"` // The full name of the customer Name param.Field[string] `json:"name"` + // Payment configuration for the customer, applicable when using Orb Invoicing with + // a supported payment provider such as Stripe. + PaymentConfiguration param.Field[CustomerUpdateByExternalIDParamsPaymentConfiguration] `json:"payment_configuration"` // This is used for creating charges or invoices in an external system via Orb. // When not in test mode: // @@ -1685,6 +1848,47 @@ func (r CustomerUpdateByExternalIDParams) MarshalJSON() (data []byte, err error) return apijson.MarshalRoot(r) } +// Payment configuration for the customer, applicable when using Orb Invoicing with +// a supported payment provider such as Stripe. +type CustomerUpdateByExternalIDParamsPaymentConfiguration struct { + // Provider-specific payment configuration. + PaymentProviders param.Field[[]CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvider] `json:"payment_providers"` +} + +func (r CustomerUpdateByExternalIDParamsPaymentConfiguration) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +type CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvider struct { + // The payment provider to configure. + ProviderType param.Field[CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderType] `json:"provider_type,required"` + // List of Stripe payment method types to exclude for this customer. Excluded + // payment methods will not be available for the customer to select during payment, + // and will not be used for auto-collection. If a customer's default payment method + // becomes excluded, Orb will attempt to use the next available compatible payment + // method for auto-collection. + ExcludedPaymentMethodTypes param.Field[[]string] `json:"excluded_payment_method_types"` +} + +func (r CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvider) MarshalJSON() (data []byte, err error) { + return apijson.MarshalRoot(r) +} + +// The payment provider to configure. +type CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderType string + +const ( + CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderTypeStripe CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderType = "stripe" +) + +func (r CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderType) IsKnown() bool { + switch r { + case CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderTypeStripe: + return true + } + return false +} + // This is used for creating charges or invoices in an external system via Orb. // When not in test mode: // diff --git a/customer_test.go b/customer_test.go index 032c172..b62bd49 100644 --- a/customer_test.go +++ b/customer_test.go @@ -58,6 +58,12 @@ func TestCustomerNewWithOptionalParams(t *testing.T) { Metadata: orb.F(map[string]string{ "foo": "string", }), + PaymentConfiguration: orb.F(orb.CustomerNewParamsPaymentConfiguration{ + PaymentProviders: orb.F([]orb.CustomerNewParamsPaymentConfigurationPaymentProvider{{ + ProviderType: orb.F(orb.CustomerNewParamsPaymentConfigurationPaymentProvidersProviderTypeStripe), + ExcludedPaymentMethodTypes: orb.F([]string{"string"}), + }}), + }), PaymentProvider: orb.F(orb.CustomerNewParamsPaymentProviderQuickbooks), PaymentProviderID: orb.F("payment_provider_id"), ReportingConfiguration: orb.F(orb.NewReportingConfigurationParam{ @@ -138,7 +144,13 @@ func TestCustomerUpdateWithOptionalParams(t *testing.T) { Metadata: orb.F(map[string]string{ "foo": "string", }), - Name: orb.F("name"), + Name: orb.F("name"), + PaymentConfiguration: orb.F(orb.CustomerUpdateParamsPaymentConfiguration{ + PaymentProviders: orb.F([]orb.CustomerUpdateParamsPaymentConfigurationPaymentProvider{{ + ProviderType: orb.F(orb.CustomerUpdateParamsPaymentConfigurationPaymentProvidersProviderTypeStripe), + ExcludedPaymentMethodTypes: orb.F([]string{"string"}), + }}), + }), PaymentProvider: orb.F(orb.CustomerUpdateParamsPaymentProviderQuickbooks), PaymentProviderID: orb.F("payment_provider_id"), ReportingConfiguration: orb.F(orb.NewReportingConfigurationParam{ @@ -358,7 +370,13 @@ func TestCustomerUpdateByExternalIDWithOptionalParams(t *testing.T) { Metadata: orb.F(map[string]string{ "foo": "string", }), - Name: orb.F("name"), + Name: orb.F("name"), + PaymentConfiguration: orb.F(orb.CustomerUpdateByExternalIDParamsPaymentConfiguration{ + PaymentProviders: orb.F([]orb.CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvider{{ + ProviderType: orb.F(orb.CustomerUpdateByExternalIDParamsPaymentConfigurationPaymentProvidersProviderTypeStripe), + ExcludedPaymentMethodTypes: orb.F([]string{"string"}), + }}), + }), PaymentProvider: orb.F(orb.CustomerUpdateByExternalIDParamsPaymentProviderQuickbooks), PaymentProviderID: orb.F("payment_provider_id"), ReportingConfiguration: orb.F(orb.NewReportingConfigurationParam{ From 1e74a47fb52eb8e1f9a47cd171c7f63f898004ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 01:24:39 +0000 Subject: [PATCH 2/2] release: 1.47.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4b6cc3c..dc9bcb3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.46.0" + ".": "1.47.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ede4786..252a805 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.47.0 (2025-12-03) + +Full Changelog: [v1.46.0...v1.47.0](https://github.com/orbcorp/orb-go/compare/v1.46.0...v1.47.0) + +### Features + +* **api:** api update ([ac7e445](https://github.com/orbcorp/orb-go/commit/ac7e4451aaaaf19cd95dfe07bcdfab2e3ca41208)) + ## 1.46.0 (2025-12-02) Full Changelog: [v1.45.0...v1.46.0](https://github.com/orbcorp/orb-go/compare/v1.45.0...v1.46.0) diff --git a/README.md b/README.md index 81f9eed..f1d2dfa 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Or to pin the version: ```sh -go get -u 'github.com/orbcorp/orb-go@v1.46.0' +go get -u 'github.com/orbcorp/orb-go@v1.47.0' ``` diff --git a/internal/version.go b/internal/version.go index 7effc33..24cc74c 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "1.46.0" // x-release-please-version +const PackageVersion = "1.47.0" // x-release-please-version