Skip to content

Commit

Permalink
feat(integrations): add support for integration customers (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovrocolic authored Jun 5, 2024
1 parent 70be9ca commit 972c92e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const (
PaymentProviderGocardless CustomerPaymentProvider = "gocardless"
)

type IntegrationType string

const (
IntegrationNetsuite IntegrationType = "netsuite"
)

type CustomerParams struct {
Customer *CustomerInput `json:"customer"`
}
Expand Down Expand Up @@ -79,6 +85,7 @@ type CustomerInput struct {
Timezone string `json:"timezone,omitempty"`
Metadata []CustomerMetadataInput `json:"metadata,omitempty"`
BillingConfiguration CustomerBillingConfigurationInput `json:"billing_configuration,omitempty"`
IntegrationCustomer IntegrationCustomer `json:"integration_customer,omitempty"`
TaxCodes []string `json:"tax_codes,omitempty"`
}

Expand Down Expand Up @@ -106,6 +113,14 @@ type CustomerBillingConfiguration struct {
DocumentLocale string `json:"document_locale,omitempty"`
}

type IntegrationCustomer struct {
ExternalCustomerId string `json:"external_customer_id,omitempty"`
IntegrationType IntegrationType `json:"integration_type,omitempty"`
IntegrationCode bool `json:"integration_code,omitempty"`
SubsidiaryId string `json:"subsidiary_id,omitempty"`
SyncWithProvider bool `json:"sync_with_provider,omitempty"`
}

type CustomerChargeUsage struct {
Units string `json:"units,omitempty"`
EventsCount int `json:"events_count"`
Expand Down Expand Up @@ -198,6 +213,7 @@ type Customer struct {
Phone string `json:"phone,omitempty"`
URL string `json:"url,omitempty"`
BillingConfiguration CustomerBillingConfiguration `json:"billing_configuration,omitempty"`
IntegrationCustomer IntegrationCustomer `json:"integration_customer,omitempty"`
Metadata []MetadataResponse `json:"metadata,omitempty"`
Currency Currency `json:"currency,omitempty"`
Timezone string `json:"timezone,omitempty"`
Expand Down

0 comments on commit 972c92e

Please sign in to comment.